Index: src/crankshaft/ia32/lithium-codegen-ia32.cc |
diff --git a/src/crankshaft/ia32/lithium-codegen-ia32.cc b/src/crankshaft/ia32/lithium-codegen-ia32.cc |
index 1ede1f22b6bf2e6df6c144f03efab25dee73b2b0..7d0b657b9e6948c76278abbea91e6db6004a2e47 100644 |
--- a/src/crankshaft/ia32/lithium-codegen-ia32.cc |
+++ b/src/crankshaft/ia32/lithium-codegen-ia32.cc |
@@ -2540,8 +2540,15 @@ void LCodeGen::DoHasInPrototypeChainAndBranch( |
__ mov(object_map, FieldOperand(object, HeapObject::kMapOffset)); |
Label loop; |
__ bind(&loop); |
+ |
+ // Deoptimize if the object needs to be access checked. |
+ __ test_b(FieldOperand(object_map, Map::kBitFieldOffset), |
+ 1 << Map::kIsAccessCheckNeeded); |
+ DeoptimizeIf(not_zero, instr, Deoptimizer::kAccessCheck); |
+ // Deoptimize for proxies. |
__ CmpInstanceType(object_map, JS_PROXY_TYPE); |
DeoptimizeIf(equal, instr, Deoptimizer::kProxy); |
+ |
__ mov(object_prototype, FieldOperand(object_map, Map::kPrototypeOffset)); |
__ cmp(object_prototype, prototype); |
EmitTrueBranch(instr, equal); |