Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index c392b455d55a5f69b9959a22b8081c904eb2e123..917d1e2580812ad61f443a598763919310213b7e 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -3236,10 +3236,7 @@ void LCodeGen::DoWrapReceiver(LWrapReceiver* instr) { |
// TODO(kmillikin): We have a hydrogen value for the global object. See |
// if it's better to use it than to explicitly fetch it from the context |
// here. |
- __ movq(receiver, Operand(rbp, StandardFrameConstants::kContextOffset)); |
- __ movq(receiver, ContextOperand(receiver, Context::GLOBAL_OBJECT_INDEX)); |
- __ movq(receiver, |
- FieldOperand(receiver, JSGlobalObject::kGlobalReceiverOffset)); |
+ CallStubCompiler::FetchGlobalProxy(masm(), receiver, function); |
__ bind(&receiver_ok); |
} |
@@ -3804,7 +3801,10 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) { |
ASSERT(ToRegister(instr->result()).is(rax)); |
int arity = instr->arity(); |
- CallFunctionStub stub(arity, NO_CALL_FUNCTION_FLAGS); |
+ CallFunctionFlags flags = |
+ instr->hydrogen()->IsContextualCall() ? |
+ RECEIVER_IS_IMPLICIT : NO_CALL_FUNCTION_FLAGS; |
+ CallFunctionStub stub(arity, flags); |
if (instr->hydrogen()->IsTailCall()) { |
if (NeedsEagerFrame()) __ leave(); |
__ jmp(stub.GetCode(isolate()), RelocInfo::CODE_TARGET); |