Chromium Code Reviews| Index: src/arm/full-codegen-arm.cc |
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
| index d451c084771845e1b26ec6570be36d4a556934d9..ca60d2f459365295aada01e4345259ca0b4ff87d 100644 |
| --- a/src/arm/full-codegen-arm.cc |
| +++ b/src/arm/full-codegen-arm.cc |
| @@ -2761,6 +2761,21 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) { |
| __ bind(&assign); |
| EmitStoreToStackLocalOrContextSlot(var, location); |
| + } else if (var->mode() == CONST && op != Token::INIT_CONST) { |
|
Dmitry Lomov (no reviews)
2015/03/04 17:57:35
Looks like the case at line 2800 anymore should be
|
| + // Assignment to const variable needs a write barrier. |
| + DCHECK(!var->IsLookupSlot()); |
| + DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| + Label const_error; |
| + MemOperand location = VarOperand(var, r1); |
| + __ ldr(r3, location); |
| + __ CompareRoot(r3, Heap::kTheHoleValueRootIndex); |
| + __ b(ne, &const_error); |
| + __ mov(r3, Operand(var->name())); |
| + __ push(r3); |
| + __ CallRuntime(Runtime::kThrowReferenceError, 1); |
| + __ bind(&const_error); |
| + __ CallRuntime(Runtime::kThrowConstAssignError, 0); |
| + |
| } else if (!var->is_const_mode() || op == Token::INIT_CONST) { |
| if (var->IsLookupSlot()) { |
| // Assignment to var. |