Index: src/ia32/code-stubs-ia32.cc |
diff --git a/src/ia32/code-stubs-ia32.cc b/src/ia32/code-stubs-ia32.cc |
index c76d60715472bc0e08cb8ba719d3c87d7a633c98..2cd254bd00d324567a43cac742d5837ccc9636ab 100644 |
--- a/src/ia32/code-stubs-ia32.cc |
+++ b/src/ia32/code-stubs-ia32.cc |
@@ -2523,8 +2523,9 @@ void CallFunctionStub::Generate(MacroAssembler* masm) { |
// The receiver might implicitly be the global object. This is |
// indicated by passing the hole as the receiver to the call |
// function stub. |
- if (ReceiverMightBeImplicit() || ReceiverIsImplicit()) { |
- Label try_call, call, patch_current_context; |
+ Label call; |
+ if (ReceiverMightBeImplicit()) { |
+ Label try_call, patch_current_context; |
if (ReceiverMightBeImplicit()) { |
dcarney
2014/01/13 18:35:03
can remove conditional
|
// Get the receiver from the stack. |
// +1 ~ return address |
@@ -2533,31 +2534,21 @@ void CallFunctionStub::Generate(MacroAssembler* masm) { |
__ cmp(eax, isolate->factory()->the_hole_value()); |
dcarney
2014/01/13 18:35:03
can we just pass undefined in these cases and remo
|
__ j(not_equal, &try_call, Label::kNear); |
} |
- // Patch the receiver on the stack with the global receiver object. |
- // Goto slow case if we do not have a function. |
- __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
- __ j(not_equal, &patch_current_context); |
- CallStubCompiler::FetchGlobalProxy(masm, ecx, edi); |
- __ mov(Operand(esp, (argc_ + 1) * kPointerSize), ecx); |
- __ jmp(&call, Label::kNear); |
- __ bind(&patch_current_context); |
- __ mov(edx, isolate->factory()->undefined_value()); |
- __ mov(Operand(esp, (argc_ + 1) * kPointerSize), edx); |
- __ jmp(&slow); |
+ // Patch the global object on the stack. |
+ __ mov(Operand(esp, (argc_ + 1) * kPointerSize), |
+ isolate->factory()->undefined_value()); |
- __ bind(&try_call); |
// Goto slow case if we do not have a function. |
- __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
- __ j(not_equal, &slow); |
- |
- __ bind(&call); |
- } else { |
- // Goto slow case if we do not have a function. |
- __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
- __ j(not_equal, &slow); |
+ __ bind(&try_call); |
} |
+ // Goto slow case if we do not have a function. |
+ __ CmpObjectType(edi, JS_FUNCTION_TYPE, ecx); |
+ __ j(not_equal, &slow); |
+ |
+ __ bind(&call); |
+ |
if (RecordCallTarget()) { |
GenerateRecordCallTarget(masm); |
} |
@@ -2612,7 +2603,7 @@ void CallFunctionStub::Generate(MacroAssembler* masm) { |
__ mov(Operand(esp, (argc_ + 1) * kPointerSize), edi); |
__ Set(eax, Immediate(argc_)); |
__ Set(ebx, Immediate(0)); |
- __ SetCallKind(ecx, CALL_AS_METHOD); |
+ __ SetCallKind(ecx, CALL_AS_FUNCTION); |
__ GetBuiltinEntry(edx, Builtins::CALL_NON_FUNCTION); |
Handle<Code> adaptor = isolate->builtins()->ArgumentsAdaptorTrampoline(); |
__ jmp(adaptor, RelocInfo::CODE_TARGET); |