| Index: src/arm/builtins-arm.cc
|
| diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc
|
| index 2a650a44a5ad0a973bb2f1ab2eaf6680becf4f57..e3f395fa2a1c2a564b04e9b648203dbfeb2a674f 100644
|
| --- a/src/arm/builtins-arm.cc
|
| +++ b/src/arm/builtins-arm.cc
|
| @@ -667,7 +667,9 @@ void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
|
| }
|
|
|
|
|
| -void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
|
| +static void Generate_JSConstructStubHelper(MacroAssembler* masm,
|
| + bool is_api_function,
|
| + bool count_constructions) {
|
| // ----------- S t a t e -------------
|
| // -- r0 : number of arguments
|
| // -- r1 : constructor function
|
| @@ -675,42 +677,6 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
|
| // -- sp[...]: constructor arguments
|
| // -----------------------------------
|
|
|
| - 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, &slow);
|
| -
|
| - // Jump to the function-specific construct stub.
|
| - __ ldr(r2, FieldMemOperand(r1, JSFunction::kSharedFunctionInfoOffset));
|
| - __ ldr(r2, FieldMemOperand(r2, SharedFunctionInfo::kConstructStubOffset));
|
| - __ add(pc, r2, Operand(Code::kHeaderSize - kHeapObjectTag));
|
| -
|
| - // 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));
|
| - __ SetCallKind(r5, CALL_AS_METHOD);
|
| - __ Jump(masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(),
|
| - RelocInfo::CODE_TARGET);
|
| -}
|
| -
|
| -
|
| -static void Generate_JSConstructStubHelper(MacroAssembler* masm,
|
| - bool is_api_function,
|
| - bool count_constructions) {
|
| // Should never count constructions for api objects.
|
| ASSERT(!is_api_function || !count_constructions);
|
|
|
| @@ -1117,7 +1083,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm,
|
| // Invoke the code and pass argc as r0.
|
| __ mov(r0, Operand(r3));
|
| if (is_construct) {
|
| - __ Call(masm->isolate()->builtins()->JSConstructCall());
|
| + CallConstructStub stub(NO_CALL_FUNCTION_FLAGS);
|
| + __ CallStub(&stub);
|
| } else {
|
| ParameterCount actual(r0);
|
| __ InvokeFunction(r1, actual, CALL_FUNCTION,
|
|
|