Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 4255d66868cd6f4fd8dee95057e99ae2ef7695b9..12a280b89c4858e51c4d130b58142d35682857d2 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -855,7 +855,7 @@ void FullCodeGenerator::VisitVariableDeclaration( |
__ mov(r0, Operand(Smi::FromInt(0))); // Indicates no initial value. |
__ Push(cp, r2, r1, r0); |
} |
- __ CallRuntime(Runtime::kDeclareContextSlot, 4); |
+ __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
break; |
} |
} |
@@ -911,7 +911,7 @@ void FullCodeGenerator::VisitFunctionDeclaration( |
__ Push(cp, r2, r1); |
// Push initial value for function declaration. |
VisitForStackValue(declaration->fun()); |
- __ CallRuntime(Runtime::kDeclareContextSlot, 4); |
+ __ CallRuntime(Runtime::kDeclareLookupSlot, 4); |
break; |
} |
} |
@@ -2456,16 +2456,6 @@ void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot( |
} |
-void FullCodeGenerator::EmitCallStoreContextSlot( |
- Handle<String> name, StrictMode strict_mode) { |
- __ push(r0); // Value. |
- __ mov(r1, Operand(name)); |
- __ mov(r0, Operand(Smi::FromInt(strict_mode))); |
- __ Push(cp, r1, r0); // Context, name, strict mode. |
- __ CallRuntime(Runtime::kStoreContextSlot, 4); |
-} |
- |
- |
void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { |
if (var->IsUnallocated()) { |
// Global var, const, or let. |
@@ -2480,7 +2470,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { |
__ push(r0); |
__ mov(r0, Operand(var->name())); |
__ Push(cp, r0); // Context and name. |
- __ CallRuntime(Runtime::kInitializeConstContextSlot, 3); |
+ __ CallRuntime(Runtime::kInitializeLegacyConstLookupSlot, 3); |
} else { |
ASSERT(var->IsStackAllocated() || var->IsContextSlot()); |
Label skip; |
@@ -2494,29 +2484,33 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { |
} else if (var->mode() == LET && op != Token::INIT_LET) { |
// Non-initializing assignment to let variable needs a write barrier. |
- if (var->IsLookupSlot()) { |
- EmitCallStoreContextSlot(var->name(), strict_mode()); |
- } else { |
- ASSERT(var->IsStackAllocated() || var->IsContextSlot()); |
- Label assign; |
- MemOperand location = VarOperand(var, r1); |
- __ ldr(r3, location); |
- __ CompareRoot(r3, Heap::kTheHoleValueRootIndex); |
- __ b(ne, &assign); |
- __ mov(r3, Operand(var->name())); |
- __ push(r3); |
- __ CallRuntime(Runtime::kThrowReferenceError, 1); |
- // Perform the assignment. |
- __ bind(&assign); |
- EmitStoreToStackLocalOrContextSlot(var, location); |
- } |
+ ASSERT(!var->IsLookupSlot()); |
+ ASSERT(var->IsStackAllocated() || var->IsContextSlot()); |
+ Label assign; |
+ MemOperand location = VarOperand(var, r1); |
+ __ ldr(r3, location); |
+ __ CompareRoot(r3, Heap::kTheHoleValueRootIndex); |
+ __ b(ne, &assign); |
+ __ mov(r3, Operand(var->name())); |
+ __ push(r3); |
+ __ CallRuntime(Runtime::kThrowReferenceError, 1); |
+ // Perform the assignment. |
+ __ bind(&assign); |
+ EmitStoreToStackLocalOrContextSlot(var, location); |
} else if (!var->is_const_mode() || op == Token::INIT_CONST) { |
- // Assignment to var or initializing assignment to let/const |
- // in harmony mode. |
if (var->IsLookupSlot()) { |
- EmitCallStoreContextSlot(var->name(), strict_mode()); |
+ ASSERT(op == Token::ASSIGN || op == Token::INIT_VAR || |
+ op == Token::ASSIGN_ADD); |
+ // Assignment to var. |
+ __ push(r0); // Value. |
+ __ mov(r1, Operand(var->name())); |
+ __ mov(r0, Operand(Smi::FromInt(strict_mode()))); |
+ __ Push(cp, r1, r0); // Context, name, strict mode. |
+ __ CallRuntime(Runtime::kStoreLookupSlot, 4); |
} else { |
+ // Assignment to var or initializing assignment to let/const in harmony |
+ // mode. |
ASSERT((var->IsStackAllocated() || var->IsContextSlot())); |
MemOperand location = VarOperand(var, r1); |
if (generate_debug_code_ && op == Token::INIT_LET) { |