| Index: src/x64/full-codegen-x64.cc
|
| diff --git a/src/x64/full-codegen-x64.cc b/src/x64/full-codegen-x64.cc
|
| index e0fe8356367157c5cddd3f892450ddbd1f524efc..8c0622f22938864d4aa31da6cd64532bff185115 100644
|
| --- a/src/x64/full-codegen-x64.cc
|
| +++ b/src/x64/full-codegen-x64.cc
|
| @@ -824,7 +824,7 @@ void FullCodeGenerator::VisitVariableDeclaration(
|
| } else {
|
| __ Push(Smi::FromInt(0)); // Indicates no initial value.
|
| }
|
| - __ CallRuntime(Runtime::kDeclareContextSlot, 4);
|
| + __ CallRuntime(Runtime::kDeclareLookupSlot, 4);
|
| break;
|
| }
|
| }
|
| @@ -878,7 +878,7 @@ void FullCodeGenerator::VisitFunctionDeclaration(
|
| __ Push(variable->name());
|
| __ Push(Smi::FromInt(NONE));
|
| VisitForStackValue(declaration->fun());
|
| - __ CallRuntime(Runtime::kDeclareContextSlot, 4);
|
| + __ CallRuntime(Runtime::kDeclareLookupSlot, 4);
|
| break;
|
| }
|
| }
|
| @@ -2382,16 +2382,6 @@ void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot(
|
| }
|
|
|
|
|
| -void FullCodeGenerator::EmitCallStoreContextSlot(
|
| - Handle<String> name, StrictMode strict_mode) {
|
| - __ Push(rax); // Value.
|
| - __ Push(rsi); // Context.
|
| - __ Push(name);
|
| - __ Push(Smi::FromInt(strict_mode));
|
| - __ CallRuntime(Runtime::kStoreContextSlot, 4);
|
| -}
|
| -
|
| -
|
| void FullCodeGenerator::EmitVariableAssignment(Variable* var,
|
| Token::Value op) {
|
| if (var->IsUnallocated()) {
|
| @@ -2407,7 +2397,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
|
| __ Push(rax);
|
| __ Push(rsi);
|
| __ Push(var->name());
|
| - __ CallRuntime(Runtime::kInitializeConstContextSlot, 3);
|
| + __ CallRuntime(Runtime::kInitializeLegacyConstLookupSlot, 3);
|
| } else {
|
| ASSERT(var->IsStackLocal() || var->IsContextSlot());
|
| Label skip;
|
| @@ -2421,27 +2411,31 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var,
|
|
|
| } 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, rcx);
|
| - __ movp(rdx, location);
|
| - __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex);
|
| - __ j(not_equal, &assign, Label::kNear);
|
| - __ Push(var->name());
|
| - __ CallRuntime(Runtime::kThrowReferenceError, 1);
|
| - __ bind(&assign);
|
| - EmitStoreToStackLocalOrContextSlot(var, location);
|
| - }
|
| + ASSERT(!var->IsLookupSlot());
|
| + ASSERT(var->IsStackAllocated() || var->IsContextSlot());
|
| + Label assign;
|
| + MemOperand location = VarOperand(var, rcx);
|
| + __ movp(rdx, location);
|
| + __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex);
|
| + __ j(not_equal, &assign, Label::kNear);
|
| + __ Push(var->name());
|
| + __ CallRuntime(Runtime::kThrowReferenceError, 1);
|
| + __ 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(rax); // Value.
|
| + __ Push(rsi); // Context.
|
| + __ Push(var->name());
|
| + __ Push(Smi::FromInt(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, rcx);
|
| if (generate_debug_code_ && op == Token::INIT_LET) {
|
|
|