diff --git a/deps/v8/src/x87/code-stubs-x87.cc b/deps/v8/src/x87/code-stubs-x87.cc index ff6c8d29e51e50..787ff2d71c26ee 100644 --- a/deps/v8/src/x87/code-stubs-x87.cc +++ b/deps/v8/src/x87/code-stubs-x87.cc @@ -1835,6 +1835,11 @@ void InstanceOfStub::Generate(MacroAssembler* masm) { __ CmpObjectType(function, JS_FUNCTION_TYPE, function_map); __ j(not_equal, &slow_case); + // Go to the runtime if the function is not a constructor. + __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), + static_cast(1 << Map::kIsConstructor)); + __ j(zero, &slow_case); + // Ensure that {function} has an instance prototype. __ test_b(FieldOperand(function_map, Map::kBitFieldOffset), static_cast(1 << Map::kHasNonInstancePrototype));