diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc index 2b72fd5099..89ddd4dac8 100644 --- a/src/crankshaft/ppc/lithium-codegen-ppc.cc +++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc @@ -2756,6 +2756,7 @@ void LCodeGen::DoHasInPrototypeChainAndBranch( LHasInPrototypeChainAndBranch* instr) { Register const object = ToRegister(instr->object()); Register const object_map = scratch0(); + Register const object_instance_type = ip; Register const object_prototype = object_map; Register const prototype = ToRegister(instr->prototype()); @@ -2771,6 +2772,8 @@ void LCodeGen::DoHasInPrototypeChainAndBranch( __ LoadP(object_map, FieldMemOperand(object, HeapObject::kMapOffset)); Label loop; __ bind(&loop); + __ CompareInstanceType(object_map, object_instance_type, JS_PROXY_TYPE); + DeoptimizeIf(eq, instr, Deoptimizer::kProxy); __ LoadP(object_prototype, FieldMemOperand(object_map, Map::kPrototypeOffset)); __ cmp(object_prototype, prototype); diff --git a/src/crankshaft/ppc/lithium-ppc.cc b/src/crankshaft/ppc/lithium-ppc.cc index b38982a18b..ec4a5519a6 100644 --- a/src/crankshaft/ppc/lithium-ppc.cc +++ b/src/crankshaft/ppc/lithium-ppc.cc @@ -995,7 +995,9 @@ LInstruction* LChunkBuilder::DoHasInPrototypeChainAndBranch( HHasInPrototypeChainAndBranch* instr) { LOperand* object = UseRegister(instr->object()); LOperand* prototype = UseRegister(instr->prototype()); - return new (zone()) LHasInPrototypeChainAndBranch(object, prototype); + LHasInPrototypeChainAndBranch* result = + new (zone()) LHasInPrototypeChainAndBranch(object, prototype); + return AssignEnvironment(result); }