Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index 780307317881d0720884cc8b8beec64e45a070e6..b2cd558a7a71925f41ded701d57805ad819186d3 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 { |
@@ -846,12 +847,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); |
@@ -1031,13 +1027,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); |