Revision: 16511
Author:   [email protected]
Date:     Tue Sep  3 14:10:25 2013 UTC
Log:      Support setter inlining in CountOperation.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/23757018
http://code.google.com/p/v8/source/detail?r=16511

Modified:
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Tue Sep  3 14:07:38 2013 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Tue Sep  3 14:10:25 2013 UTC
@@ -5006,12 +5006,19 @@
     Handle<JSObject> holder;
     if (LookupSetter(map, name, &setter, &holder)) {
       AddCheckConstantFunction(holder, object, map);
-      // Don't try to inline if the result_value is different from the
-      // store_value. That case isn't handled yet by the inlining.
-      if (result_value == store_value &&
-          FLAG_inline_accessors &&
-          TryInlineSetter(setter, id, assignment_id, store_value)) {
-        return;
+      if (FLAG_inline_accessors) {
+        if (result_value != store_value) {
+ // The result_value and object are already pushed by CountOperation.
+          // Push(store_value) to complete the arguments to the setter.
+          Push(store_value);
+ 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);
       Add<HPushArgument>(object);
@@ -7572,6 +7579,9 @@

       after = BuildIncrement(returns_original_input, expr);
       HValue* result = returns_original_input ? Pop() : after;
+      if (returns_original_input) {
+        environment()->SetExpressionStackAt(1, result);
+      }

       return BuildStoreNamed(expr, expr->id(), expr->position(),
expr->AssignmentId(), prop, object, after, result);

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to