Revision: 19708
Author:   [email protected]
Date:     Fri Mar  7 09:19:51 2014 UTC
Log:      A64: Minor improvement in FullCodeGenerator::VisitObjectLiteral.

This patch avoid to push some values on the stack when it's not needed.

[email protected]

Review URL: https://codereview.chromium.org/183193005
http://code.google.com/p/v8/source/detail?r=19708

Modified:
 /branches/bleeding_edge/src/a64/full-codegen-a64.cc

=======================================
--- /branches/bleeding_edge/src/a64/full-codegen-a64.cc Tue Mar 4 15:54:12 2014 UTC +++ /branches/bleeding_edge/src/a64/full-codegen-a64.cc Fri Mar 7 09:19:51 2014 UTC
@@ -1689,30 +1689,29 @@
           }
           break;
         }
-        // Duplicate receiver on stack.
-        __ Peek(x0, 0);
-        __ Push(x0);
-        VisitForStackValue(key);
-        VisitForStackValue(value);
         if (property->emit_store()) {
+          // Duplicate receiver on stack.
+          __ Peek(x0, 0);
+          __ Push(x0);
+          VisitForStackValue(key);
+          VisitForStackValue(value);
           __ Mov(x0, Operand(Smi::FromInt(NONE)));  // PropertyAttributes
           __ Push(x0);
           __ CallRuntime(Runtime::kSetProperty, 4);
         } else {
-          __ Drop(3);
+          VisitForEffect(key);
+          VisitForEffect(value);
         }
         break;
       case ObjectLiteral::Property::PROTOTYPE:
-        // Duplicate receiver on stack.
-        __ Peek(x0, 0);
- // TODO(jbramley): This push shouldn't be necessary if we don't call the
-        // runtime below. In that case, skip it.
-        __ Push(x0);
-        VisitForStackValue(value);
         if (property->emit_store()) {
+          // Duplicate receiver on stack.
+          __ Peek(x0, 0);
+          __ Push(x0);
+          VisitForStackValue(value);
           __ CallRuntime(Runtime::kSetPrototype, 2);
         } else {
-          __ Drop(2);
+          VisitForEffect(value);
         }
         break;
       case ObjectLiteral::Property::GETTER:

--
--
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/d/optout.

Reply via email to