Skip to content

Commit e5cce7a

Browse files
fhinkelevanlucas
authored andcommitted
deps: cherry-pick 3a903c4 for PPC from V8 upstream
Original commit message: 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} Fixes: #7592 for PPC PR-URL: #7638 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
1 parent e239045 commit e5cce7a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

deps/v8/src/ppc/code-stubs-ppc.cc

+5-1
Original file line numberDiff line numberDiff line change
@@ -1409,8 +1409,12 @@ void InstanceOfStub::Generate(MacroAssembler* masm) {
14091409
__ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE);
14101410
__ bne(&slow_case);
14111411

1412-
// Ensure that {function} has an instance prototype.
1412+
// Go to the runtime if the function is not a constructor.
14131413
__ lbz(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset));
1414+
__ TestBit(scratch, Map::kIsConstructor, r0);
1415+
__ beq(&slow_case, cr0);
1416+
1417+
// Ensure that {function} has an instance prototype.
14141418
__ TestBit(scratch, Map::kHasNonInstancePrototype, r0);
14151419
__ bne(&slow_case, cr0);
14161420

0 commit comments

Comments
 (0)