| Index: src/ia32/builtins-ia32.cc
|
| ===================================================================
|
| --- src/ia32/builtins-ia32.cc (revision 2220)
|
| +++ src/ia32/builtins-ia32.cc (working copy)
|
| @@ -63,6 +63,25 @@
|
| __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx);
|
| __ j(not_equal, &non_function_call);
|
|
|
| + // 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(Operand(ebx));
|
| +
|
| + // edi: called object
|
| + // eax: number of arguments
|
| + __ bind(&non_function_call);
|
| +
|
| + // Set expected number of arguments to zero (not changing eax).
|
| + __ Set(ebx, Immediate(0));
|
| + __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
|
| + __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
|
| + RelocInfo::CODE_TARGET);
|
| +}
|
| +
|
| +
|
| +void Builtins::Generate_JSConstructStubGeneric(MacroAssembler* masm) {
|
| // Enter a construct frame.
|
| __ EnterConstructFrame();
|
|
|
| @@ -305,16 +324,6 @@
|
| __ lea(esp, Operand(esp, ebx, times_2, 1 * kPointerSize)); // 1 ~ receiver
|
| __ push(ecx);
|
| __ ret(0);
|
| -
|
| - // edi: called object
|
| - // eax: number of arguments
|
| - __ bind(&non_function_call);
|
| -
|
| - // Set expected number of arguments to zero (not changing eax).
|
| - __ Set(ebx, Immediate(0));
|
| - __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
|
| - __ jmp(Handle<Code>(builtin(ArgumentsAdaptorTrampoline)),
|
| - RelocInfo::CODE_TARGET);
|
| }
|
|
|
|
|
|
|