| Index: src/ia32/builtins-ia32.cc
|
| diff --git a/src/ia32/builtins-ia32.cc b/src/ia32/builtins-ia32.cc
|
| index a34232310c325688e797419d7d900ee2f4125de0..0668c0892bc97044184a1dbabb89c94c746d19bc 100644
|
| --- a/src/ia32/builtins-ia32.cc
|
| +++ b/src/ia32/builtins-ia32.cc
|
| @@ -80,12 +80,12 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
|
| // -- edi: constructor function
|
| // -----------------------------------
|
|
|
| - Label non_function_call;
|
| + 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, &non_function_call);
|
| + __ j(not_equal, &slow);
|
|
|
| // Jump to the function-specific construct stub.
|
| __ mov(ebx, FieldOperand(edi, JSFunction::kSharedFunctionInfoOffset));
|
| @@ -95,10 +95,19 @@ void Builtins::Generate_JSConstructCall(MacroAssembler* masm) {
|
|
|
| // 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));
|
| - __ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION_AS_CONSTRUCTOR);
|
| Handle<Code> arguments_adaptor =
|
| masm->isolate()->builtins()->ArgumentsAdaptorTrampoline();
|
| __ SetCallKind(ecx, CALL_AS_METHOD);
|
|
|