Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index 252bb3534d6ee6da90929154a52c1e366b5f5631..5a55c6d862a2049cec2cb112b0fa87f01bbb39a2 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -1521,10 +1521,7 @@ void MacroAssembler::CheckAccessGlobalProxy(Register holder_reg, |
#endif |
// Load the native context of the current context. |
- int offset = |
- Context::kHeaderSize + Context::GLOBAL_OBJECT_INDEX * kPointerSize; |
- ldr(scratch, FieldMemOperand(scratch, offset)); |
- ldr(scratch, FieldMemOperand(scratch, JSGlobalObject::kNativeContextOffset)); |
+ ldr(scratch, ContextMemOperand(scratch, Context::NATIVE_CONTEXT_INDEX)); |
// Check the context is a native context. |
if (emit_debug_code()) { |
@@ -2520,7 +2517,8 @@ void MacroAssembler::InvokeBuiltin(int native_context_index, InvokeFlag flag, |
// You can't call a builtin without a valid frame. |
DCHECK(flag == JUMP_FUNCTION || has_frame()); |
- GetBuiltinEntry(r2, native_context_index); |
+ LoadNativeContextSlot(native_context_index, r1); |
+ ldr(r2, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
if (flag == CALL_FUNCTION) { |
call_wrapper.BeforeCall(CallSize(r2)); |
Call(r2); |
@@ -2532,26 +2530,6 @@ void MacroAssembler::InvokeBuiltin(int native_context_index, InvokeFlag flag, |
} |
-void MacroAssembler::GetBuiltinFunction(Register target, |
- int native_context_index) { |
- // Load the builtins object into target register. |
- ldr(target, |
- MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
- ldr(target, FieldMemOperand(target, JSGlobalObject::kNativeContextOffset)); |
- // Load the JavaScript builtin function from the builtins object. |
- ldr(target, ContextOperand(target, native_context_index)); |
-} |
- |
- |
-void MacroAssembler::GetBuiltinEntry(Register target, |
- int native_context_index) { |
- DCHECK(!target.is(r1)); |
- GetBuiltinFunction(r1, native_context_index); |
- // Load the code entry point from the builtins object. |
- ldr(target, FieldMemOperand(r1, JSFunction::kCodeEntryOffset)); |
-} |
- |
- |
void MacroAssembler::SetCounter(StatsCounter* counter, int value, |
Register scratch1, Register scratch2) { |
if (FLAG_native_code_counters && counter->Enabled()) { |
@@ -2682,29 +2660,15 @@ void MacroAssembler::LoadContext(Register dst, int context_chain_length) { |
} |
-void MacroAssembler::LoadGlobalProxy(Register dst) { |
- ldr(dst, GlobalObjectOperand()); |
- ldr(dst, FieldMemOperand(dst, JSGlobalObject::kGlobalProxyOffset)); |
-} |
- |
- |
void MacroAssembler::LoadTransitionedArrayMapConditional( |
ElementsKind expected_kind, |
ElementsKind transitioned_kind, |
Register map_in_out, |
Register scratch, |
Label* no_map_match) { |
- // Load the global or builtins object from the current context. |
- ldr(scratch, |
- MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
- ldr(scratch, FieldMemOperand(scratch, JSGlobalObject::kNativeContextOffset)); |
- |
// Check that the function's map is the same as the expected cached map. |
- ldr(scratch, |
- MemOperand(scratch, |
- Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); |
- size_t offset = expected_kind * kPointerSize + |
- FixedArrayBase::kHeaderSize; |
+ LoadNativeContextSlot(Context::JS_ARRAY_MAPS_INDEX, scratch); |
+ size_t offset = expected_kind * kPointerSize + FixedArrayBase::kHeaderSize; |
ldr(ip, FieldMemOperand(scratch, offset)); |
cmp(map_in_out, ip); |
b(ne, no_map_match); |
@@ -2716,15 +2680,9 @@ void MacroAssembler::LoadTransitionedArrayMapConditional( |
} |
-void MacroAssembler::LoadGlobalFunction(int index, Register function) { |
- // Load the global or builtins object from the current context. |
- ldr(function, |
- MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
- // Load the native context from the global or builtins object. |
- ldr(function, |
- FieldMemOperand(function, JSGlobalObject::kNativeContextOffset)); |
- // Load the function from the native context. |
- ldr(function, MemOperand(function, Context::SlotOffset(index))); |
+void MacroAssembler::LoadNativeContextSlot(int index, Register dst) { |
+ ldr(dst, NativeContextMemOperand()); |
+ ldr(dst, ContextMemOperand(dst, index)); |
} |