Index: src/mips64/code-stubs-mips64.cc |
diff --git a/src/mips64/code-stubs-mips64.cc b/src/mips64/code-stubs-mips64.cc |
index 4300ad9a0901f737b5c64d6e7eaa3d0c945678a7..6b9aa382e593d256f231b67811c6d146a2c1859e 100644 |
--- a/src/mips64/code-stubs-mips64.cc |
+++ b/src/mips64/code-stubs-mips64.cc |
@@ -1700,8 +1700,7 @@ void ArgumentsAccessStub::GenerateNewSloppyFast(MacroAssembler* masm) { |
const int kAliasedOffset = |
Context::SlotOffset(Context::FAST_ALIASED_ARGUMENTS_MAP_INDEX); |
- __ ld(a4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
- __ ld(a4, FieldMemOperand(a4, JSGlobalObject::kNativeContextOffset)); |
+ __ ld(a4, NativeContextMemOperand()); |
Label skip2_ne, skip2_eq; |
__ Branch(&skip2_ne, ne, a6, Operand(zero_reg)); |
__ ld(a4, MemOperand(a4, kNormalOffset)); |
@@ -1904,10 +1903,7 @@ void ArgumentsAccessStub::GenerateNewStrict(MacroAssembler* masm) { |
static_cast<AllocationFlags>(TAG_OBJECT | SIZE_IN_WORDS)); |
// Get the arguments boilerplate from the current native context. |
- __ ld(a4, MemOperand(cp, Context::SlotOffset(Context::GLOBAL_OBJECT_INDEX))); |
- __ ld(a4, FieldMemOperand(a4, JSGlobalObject::kNativeContextOffset)); |
- __ ld(a4, MemOperand(a4, Context::SlotOffset( |
- Context::STRICT_ARGUMENTS_MAP_INDEX))); |
+ __ LoadNativeContextSlot(Context::STRICT_ARGUMENTS_MAP_INDEX, a4); |
__ sd(a4, FieldMemOperand(v0, JSObject::kMapOffset)); |
__ LoadRoot(a5, Heap::kEmptyFixedArrayRootIndex); |
@@ -2494,7 +2490,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
__ Branch(&miss, ne, feedback_map, Operand(at)); |
// Make sure the function is the Array() function |
- __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a5); |
+ __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, a5); |
__ Branch(&megamorphic, ne, a1, Operand(a5)); |
__ jmp(&done); |
@@ -2516,7 +2512,7 @@ static void GenerateRecordCallTarget(MacroAssembler* masm) { |
// An uninitialized cache is patched with the function. |
__ bind(&initialize); |
// Make sure the function is the Array() function. |
- __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a5); |
+ __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, a5); |
__ Branch(¬_array_function, ne, a1, Operand(a5)); |
// The target function is the Array constructor, |
@@ -2623,7 +2619,7 @@ void CallICStub::HandleArrayCase(MacroAssembler* masm, Label* miss) { |
// a3 - slot id |
// a2 - vector |
// a4 - allocation site (loaded from vector[slot]) |
- __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, at); |
+ __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, at); |
__ Branch(miss, ne, a1, Operand(at)); |
__ li(a0, Operand(arg_count())); |
@@ -2751,14 +2747,13 @@ void CallICStub::Generate(MacroAssembler* masm) { |
// Make sure the function is not the Array() function, which requires special |
// behavior on MISS. |
- __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, a4); |
+ __ LoadNativeContextSlot(Context::ARRAY_FUNCTION_INDEX, a4); |
__ Branch(&miss, eq, a1, Operand(a4)); |
- // Make sure the function belongs to the same native context (which implies |
- // the same global object). |
+ // Make sure the function belongs to the same native context. |
__ ld(t0, FieldMemOperand(a1, JSFunction::kContextOffset)); |
- __ ld(t0, ContextOperand(t0, Context::GLOBAL_OBJECT_INDEX)); |
- __ ld(t1, GlobalObjectOperand()); |
+ __ ld(t0, ContextMemOperand(t0, Context::NATIVE_CONTEXT_INDEX)); |
+ __ ld(t1, NativeContextMemOperand()); |
__ Branch(&miss, ne, t0, Operand(t1)); |
// Update stats. |
@@ -5156,14 +5151,14 @@ void LoadGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Go up context chain to the script context. |
for (int i = 0; i < depth(); ++i) { |
- __ ld(result_reg, ContextOperand(context_reg, Context::PREVIOUS_INDEX)); |
+ __ ld(result_reg, ContextMemOperand(context_reg, Context::PREVIOUS_INDEX)); |
context_reg = result_reg; |
} |
// Load the PropertyCell value at the specified slot. |
__ dsll(at, slot_reg, kPointerSizeLog2); |
__ Daddu(at, at, Operand(context_reg)); |
- __ ld(result_reg, ContextOperand(at, 0)); |
+ __ ld(result_reg, ContextMemOperand(at, 0)); |
__ ld(result_reg, FieldMemOperand(result_reg, PropertyCell::kValueOffset)); |
// Check that value is not the_hole. |
@@ -5195,14 +5190,14 @@ void StoreGlobalViaContextStub::Generate(MacroAssembler* masm) { |
// Go up context chain to the script context. |
for (int i = 0; i < depth(); ++i) { |
- __ ld(cell_reg, ContextOperand(context_reg, Context::PREVIOUS_INDEX)); |
+ __ ld(cell_reg, ContextMemOperand(context_reg, Context::PREVIOUS_INDEX)); |
context_reg = cell_reg; |
} |
// Load the PropertyCell at the specified slot. |
__ dsll(at, slot_reg, kPointerSizeLog2); |
__ Daddu(at, at, Operand(context_reg)); |
- __ ld(cell_reg, ContextOperand(at, 0)); |
+ __ ld(cell_reg, ContextMemOperand(at, 0)); |
// Load PropertyDetails for the cell (actually only the cell_type and kind). |
__ ld(cell_details_reg, |