Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: src/full-codegen/mips64/full-codegen-mips64.cc

Issue 1478303002: Revert of [runtime] Replace global object link with native context link in all contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 87afc32449eb1a35b7630c0231ea547df5abf504..6401274f74c2379462862be900cadd22bd892c34 100644
--- a/src/full-codegen/mips64/full-codegen-mips64.cc
+++ b/src/full-codegen/mips64/full-codegen-mips64.cc
@@ -216,7 +216,7 @@
// Load parameter from stack.
__ ld(a0, MemOperand(fp, parameter_offset));
// Store it in the context.
- MemOperand target = ContextMemOperand(cp, var->index());
+ MemOperand target = ContextOperand(cp, var->index());
__ sd(a0, target);
// Update the write barrier.
@@ -714,7 +714,7 @@
if (var->IsContextSlot()) {
int context_chain_length = scope()->ContextChainLength(var->scope());
__ LoadContext(scratch, context_chain_length);
- return ContextMemOperand(scratch, var->index());
+ return ContextOperand(scratch, var->index());
} else {
return StackOperand(var);
}
@@ -820,7 +820,7 @@
Comment cmnt(masm_, "[ VariableDeclaration");
EmitDebugCheckDeclarationContext(variable);
__ LoadRoot(at, Heap::kTheHoleValueRootIndex);
- __ sd(at, ContextMemOperand(cp, variable->index()));
+ __ sd(at, ContextOperand(cp, variable->index()));
// No write barrier since the_hole_value is in old space.
PrepareForBailoutForId(proxy->id(), NO_REGISTERS);
}
@@ -878,7 +878,7 @@
Comment cmnt(masm_, "[ FunctionDeclaration");
EmitDebugCheckDeclarationContext(variable);
VisitForAccumulatorValue(declaration->fun());
- __ sd(result_register(), ContextMemOperand(cp, variable->index()));
+ __ sd(result_register(), ContextOperand(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 @@
if (s->num_heap_slots() > 0) {
if (s->calls_sloppy_eval()) {
// Check that extension is NULL.
- __ ld(temp, ContextMemOperand(current, Context::EXTENSION_INDEX));
+ __ ld(temp, ContextOperand(current, Context::EXTENSION_INDEX));
__ Branch(slow, ne, temp, Operand(zero_reg));
}
// Load next context in chain.
- __ ld(next, ContextMemOperand(current, Context::PREVIOUS_INDEX));
+ __ ld(next, ContextOperand(current, Context::PREVIOUS_INDEX));
// Walk the rest of the chain without clobbering cp.
current = next;
}
@@ -1294,10 +1294,10 @@
__ LoadRoot(a4, Heap::kNativeContextMapRootIndex);
__ Branch(&fast, eq, temp, Operand(a4));
// Check that extension is NULL.
- __ ld(temp, ContextMemOperand(next, Context::EXTENSION_INDEX));
+ __ ld(temp, ContextOperand(next, Context::EXTENSION_INDEX));
__ Branch(slow, ne, temp, Operand(zero_reg));
// Load next context in chain.
- __ ld(next, ContextMemOperand(next, Context::PREVIOUS_INDEX));
+ __ ld(next, ContextOperand(next, Context::PREVIOUS_INDEX));
__ Branch(&loop);
__ bind(&fast);
}
@@ -1319,22 +1319,22 @@
if (s->num_heap_slots() > 0) {
if (s->calls_sloppy_eval()) {
// Check that extension is NULL.
- __ ld(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
+ __ ld(temp, ContextOperand(context, Context::EXTENSION_INDEX));
__ Branch(slow, ne, temp, Operand(zero_reg));
}
- __ ld(next, ContextMemOperand(context, Context::PREVIOUS_INDEX));
+ __ ld(next, ContextOperand(context, Context::PREVIOUS_INDEX));
// Walk the rest of the chain without clobbering cp.
context = next;
}
}
// Check that last extension is NULL.
- __ ld(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
+ __ ld(temp, ContextOperand(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 ContextMemOperand(context, var->index());
+ return ContextOperand(context, var->index());
}
@@ -1377,7 +1377,7 @@
Variable* var = proxy->var();
DCHECK(var->IsUnallocatedOrGlobalSlot() ||
(var->IsLookupSlot() && var->mode() == DYNAMIC_GLOBAL));
- __ LoadGlobalObject(LoadDescriptor::ReceiverRegister());
+ __ ld(LoadDescriptor::ReceiverRegister(), GlobalObjectOperand());
__ li(LoadDescriptor::NameRegister(), Operand(var->name()));
__ li(LoadDescriptor::SlotRegister(),
Operand(SmiFromSlot(proxy->VariableFeedbackSlot())));
@@ -2184,7 +2184,9 @@
__ CallRuntime(Runtime::kAllocateInNewSpace, 1);
__ bind(&done_allocate);
- __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
+ __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
+ __ ld(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset));
+ __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
__ pop(a2);
__ LoadRoot(a3,
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
@@ -2516,7 +2518,7 @@
// Global var, const, or let.
__ mov(StoreDescriptor::ValueRegister(), result_register());
__ li(StoreDescriptor::NameRegister(), Operand(var->name()));
- __ LoadGlobalObject(StoreDescriptor::ReceiverRegister());
+ __ ld(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand());
EmitLoadStoreICSlot(slot);
CallStoreIC();
@@ -4141,7 +4143,9 @@
Label runtime, done;
__ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT);
- __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
+ __ ld(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
+ __ ld(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset));
+ __ ld(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
__ Pop(a2, a3);
__ LoadRoot(a4, Heap::kEmptyFixedArrayRootIndex);
__ sd(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
@@ -4165,7 +4169,9 @@
__ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
__ push(v0);
- __ LoadNativeContextSlot(expr->context_index(), v0);
+ __ ld(v0, GlobalObjectOperand());
+ __ ld(v0, FieldMemOperand(v0, JSGlobalObject::kNativeContextOffset));
+ __ ld(v0, ContextOperand(v0, expr->context_index()));
}
@@ -4255,7 +4261,7 @@
bool is_this = var->HasThisName(isolate());
DCHECK(is_sloppy(language_mode()) || is_this);
if (var->IsUnallocatedOrGlobalSlot()) {
- __ LoadGlobalObject(a2);
+ __ ld(a2, GlobalObjectOperand());
__ li(a1, Operand(var->name()));
__ Push(a2, a1);
__ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2);
@@ -4808,7 +4814,7 @@
void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
- __ ld(dst, ContextMemOperand(cp, context_index));
+ __ ld(dst, ContextOperand(cp, context_index));
}
@@ -4819,12 +4825,14 @@
// Contexts nested in the native context have a canonical empty function
// as their closure, not the anonymous closure containing the global
// code.
- __ LoadNativeContextSlot(Context::CLOSURE_INDEX, at);
+ __ ld(at, GlobalObjectOperand());
+ __ ld(at, FieldMemOperand(at, JSGlobalObject::kNativeContextOffset));
+ __ ld(at, ContextOperand(at, Context::CLOSURE_INDEX));
} 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, ContextMemOperand(cp, Context::CLOSURE_INDEX));
+ __ ld(at, ContextOperand(cp, Context::CLOSURE_INDEX));
} else {
DCHECK(closure_scope->is_function_scope());
__ ld(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
« no previous file with comments | « src/full-codegen/mips/full-codegen-mips.cc ('k') | src/full-codegen/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698