Index: src/x64/code-stubs-x64.cc |
diff --git a/src/x64/code-stubs-x64.cc b/src/x64/code-stubs-x64.cc |
index 15d0f0e8079032b5c1dfc849efeae36eaac41091..1eb9379580dd0072b72116c9968ec566ced78aed 100644 |
--- a/src/x64/code-stubs-x64.cc |
+++ b/src/x64/code-stubs-x64.cc |
@@ -2092,6 +2092,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. |
+ __ testb(FieldOperand(function_map, Map::kBitFieldOffset), |
+ Immediate(1 << Map::kIsConstructor)); |
+ __ j(zero, &slow_case); |
+ |
// Ensure that {function} has an instance prototype. |
__ testb(FieldOperand(function_map, Map::kBitFieldOffset), |
Immediate(1 << Map::kHasNonInstancePrototype)); |