Index: src/builtins/arm/builtins-arm.cc |
diff --git a/src/builtins/arm/builtins-arm.cc b/src/builtins/arm/builtins-arm.cc |
index b5aac3124696bb16014d1cfcc134f1b44f7ab02c..777c73fd90cb47d49c7ff99f17131b2348f5f341 100644 |
--- a/src/builtins/arm/builtins-arm.cc |
+++ b/src/builtins/arm/builtins-arm.cc |
@@ -585,8 +585,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(r0, &dont_throw); |
+ Label do_throw, dont_throw; |
+ __ JumpIfSmi(r0, &do_throw); |
+ STATIC_ASSERT(LAST_JS_RECEIVER_TYPE == LAST_TYPE); |
+ __ CompareObjectType(r0, r3, r3, FIRST_JS_RECEIVER_TYPE); |
+ __ b(ge, &dont_throw); |
+ __ bind(&do_throw); |
{ |
FrameScope scope(masm, StackFrame::INTERNAL); |
__ CallRuntime(Runtime::kThrowDerivedConstructorReturnedNonObject); |