Skip to content

Commit 2870061

Browse files
fhinkelevanlucas
authored andcommitted
deps: cherry-pick 5b5d24b for X87 from V8 upstream
Original commit message: port 2aa070b (r34863) 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. BUG= Review URL: https://codereview.chromium.org/1809333002 Cr-Commit-Position: refs/heads/master@{#34880} Fixes: #7592 for X87 PR-URL: #7638 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
1 parent e5cce7a commit 2870061

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,11 @@ void InstanceOfStub::Generate(MacroAssembler* masm) {
18351835
__ CmpObjectType(function, JS_FUNCTION_TYPE, function_map);
18361836
__ j(not_equal, &slow_case);
18371837

1838+
// Go to the runtime if the function is not a constructor.
1839+
__ test_b(FieldOperand(function_map, Map::kBitFieldOffset),
1840+
static_cast<uint8_t>(1 << Map::kIsConstructor));
1841+
__ j(zero, &slow_case);
1842+
18381843
// Ensure that {function} has an instance prototype.
18391844
__ test_b(FieldOperand(function_map, Map::kBitFieldOffset),
18401845
static_cast<uint8_t>(1 << Map::kHasNonInstancePrototype));

0 commit comments

Comments
 (0)