Commit 26dc6c6e authored by verwaest@chromium.org's avatar verwaest@chromium.org

Support setter inlining in CountOperation.

R=svenpanne@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23757018

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16511 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 80dda72f
...@@ -5006,12 +5006,19 @@ void HOptimizedGraphBuilder::BuildStoreNamed(Expression* expr, ...@@ -5006,12 +5006,19 @@ void HOptimizedGraphBuilder::BuildStoreNamed(Expression* expr,
Handle<JSObject> holder; Handle<JSObject> holder;
if (LookupSetter(map, name, &setter, &holder)) { if (LookupSetter(map, name, &setter, &holder)) {
AddCheckConstantFunction(holder, object, map); AddCheckConstantFunction(holder, object, map);
// Don't try to inline if the result_value is different from the if (FLAG_inline_accessors) {
// store_value. That case isn't handled yet by the inlining. if (result_value != store_value) {
if (result_value == store_value && // The result_value and object are already pushed by CountOperation.
FLAG_inline_accessors && // Push(store_value) to complete the arguments to the setter.
TryInlineSetter(setter, id, assignment_id, store_value)) { Push(store_value);
return; bool check = TryInlineSetter(setter, id, assignment_id, store_value);
// Drop the result of the setter to return result_value that's on the
// stack already.
Drop(1);
if (check) return;
} else if (TryInlineSetter(setter, id, assignment_id, store_value)) {
return;
}
} }
Drop(2); Drop(2);
Add<HPushArgument>(object); Add<HPushArgument>(object);
...@@ -7572,6 +7579,9 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) { ...@@ -7572,6 +7579,9 @@ void HOptimizedGraphBuilder::VisitCountOperation(CountOperation* expr) {
after = BuildIncrement(returns_original_input, expr); after = BuildIncrement(returns_original_input, expr);
HValue* result = returns_original_input ? Pop() : after; HValue* result = returns_original_input ? Pop() : after;
if (returns_original_input) {
environment()->SetExpressionStackAt(1, result);
}
return BuildStoreNamed(expr, expr->id(), expr->position(), return BuildStoreNamed(expr, expr->id(), expr->position(),
expr->AssignmentId(), prop, object, after, result); expr->AssignmentId(), prop, object, after, result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment