Index: src/mips/code-stubs-mips.cc |
diff --git a/src/mips/code-stubs-mips.cc b/src/mips/code-stubs-mips.cc |
index 5062cc3b9aad7d47937dd4049294f48e8d82268a..ab06a7100ce8d652ffbda1bc460909dc14cb8a6f 100644 |
--- a/src/mips/code-stubs-mips.cc |
+++ b/src/mips/code-stubs-mips.cc |
@@ -1503,8 +1503,12 @@ void InstanceOfStub::Generate(MacroAssembler* masm) { |
__ GetObjectType(function, function_map, scratch); |
__ Branch(&slow_case, ne, scratch, Operand(JS_FUNCTION_TYPE)); |
- // Ensure that {function} has an instance prototype. |
+ // Go to the runtime if the function is not a constructor. |
__ lbu(scratch, FieldMemOperand(function_map, Map::kBitFieldOffset)); |
+ __ And(at, scratch, Operand(1 << Map::kIsConstructor)); |
+ __ Branch(&slow_case, eq, at, Operand(zero_reg)); |
+ |
+ // Ensure that {function} has an instance prototype. |
__ And(at, scratch, Operand(1 << Map::kHasNonInstancePrototype)); |
__ Branch(&slow_case, ne, at, Operand(zero_reg)); |