Index: src/arm/builtins-arm.cc |
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
index 6ae4fad9e8c5275082a5c4aa23406c746edf5cab..539f2c161048ad973ef19b51f3112fd3ffd426ad 100644 |
--- a/src/arm/builtins-arm.cc |
+++ b/src/arm/builtins-arm.cc |
@@ -617,12 +617,12 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) { |
// -- sp[...]: constructor arguments |
// ----------------------------------- |
- Label non_function_call; |
+ Label slow, non_function_call; |
// Check that the function is not a smi. |
__ JumpIfSmi(r1, &non_function_call); |
// Check that the function is a JSFunction. |
__ CompareObjectType(r1, r2, r2, JS_FUNCTION_TYPE); |
- __ b(ne, &non_function_call); |
+ __ b(ne, &slow); |
// Jump to the function-specific construct stub. |
__ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset)); |
@@ -631,10 +631,19 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) { |
// r0: number of arguments |
// r1: called object |
+ // r2: object type |
+ Label do_call; |
+ __ bind(&slow); |
+ __ cmp(r2, Operand(JS_FUNCTION_PROXY_TYPE)); |
+ __ b(ne, &non_function_call); |
+ __ GetBuiltinEntry(r3, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); |
+ __ jmp(&do_call); |
+ |
__ bind(&non_function_call); |
+ __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); |
+ __ bind(&do_call); |
// Set expected number of arguments to zero (not changing r0). |
__ mov(r2, Operand(0, RelocInfo::NONE)); |
- __ GetBuiltinEntry(r3, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); |
__ SetCallKind(r5, CALL_AS_METHOD); |
__ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(), |
RelocInfo::CODE_TARGET); |