diff --git a/ecmascript/compiler/stub_builder.cpp b/ecmascript/compiler/stub_builder.cpp index f3ca8e4b2bb14fef14e34ec8adf1864d8b94a9b0..64e5c41d9ed3c71d5208cae361a0fe7649f2f2a6 100644 --- a/ecmascript/compiler/stub_builder.cpp +++ b/ecmascript/compiler/stub_builder.cpp @@ -4583,27 +4583,25 @@ GateRef StubBuilder::OrdinaryHasInstance(GateRef glue, GateRef target, GateRef o Branch(TaggedIsNull(*object), &afterLoop, &loopHead); LoopBegin(&loopHead); { - GateRef isEqual = SameValue(glue, *object, *constructorPrototype); - - Branch(isEqual, &strictEqual1, ¬StrictEqual1); - Bind(&strictEqual1); + object = GetPrototype(glue, *object); + Branch(HasPendingException(glue), &shouldReturn, &shouldContinue); + Bind(&shouldReturn); { - result = TaggedTrue(); + result = Exception(); Jump(&exit); } - Bind(¬StrictEqual1); + Bind(&shouldContinue); { - object = GetPrototype(glue, *object); - - Branch(HasPendingException(glue), &shouldReturn, &shouldContinue); - Bind(&shouldReturn); + GateRef isEqual = SameValue(glue, *object, *constructorPrototype); + Branch(isEqual, &strictEqual1, ¬StrictEqual1); + Bind(&strictEqual1); { - result = Exception(); + result = TaggedTrue(); Jump(&exit); } + Bind(¬StrictEqual1); + Branch(TaggedIsNull(*object), &afterLoop, &loopEnd); } - Bind(&shouldContinue); - Branch(TaggedIsNull(*object), &afterLoop, &loopEnd); } Bind(&loopEnd); LoopEnd(&loopHead);