Index: src/full-codegen/arm64/full-codegen-arm64.cc |
diff --git a/src/full-codegen/arm64/full-codegen-arm64.cc b/src/full-codegen/arm64/full-codegen-arm64.cc |
index bb6a4309e48b912cfecc5d4cc682eafde51f097c..b8c6449c8a146895434626a770edee9c8f355553 100644 |
--- a/src/full-codegen/arm64/full-codegen-arm64.cc |
+++ b/src/full-codegen/arm64/full-codegen-arm64.cc |
@@ -2292,7 +2292,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
if (FLAG_vector_stores) EmitLoadStoreICSlot(slot); |
CallStoreIC(); |
- } else if (var->mode() == LET && op != Token::INIT_LET) { |
+ } else if (var->mode() == LET && op != Token::INIT) { |
// Non-initializing assignment to let variable needs a write barrier. |
DCHECK(!var->IsLookupSlot()); |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
@@ -2307,7 +2307,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
__ Bind(&assign); |
EmitStoreToStackLocalOrContextSlot(var, location); |
- } else if (var->mode() == CONST && op != Token::INIT_CONST) { |
+ } else if (var->mode() == CONST && op != Token::INIT) { |
// Assignment to const variable needs a write barrier. |
DCHECK(!var->IsLookupSlot()); |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
@@ -2321,7 +2321,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
__ Bind(&const_error); |
__ CallRuntime(Runtime::kThrowConstAssignError, 0); |
- } else if (var->is_this() && op == Token::INIT_CONST) { |
+ } else if (var->is_this() && var->mode() == CONST && op == Token::INIT) { |
// Initializing assignment to const {this} needs a write barrier. |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
Label uninitialized_this; |
@@ -2334,7 +2334,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
__ bind(&uninitialized_this); |
EmitStoreToStackLocalOrContextSlot(var, location); |
- } else if (!var->is_const_mode() || op == Token::INIT_CONST) { |
+ } else if (!var->is_const_mode() || |
+ (var->mode() == CONST && op == Token::INIT)) { |
if (var->IsLookupSlot()) { |
// Assignment to var. |
__ Mov(x11, Operand(var->name())); |
@@ -2350,7 +2351,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
// mode. |
DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
MemOperand location = VarOperand(var, x1); |
- if (FLAG_debug_code && op == Token::INIT_LET) { |
+ if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) { |
__ Ldr(x10, location); |
__ CompareRoot(x10, Heap::kTheHoleValueRootIndex); |
__ Check(eq, kLetBindingReInitialization); |
@@ -2358,9 +2359,8 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
EmitStoreToStackLocalOrContextSlot(var, location); |
} |
- } else if (op == Token::INIT_CONST_LEGACY) { |
+ } else if (var->mode() == CONST_LEGACY && op == Token::INIT) { |
// Const initializers need a write barrier. |
- DCHECK(var->mode() == CONST_LEGACY); |
DCHECK(!var->IsParameter()); // No const parameters. |
if (var->IsLookupSlot()) { |
__ Mov(x1, Operand(var->name())); |
@@ -2377,7 +2377,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op, |
} |
} else { |
- DCHECK(var->mode() == CONST_LEGACY && op != Token::INIT_CONST_LEGACY); |
+ DCHECK(var->mode() == CONST_LEGACY && op != Token::INIT); |
if (is_strict(language_mode())) { |
__ CallRuntime(Runtime::kThrowConstAssignError, 0); |
} |