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
This commit is contained in:
baptiste.afsa@arm.com 2014-03-07 09:19:51 +00:00
parent 42169bf3df
commit a1102885e0

View File

@ -1689,30 +1689,29 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
}
break;
}
if (property->emit_store()) {
// Duplicate receiver on stack.
__ Peek(x0, 0);
__ Push(x0);
VisitForStackValue(key);
VisitForStackValue(value);
if (property->emit_store()) {
__ 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:
if (property->emit_store()) {
// 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()) {
__ CallRuntime(Runtime::kSetPrototype, 2);
} else {
__ Drop(2);
VisitForEffect(value);
}
break;
case ObjectLiteral::Property::GETTER: