PPC: Refine "Test for var declarations in eval which conflict with let".

R=joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, dstence@us.ibm.com
BUG=

Review URL: https://codereview.chromium.org/1390953004

Cr-Commit-Position: refs/heads/master@{#31221}
This commit is contained in:
mbrandy 2015-10-12 12:09:25 -07:00 committed by Commit bot
parent cbbfc0ff87
commit 32f13dfbec

View File

@ -812,14 +812,11 @@ void FullCodeGenerator::VisitVariableDeclaration(
// must not destroy the current value.
if (hole_init) {
__ LoadRoot(r3, Heap::kTheHoleValueRootIndex);
__ Push(r5, r3);
} else {
__ LoadSmiLiteral(r3, Smi::FromInt(0)); // Indicates no initial value.
__ Push(r5, r3);
}
__ LoadSmiLiteral(
r3, Smi::FromInt(variable->DeclarationPropertyAttributes()));
__ Push(r3);
__ Push(r5, r3);
__ Push(Smi::FromInt(variable->DeclarationPropertyAttributes()));
__ CallRuntime(Runtime::kDeclareLookupSlot, 3);
break;
}
@ -871,9 +868,7 @@ void FullCodeGenerator::VisitFunctionDeclaration(
__ Push(r5);
// Push initial value for function declaration.
VisitForStackValue(declaration->fun());
__ LoadSmiLiteral(
r5, Smi::FromInt(variable->DeclarationPropertyAttributes()));
__ Push(r5);
__ Push(Smi::FromInt(variable->DeclarationPropertyAttributes()));
__ CallRuntime(Runtime::kDeclareLookupSlot, 3);
break;
}