Index: src/ia32/macro-assembler-ia32.cc |
diff --git a/src/ia32/macro-assembler-ia32.cc b/src/ia32/macro-assembler-ia32.cc |
index ce07333bb9531c7547a7fb9eb3ebb3fcdb8dd985..a80821f82c4f840b94ba1421df1ac723dd551f71 100644 |
--- a/src/ia32/macro-assembler-ia32.cc |
+++ b/src/ia32/macro-assembler-ia32.cc |
@@ -1766,14 +1766,17 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) { |
mov(dst, esi); |
} |
- // We should not have found a 'with' context by walking the context chain |
- // (i.e., the static scope chain and runtime context chain do not agree). |
- // A variable occurring in such a scope should have slot type LOOKUP and |
- // not CONTEXT. |
+ // We should not have found a with or catch context by walking the context |
+ // chain (i.e., the static scope chain and runtime context chain do not |
+ // agree). A variable occurring in such a scope should have slot type |
+ // LOOKUP and not CONTEXT. |
if (emit_debug_code()) { |
- cmp(dst, Operand(dst, Context::SlotOffset(Context::FCONTEXT_INDEX))); |
- Check(equal, "Yo dawg, I heard you liked function contexts " |
- "so I put function contexts in all your contexts"); |
+ cmp(FieldOperand(dst, HeapObject::kMapOffset), |
+ isolate()->factory()->with_context_map()); |
+ Check(not_equal, "Variable resolved to with context."); |
+ cmp(FieldOperand(dst, HeapObject::kMapOffset), |
+ isolate()->factory()->with_context_map()); |
+ Check(not_equal, "Variable resolved to catch context."); |
} |
} |