Skip to content

Commit 3a903c4

Browse files
mtbrandyCommit bot
authored andcommitted
PPC: InstanceOfStub incorrectly interprets the hole as a prototype.
Port 2aa070b Original commit message: Repair this to match what the runtime correctly does, by first checking if the function is a constructor before we access the prototype. [email protected], [email protected], [email protected], [email protected] BUG= Review URL: https://codereview.chromium.org/1811013002 Cr-Commit-Position: refs/heads/master@{#34869}
1 parent 946354a commit 3a903c4

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/ppc/code-stubs-ppc.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,12 @@ void InstanceOfStub::Generate(MacroAssembler* masm) {
14211421
__ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE);
14221422
__ bne(&slow_case);
14231423

1424-
// Ensure that {function} has an instance prototype.
1424+
// Go to the runtime if the function is not a constructor.
14251425
__ lbz(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset));
1426+
__ TestBit(scratch, Map::kIsConstructor, r0);
1427+
__ beq(&slow_case, cr0);
1428+
1429+
// Ensure that {function} has an instance prototype.
14261430
__ TestBit(scratch, Map::kHasNonInstancePrototype, r0);
14271431
__ bne(&slow_case, cr0);
14281432

0 commit comments

Comments
 (0)