| Index: src/x64/builtins-x64.cc
|
| diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc
|
| index aef91640a01687f133f5dcd68770c416b278968b..40323edd4c27368e7d3cad44932e463b3105490e 100644
|
| --- a/src/x64/builtins-x64.cc
|
| +++ b/src/x64/builtins-x64.cc
|
| @@ -32,6 +32,7 @@
|
| #include "codegen.h"
|
| #include "deoptimizer.h"
|
| #include "full-codegen.h"
|
| +#include "stub-cache.h"
|
|
|
| namespace v8 {
|
| namespace internal {
|
| @@ -826,12 +827,7 @@ void Builtins::Generate_FunctionCall(MacroAssembler* masm) {
|
| // Use the global receiver object from the called function as the
|
| // receiver.
|
| __ bind(&use_global_receiver);
|
| - const int kGlobalIndex =
|
| - Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
|
| - __ movq(rbx, FieldOperand(rsi, kGlobalIndex));
|
| - __ movq(rbx, FieldOperand(rbx, GlobalObject::kNativeContextOffset));
|
| - __ movq(rbx, FieldOperand(rbx, kGlobalIndex));
|
| - __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
|
| + CallStubCompiler::FetchGlobalProxy(masm, rbx, rdi);
|
|
|
| __ bind(&patch_receiver);
|
| __ movq(args.GetArgumentOperand(1), rbx);
|
| @@ -1011,13 +1007,7 @@ void Builtins::Generate_FunctionApply(MacroAssembler* masm) {
|
|
|
| // Use the current global receiver object as the receiver.
|
| __ bind(&use_global_receiver);
|
| - const int kGlobalOffset =
|
| - Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize;
|
| - __ movq(rbx, FieldOperand(rsi, kGlobalOffset));
|
| - __ movq(rbx, FieldOperand(rbx, GlobalObject::kNativeContextOffset));
|
| - __ movq(rbx, FieldOperand(rbx, kGlobalOffset));
|
| - __ movq(rbx, FieldOperand(rbx, GlobalObject::kGlobalReceiverOffset));
|
| -
|
| + CallStubCompiler::FetchGlobalProxy(masm, rbx, rdi);
|
| // Push the receiver.
|
| __ bind(&push_receiver);
|
| __ push(rbx);
|
|
|