Chromium Code Reviews| Index: src/ia32/builtins-ia32.cc |
| diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc |
| index 28a9b0fadccfb253d535eb69ebb482877e371628..60e84398c3393263825dd28eb1c7df0461d0d487 100644 |
| --- a/src/ia32/builtins-ia32.cc |
| +++ b/src/ia32/builtins-ia32.cc |
| @@ -74,50 +74,14 @@ void Builtins::Generate_Adaptor(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 ------------- |
| // -- eax: number of arguments |
| // -- edi: constructor function |
| // ----------------------------------- |
| - Label slow, non_function_call; |
| - // Check that function is not a smi. |
| - __ JumpIfSmi(edi, &non_function_call); |
| - // Check that function is a JSFunction. |
| - __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
| - __ j(not_equal, &slow); |
| - |
| - // Jump to the function-specific construct stub. |
| - __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset)); |
| - __ mov(ebx, FieldOperand(ebx, SharedFunctionInfo::kConstructStubOffset)); |
| - __ lea(ebx, FieldOperand(ebx, Code::kHeaderSize)); |
| - __ jmp(ebx); |
| - |
| - // edi: called object |
| - // eax: number of arguments |
| - // ecx: object map |
| - Label do_call; |
| - __ bind(&slow); |
| - __ CmpInstanceType(ecx, JS_FUNCTION_PROXY_TYPE); |
| - __ j(not_equal, &non_function_call); |
| - __ GetBuiltinEntry(edx, Builtins::CALL_FUNCTION_PROXY_AS_CONSTRUCTOR); |
| - __ jmp(&do_call); |
| - |
| - __ bind(&non_function_call); |
| - __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR); |
| - __ bind(&do_call); |
| - // Set expected number of arguments to zero (not changing eax). |
| - __ Set(ebx, Immediate(0)); |
| - Handle<Code> arguments_adaptor = |
| - masm->isolate()->builtins()->ArgumentsAdaptorTrampoline(); |
| - __ SetCallKind(ecx, CALL_AS_METHOD); |
| - __ jmp(arguments_adaptor, 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); |
| @@ -454,8 +418,8 @@ static void Generate_JSEntryTrampolineHelper(MacroAssembler* masm, |
| // Invoke the code. |
| if (is_construct) { |
| - __ call(masm->isolate()->builtins()->JSConstructCall(), |
| - RelocInfo::CODE_TARGET); |
| + CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); |
|
Vyacheslav Egorov (Chromium)
2012/01/23 10:39:52
according to isolate initialization sequence stub
Michael Starzinger
2012/01/25 11:42:29
The CodeStubs are not stored in the stub cache but
|
| + __ CallStub(&stub); |
| } else { |
| ParameterCount actual(eax); |
| __ InvokeFunction(edi, actual, CALL_FUNCTION, |