Index: src/arm/builtins-arm.cc |
diff --git a/src/arm/builtins-arm.cc b/src/arm/builtins-arm.cc |
index 5a47ef44c0d93b40935528d5097cdef83511b180..6c374b3914330fc0d15075e103fbefd1eb8d13c0 100644 |
--- a/src/arm/builtins-arm.cc |
+++ b/src/arm/builtins-arm.cc |
@@ -34,6 +34,7 @@ |
#include "deoptimizer.h" |
#include "full-codegen.h" |
#include "runtime.h" |
+#include "stub-cache.h" |
namespace v8 { |
namespace internal { |
@@ -1091,12 +1092,8 @@ 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; |
- __ ldr(r2, FieldMemOperand(cp, kGlobalIndex)); |
- __ ldr(r2, FieldMemOperand(r2, GlobalObject::kNativeContextOffset)); |
- __ ldr(r2, FieldMemOperand(r2, kGlobalIndex)); |
- __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); |
+ __ ldr(r2, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
+ __ ldr(r2, FieldMemOperand(r2, GlobalObject::kGlobalReceiverOffset)); |
__ bind(&patch_receiver); |
__ add(r3, sp, Operand(r0, LSL, kPointerSizeLog2)); |
@@ -1287,11 +1284,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; |
- __ ldr(r0, FieldMemOperand(cp, kGlobalOffset)); |
- __ ldr(r0, FieldMemOperand(r0, GlobalObject::kNativeContextOffset)); |
- __ ldr(r0, FieldMemOperand(r0, kGlobalOffset)); |
+ __ ldr(r0, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX)); |
__ ldr(r0, FieldMemOperand(r0, GlobalObject::kGlobalReceiverOffset)); |
// Push the receiver. |