Index: src/builtins/mips/builtins-mips.cc |
diff --git a/src/builtins/mips/builtins-mips.cc b/src/builtins/mips/builtins-mips.cc |
index 33465d04d8012b23bde9190b560c75a357a3d0bc..6a895566d33147e78772520ee4b6213648e236d5 100644 |
--- a/src/builtins/mips/builtins-mips.cc |
+++ b/src/builtins/mips/builtins-mips.cc |
@@ -579,8 +579,12 @@ void Generate_JSConstructStubHelper(MacroAssembler* masm, bool is_api_function, |
// Check that the result is not a Smi, indicating that the constructor result |
// from a derived class is neither undefined nor an Object. |
if (check_derived_construct) { |
- Label dont_throw; |
- __ JumpIfNotSmi(v0, &dont_throw); |
+ Label do_throw, dont_throw; |
+ __ JumpIfNotSmi(v0, &do_throw); |
+ __ GetObjectType(v0, a1, a3); |
+ STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
+ __ Branch(&dont_throw, greater_equal, a3, Operand(FIRST_JS_RECEIVER_TYPE)); |
+ __ bind(&do_throw); |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |
__ CallRuntime(Runtime::kThrowDerivedConstructorReturnedNonObject); |