| Index: src/ia32/builtins-ia32.cc
|
| diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
|
| index 66b9627cde64f1dcdee6392f3910bd5625c56c5f..a2aec741621587eb201d6880572eb9147fb2d1c4 100644
|
| --- a/src/ia32/builtins-ia32.cc
|
| +++ b/src/ia32/builtins-ia32.cc
|
| @@ -2348,17 +2348,10 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
|
| __ j(equal, &receiver_check_passed, Label::kNear);
|
|
|
| // Walk the prototype chain.
|
| + __ mov(scratch0, FieldOperand(receiver, HeapObject::kMapOffset));
|
| Label prototype_loop_start;
|
| __ bind(&prototype_loop_start);
|
|
|
| - // End if receiver is null or if it's a hidden prototype.
|
| - __ CompareRoot(receiver, Heap::kNullValueRootIndex);
|
| - __ j(equal, receiver_check_failed, Label::kNear);
|
| - __ mov(scratch0, FieldOperand(receiver, HeapObject::kMapOffset));
|
| - __ test(FieldOperand(scratch0, Map::kBitField3Offset),
|
| - Immediate(Map::IsHiddenPrototype::kMask));
|
| - __ j(not_zero, receiver_check_failed, Label::kNear);
|
| -
|
| // Get the constructor, if any.
|
| __ GetMapConstructor(scratch0, scratch0, scratch1);
|
| __ CmpInstanceType(scratch1, JS_FUNCTION_TYPE);
|
| @@ -2391,10 +2384,18 @@ static void CompatibleReceiverCheck(MacroAssembler* masm, Register receiver,
|
| FieldOperand(scratch0, FunctionTemplateInfo::kParentTemplateOffset));
|
| __ jmp(&function_template_loop, Label::kNear);
|
|
|
| - // Load the next prototype and iterate.
|
| + // Load the next prototype.
|
| __ bind(&next_prototype);
|
| __ mov(receiver, FieldOperand(receiver, HeapObject::kMapOffset));
|
| __ mov(receiver, FieldOperand(receiver, Map::kPrototypeOffset));
|
| + // End if the prototype is null or not hidden.
|
| + __ CompareRoot(receiver, Heap::kNullValueRootIndex);
|
| + __ j(equal, receiver_check_failed);
|
| + __ mov(scratch0, FieldOperand(receiver, HeapObject::kMapOffset));
|
| + __ test(FieldOperand(scratch0, Map::kBitField3Offset),
|
| + Immediate(Map::IsHiddenPrototype::kMask));
|
| + __ j(zero, receiver_check_failed);
|
| + // Iterate.
|
| __ jmp(&prototype_loop_start, Label::kNear);
|
|
|
| __ bind(&receiver_check_passed);
|
|
|