Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 89ca0bad3792226618ad944777743302cde65f3a..950ebc3de916c76970f318d4d72386b536ac53e5 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -713,10 +713,12 @@ void FullCodeGenerator::EmitDeclaration(Variable* variable, |
// context. |
ASSERT_EQ(0, scope()->ContextChainLength(variable->scope())); |
if (FLAG_debug_code) { |
- // Check that we're not inside a 'with'. |
- __ ldr(r1, ContextOperand(cp, Context::FCONTEXT_INDEX)); |
- __ cmp(r1, cp); |
- __ Check(eq, "Unexpected declaration in current context."); |
+ // Check that we're not inside a with or catch context. |
+ __ ldr(r1, FieldMemOperand(cp, HeapObject::kMapOffset)); |
+ __ CompareRoot(r1, Heap::kWithContextMapRootIndex); |
+ __ Check(ne, "Declaration in with context."); |
+ __ CompareRoot(r1, Heap::kCatchContextMapRootIndex); |
+ __ Check(ne, "Declaration in catch context."); |
} |
if (mode == Variable::CONST) { |
__ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
@@ -1867,18 +1869,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, |
__ b(ne, &skip); |
__ str(result_register(), MemOperand(fp, SlotOffset(slot))); |
break; |
- case Slot::CONTEXT: { |
- __ ldr(r1, ContextOperand(cp, Context::FCONTEXT_INDEX)); |
- __ ldr(r2, ContextOperand(r1, slot->index())); |
- __ LoadRoot(ip, Heap::kTheHoleValueRootIndex); |
- __ cmp(r2, ip); |
- __ b(ne, &skip); |
- __ str(r0, ContextOperand(r1, slot->index())); |
- int offset = Context::SlotOffset(slot->index()); |
- __ mov(r3, r0); // Preserve the stored value in r0. |
- __ RecordWrite(r1, Operand(offset), r3, r2); |
- break; |
- } |
+ case Slot::CONTEXT: |
Kevin Millikin (Chromium)
2011/06/28 14:37:48
Const initialization can be nested inside a with o
Mads Ager (chromium)
2011/06/29 05:56:27
Let's file a bug report (internal cleanup?) about
|
case Slot::LOOKUP: |
__ push(r0); |
__ mov(r0, Operand(slot->var()->name())); |