Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index d35219c2dcb8cac1ad1fee2eef3cb38a04031bb8..e6a20f21f86a9d0e0c473bb1873720dfde06bb01 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -3250,10 +3250,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); |
} |
@@ -3818,7 +3815,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); |