| Index: src/full-codegen/mips64/full-codegen-mips64.cc
|
| diff --git a/src/full-codegen/mips64/full-codegen-mips64.cc b/src/full-codegen/mips64/full-codegen-mips64.cc
|
| index c8a0753f91eb9e40cd5b35be13841f42f740ce9c..fefff5aad932fbd2615cebe2160e5ea9bbb71424 100644
|
| --- a/src/full-codegen/mips64/full-codegen-mips64.cc
|
| +++ b/src/full-codegen/mips64/full-codegen-mips64.cc
|
| @@ -216,7 +216,7 @@ void FullCodeGenerator::Generate() {
|
| // Load parameter from stack.
|
| __ ld(a0, MemOperand(fp, parameter_offset));
|
| // Store it in the context.
|
| - MemOperand target = ContextOperand(cp, var->index());
|
| + MemOperand target = ContextMemOperand(cp, var->index());
|
| __ sd(a0, target);
|
|
|
| // Update the write barrier.
|
| @@ -714,7 +714,7 @@ MemOperand FullCodeGenerator::VarOperand(Variable* var, Register scratch) {
|
| if (var->IsContextSlot()) {
|
| int context_chain_length = scope()->ContextChainLength(var->scope());
|
| __ LoadContext(scratch, context_chain_length);
|
| - return ContextOperand(scratch, var->index());
|
| + return ContextMemOperand(scratch, var->index());
|
| } else {
|
| return StackOperand(var);
|
| }
|
| @@ -820,7 +820,7 @@ void FullCodeGenerator::VisitVariableDeclaration(
|
| Comment cmnt(masm_, "[ VariableDeclaration");
|
| EmitDebugCheckDeclarationContext(variable);
|
| __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
|
| - __ sd(at, ContextOperand(cp, variable->index()));
|
| + __ sd(at, ContextMemOperand(cp, variable->index()));
|
| // No write barrier since the_hole_value is in old space.
|
| PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
|
| }
|
| @@ -878,7 +878,7 @@ void FullCodeGenerator::VisitFunctionDeclaration(
|
| Comment cmnt(masm_, "[ FunctionDeclaration");
|
| EmitDebugCheckDeclarationContext(variable);
|
| VisitForAccumulatorValue(declaration->fun());
|
| - __ sd(result_register(), ContextOperand(cp, variable->index()));
|
| + __ sd(result_register(), ContextMemOperand(cp, variable->index()));
|
| int offset = Context::SlotOffset(variable->index());
|
| // We know that we have written a function, which is not a smi.
|
| __ RecordWriteContextSlot(cp,
|
| @@ -1269,11 +1269,11 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
|
| if (s->num_heap_slots() > 0) {
|
| if (s->calls_sloppy_eval()) {
|
| // Check that extension is NULL.
|
| - __ ld(temp, ContextOperand(current, Context::EXTENSION_INDEX));
|
| + __ ld(temp, ContextMemOperand(current, Context::EXTENSION_INDEX));
|
| __ Branch(slow, ne, temp, Operand(zero_reg));
|
| }
|
| // Load next context in chain.
|
| - __ ld(next, ContextOperand(current, Context::PREVIOUS_INDEX));
|
| + __ ld(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
|
| // Walk the rest of the chain without clobbering cp.
|
| current = next;
|
| }
|
| @@ -1294,10 +1294,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
|
| __ LoadRoot(a4, Heap::kNativeContextMapRootIndex);
|
| __ Branch(&fast, eq, temp, Operand(a4));
|
| // Check that extension is NULL.
|
| - __ ld(temp, ContextOperand(next, Context::EXTENSION_INDEX));
|
| + __ ld(temp, ContextMemOperand(next, Context::EXTENSION_INDEX));
|
| __ Branch(slow, ne, temp, Operand(zero_reg));
|
| // Load next context in chain.
|
| - __ ld(next, ContextOperand(next, Context::PREVIOUS_INDEX));
|
| + __ ld(next, ContextMemOperand(next, Context::PREVIOUS_INDEX));
|
| __ Branch(&loop);
|
| __ bind(&fast);
|
| }
|
| @@ -1319,22 +1319,22 @@ MemOperand FullCodeGenerator::ContextSlotOperandCheckExtensions(Variable* var,
|
| if (s->num_heap_slots() > 0) {
|
| if (s->calls_sloppy_eval()) {
|
| // Check that extension is NULL.
|
| - __ ld(temp, ContextOperand(context, Context::EXTENSION_INDEX));
|
| + __ ld(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
|
| __ Branch(slow, ne, temp, Operand(zero_reg));
|
| }
|
| - __ ld(next, ContextOperand(context, Context::PREVIOUS_INDEX));
|
| + __ ld(next, ContextMemOperand(context, Context::PREVIOUS_INDEX));
|
| // Walk the rest of the chain without clobbering cp.
|
| context = next;
|
| }
|
| }
|
| // Check that last extension is NULL.
|
| - __ ld(temp, ContextOperand(context, Context::EXTENSION_INDEX));
|
| + __ ld(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
|
| __ Branch(slow, ne, temp, Operand(zero_reg));
|
|
|
| // This function is used only for loads, not stores, so it's safe to
|
| // return an cp-based operand (the write barrier cannot be allowed to
|
| // destroy the cp register).
|
| - return ContextOperand(context, var->index());
|
| + return ContextMemOperand(context, var->index());
|
| }
|
|
|
|
|
| @@ -1377,7 +1377,7 @@ void FullCodeGenerator::EmitGlobalVariableLoad(VariableProxy* proxy,
|
| Variable* var = proxy->var();
|
| DCHECK(var->IsUnallocatedOrGlobalSlot() ||
|
| (var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
|
| - __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
|
| + __ LoadGlobalObject(LoadDescriptor::ReceiverRegister());
|
| __ li(LoadDescriptor::NameRegister(), Operand(var->name()));
|
| __ li(LoadDescriptor::SlotRegister(),
|
| Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
|
| @@ -2184,9 +2184,7 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
|
| __ CallRuntime(Runtime::kAllocateInNewSpace, 1);
|
|
|
| __ bind(&done_allocate);
|
| - __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
|
| - __ ld(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset));
|
| - __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
|
| + __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
|
| __ pop(a2);
|
| __ LoadRoot(a3,
|
| done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
|
| @@ -2518,7 +2516,7 @@ void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op,
|
| // Global var, const, or let.
|
| __ mov(StoreDescriptor::ValueRegister(), result_register());
|
| __ li(StoreDescriptor::NameRegister(), Operand(var->name()));
|
| - __ ld(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand());
|
| + __ LoadGlobalObject(StoreDescriptor::ReceiverRegister());
|
| EmitLoadStoreICSlot(slot);
|
| CallStoreIC();
|
|
|
| @@ -4143,9 +4141,7 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
|
| Label runtime, done;
|
|
|
| __ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT);
|
| - __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
|
| - __ ld(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset));
|
| - __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
|
| + __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
|
| __ Pop(a2, a3);
|
| __ LoadRoot(a4, Heap::kEmptyFixedArrayRootIndex);
|
| __ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
|
| @@ -4169,9 +4165,7 @@ void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
|
| __ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
|
| __ push(v0);
|
|
|
| - __ ld(v0, GlobalObjectOperand());
|
| - __ ld(v0, FieldMemOperand(v0, JSGlobalObject::kNativeContextOffset));
|
| - __ ld(v0, ContextOperand(v0, expr->context_index()));
|
| + __ LoadNativeContextSlot(expr->context_index(), v0);
|
| }
|
|
|
|
|
| @@ -4261,7 +4255,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
|
| bool is_this = var->HasThisName(isolate());
|
| DCHECK(is_sloppy(language_mode()) || is_this);
|
| if (var->IsUnallocatedOrGlobalSlot()) {
|
| - __ ld(a2, GlobalObjectOperand());
|
| + __ LoadGlobalObject(a2);
|
| __ li(a1, Operand(var->name()));
|
| __ Push(a2, a1);
|
| __ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2);
|
| @@ -4814,7 +4808,7 @@ void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
|
|
|
|
|
| void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
|
| - __ ld(dst, ContextOperand(cp, context_index));
|
| + __ ld(dst, ContextMemOperand(cp, context_index));
|
| }
|
|
|
|
|
| @@ -4825,14 +4819,12 @@ void FullCodeGenerator::PushFunctionArgumentForContextAllocation() {
|
| // Contexts nested in the native context have a canonical empty function
|
| // as their closure, not the anonymous closure containing the global
|
| // code.
|
| - __ ld(at, GlobalObjectOperand());
|
| - __ ld(at, FieldMemOperand(at, JSGlobalObject::kNativeContextOffset));
|
| - __ ld(at, ContextOperand(at, Context::CLOSURE_INDEX));
|
| + __ LoadNativeContextSlot(Context::CLOSURE_INDEX, at);
|
| } else if (closure_scope->is_eval_scope()) {
|
| // Contexts created by a call to eval have the same closure as the
|
| // context calling eval, not the anonymous closure containing the eval
|
| // code. Fetch it from the context.
|
| - __ ld(at, ContextOperand(cp, Context::CLOSURE_INDEX));
|
| + __ ld(at, ContextMemOperand(cp, Context::CLOSURE_INDEX));
|
| } else {
|
| DCHECK(closure_scope->is_function_scope());
|
| __ ld(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
|
|
|