Index: src/full-codegen/x64/full-codegen-x64.cc |
diff --git a/src/full-codegen/x64/full-codegen-x64.cc b/src/full-codegen/x64/full-codegen-x64.cc |
index e43c3c0bd982ad7e38a962d1cdc55f28360dfa44..b3fb46c7301588290ad5789379dcb68d3a028e7b 100644 |
--- a/src/full-codegen/x64/full-codegen-x64.cc |
+++ b/src/full-codegen/x64/full-codegen-x64.cc |
@@ -720,7 +720,7 @@ void FullCodeGenerator::VisitVariableDeclaration( |
VariableProxy* proxy = declaration->proxy(); |
VariableMode mode = declaration->mode(); |
Variable* variable = proxy->var(); |
- bool hole_init = mode == LET || mode == CONST || mode == CONST_LEGACY; |
+ bool hole_init = mode == LET || mode == CONST; |
switch (variable->location()) { |
case VariableLocation::GLOBAL: |
case VariableLocation::UNALLOCATED: |
@@ -1237,16 +1237,11 @@ void FullCodeGenerator::EmitDynamicLookupFastCase(VariableProxy* proxy, |
} else if (var->mode() == DYNAMIC_LOCAL) { |
Variable* local = var->local_if_not_shadowed(); |
__ movp(rax, ContextSlotOperandCheckExtensions(local, slow)); |
- if (local->mode() == LET || local->mode() == CONST || |
- local->mode() == CONST_LEGACY) { |
+ if (local->mode() == LET || local->mode() == CONST) { |
__ CompareRoot(rax, Heap::kTheHoleValueRootIndex); |
__ j(not_equal, done); |
- if (local->mode() == CONST_LEGACY) { |
- __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
- } else { // LET || CONST |
- __ Push(var->name()); |
- __ CallRuntime(Runtime::kThrowReferenceError); |
- } |
+ __ Push(var->name()); |
+ __ CallRuntime(Runtime::kThrowReferenceError); |
} |
__ jmp(done); |
} |
@@ -1301,10 +1296,6 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy, |
// binding in harmony mode. |
__ Push(var->name()); |
__ CallRuntime(Runtime::kThrowReferenceError); |
- } else { |
- // Uninitialized legacy const bindings are unholed. |
- DCHECK(var->mode() == CONST_LEGACY); |
- __ LoadRoot(rax, Heap::kUndefinedValueRootIndex); |
} |
__ bind(&done); |
context()->Plug(rax); |
@@ -2132,8 +2123,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
__ bind(&uninitialized_this); |
EmitStoreToStackLocalOrContextSlot(var, location); |
- } else if (!var->is_const_mode() || |
- (var->mode() == CONST && op == Token::INIT)) { |
+ } else if (!var->is_const_mode() || op == Token::INIT) { |
if (var->IsLookupSlot()) { |
// Assignment to var. |
__ Push(var->name()); |
@@ -2155,25 +2145,6 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
EmitStoreToStackLocalOrContextSlot(var, location); |
} |
- } else if (var->mode() == CONST_LEGACY && op == Token::INIT) { |
- // Const initializers need a write barrier. |
- DCHECK(!var->IsParameter()); // No const parameters. |
- if (var->IsLookupSlot()) { |
- __ Push(rax); |
- __ Push(rsi); |
- __ Push(var->name()); |
- __ CallRuntime(Runtime::kInitializeLegacyConstLookupSlot); |
- } else { |
- DCHECK(var->IsStackLocal() || var->IsContextSlot()); |
- Label skip; |
- MemOperand location = VarOperand(var, rcx); |
- __ movp(rdx, location); |
- __ CompareRoot(rdx, Heap::kTheHoleValueRootIndex); |
- __ j(not_equal, &skip); |
- EmitStoreToStackLocalOrContextSlot(var, location); |
- __ bind(&skip); |
- } |
- |
} else { |
DCHECK(var->mode() == CONST_LEGACY && op != Token::INIT); |
if (is_strict(language_mode())) { |