From a1102885e01824bf9ca952113776af1a3c97e030 Mon Sep 17 00:00:00 2001 From: "baptiste.afsa@arm.com" Date: Fri, 7 Mar 2014 09:19:51 +0000 Subject: [PATCH] A64: Minor improvement in FullCodeGenerator::VisitObjectLiteral. This patch avoid to push some values on the stack when it's not needed. R=ulan@chromium.org Review URL: https://codereview.chromium.org/183193005 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@19708 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/a64/full-codegen-a64.cc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/a64/full-codegen-a64.cc b/src/a64/full-codegen-a64.cc index 8dc6da9..b242638 100644 --- a/src/a64/full-codegen-a64.cc +++ b/src/a64/full-codegen-a64.cc @@ -1689,30 +1689,29 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { } 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: -- 2.7.4