Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 6b489abb9cc47be5b171c63ef5f135a2a0d88f48..3f1c8708ad4e9230a7dac684270d33aab514674f 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -1371,8 +1371,12 @@ void InstanceOfStub::Generate(MacroAssembler* masm) { |
__ CompareObjectType(function, function_map, scratch, JS_FUNCTION_TYPE); |
__ b(ne, &slow_case); |
- // Ensure that {function} has an instance prototype. |
+ // Go to the runtime if the function is not a constructor. |
__ ldrb(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); |
+ __ tst(scratch, Operand(1 << Map::kIsConstructor)); |
+ __ b(eq, &slow_case); |
+ |
+ // Ensure that {function} has an instance prototype. |
__ tst(scratch, Operand(1 << Map::kHasNonInstancePrototype)); |
__ b(ne, &slow_case); |