Index: src/x64/builtins-x64.cc |
diff --git a/src/x64/builtins-x64.cc b/src/x64/builtins-x64.cc |
index aef91640a01687f133f5dcd68770c416b278968b..f64728f2d8510c5224fadf306c423f450c58c73d 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, rdi, rbx); |
Toon Verwaest
2013/12/18 13:09:33
Maybe we should swap the arguments in FetchGlobalP
|
__ 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, rdi, rbx); |
// Push the receiver. |
__ bind(&push_receiver); |
__ push(rbx); |