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

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

Issue 1480003002: [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: Add patch from Orion for interpreter cementation test. Disable obsolete/invalid tests. 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/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/full-codegen/mips/full-codegen-mips.cc
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc
index f79e10a918957747975d8d8e4293d2066da9f613..aedf3d81e3345e65c24e35337d9f4000c29a82ad 100644
--- a/src/full-codegen/mips/full-codegen-mips.cc
+++ b/src/full-codegen/mips/full-codegen-mips.cc
@@ -217,7 +217,7 @@ void FullCodeGenerator::Generate() {
// Load parameter from stack.
__ lw(a0, MemOperand(fp, parameter_offset));
// Store it in the context.
- MemOperand target = ContextOperand(cp, var->index());
+ MemOperand target = ContextMemOperand(cp, var->index());
__ sw(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);
- __ sw(at, ContextOperand(cp, variable->index()));
+ __ sw(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());
- __ sw(result_register(), ContextOperand(cp, variable->index()));
+ __ sw(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.
- __ lw(temp, ContextOperand(current, Context::EXTENSION_INDEX));
+ __ lw(temp, ContextMemOperand(current, Context::EXTENSION_INDEX));
__ Branch(slow, ne, temp, Operand(zero_reg));
}
// Load next context in chain.
- __ lw(next, ContextOperand(current, Context::PREVIOUS_INDEX));
+ __ lw(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(t0, Heap::kNativeContextMapRootIndex);
__ Branch(&fast, eq, temp, Operand(t0));
// Check that extension is NULL.
- __ lw(temp, ContextOperand(next, Context::EXTENSION_INDEX));
+ __ lw(temp, ContextMemOperand(next, Context::EXTENSION_INDEX));
__ Branch(slow, ne, temp, Operand(zero_reg));
// Load next context in chain.
- __ lw(next, ContextOperand(next, Context::PREVIOUS_INDEX));
+ __ lw(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.
- __ lw(temp, ContextOperand(context, Context::EXTENSION_INDEX));
+ __ lw(temp, ContextMemOperand(context, Context::EXTENSION_INDEX));
__ Branch(slow, ne, temp, Operand(zero_reg));
}
- __ lw(next, ContextOperand(context, Context::PREVIOUS_INDEX));
+ __ lw(next, ContextMemOperand(context, Context::PREVIOUS_INDEX));
// Walk the rest of the chain without clobbering cp.
context = next;
}
}
// Check that last extension is NULL.
- __ lw(temp, ContextOperand(context, Context::EXTENSION_INDEX));
+ __ lw(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));
- __ lw(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);
- __ lw(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
- __ lw(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset));
- __ lw(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
+ __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
__ pop(a2);
__ LoadRoot(a3,
done ? Heap::kTrueValueRootIndex : Heap::kFalseValueRootIndex);
@@ -2517,7 +2515,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()));
- __ lw(StoreDescriptor::ReceiverRegister(), GlobalObjectOperand());
+ __ LoadGlobalObject(StoreDescriptor::ReceiverRegister());
EmitLoadStoreICSlot(slot);
CallStoreIC();
@@ -4138,9 +4136,7 @@ void FullCodeGenerator::EmitCreateIterResultObject(CallRuntime* expr) {
Label runtime, done;
__ Allocate(JSIteratorResult::kSize, v0, a2, a3, &runtime, TAG_OBJECT);
- __ lw(a1, ContextOperand(cp, Context::GLOBAL_OBJECT_INDEX));
- __ lw(a1, FieldMemOperand(a1, JSGlobalObject::kNativeContextOffset));
- __ lw(a1, ContextOperand(a1, Context::ITERATOR_RESULT_MAP_INDEX));
+ __ LoadNativeContextSlot(Context::ITERATOR_RESULT_MAP_INDEX, a1);
__ Pop(a2, a3);
__ LoadRoot(t0, Heap::kEmptyFixedArrayRootIndex);
__ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
@@ -4164,9 +4160,7 @@ void FullCodeGenerator::EmitLoadJSRuntimeFunction(CallRuntime* expr) {
__ LoadRoot(v0, Heap::kUndefinedValueRootIndex);
__ push(v0);
- __ lw(v0, GlobalObjectOperand());
- __ lw(v0, FieldMemOperand(v0, JSGlobalObject::kNativeContextOffset));
- __ lw(v0, ContextOperand(v0, expr->context_index()));
+ __ LoadNativeContextSlot(expr->context_index(), v0);
}
@@ -4257,7 +4251,7 @@ void FullCodeGenerator::VisitUnaryOperation(UnaryOperation* expr) {
bool is_this = var->HasThisName(isolate());
DCHECK(is_sloppy(language_mode()) || is_this);
if (var->IsUnallocatedOrGlobalSlot()) {
- __ lw(a2, GlobalObjectOperand());
+ __ LoadGlobalObject(a2);
__ li(a1, Operand(var->name()));
__ Push(a2, a1);
__ CallRuntime(Runtime::kDeleteProperty_Sloppy, 2);
@@ -4808,7 +4802,7 @@ void FullCodeGenerator::StoreToFrameField(int frame_offset, Register value) {
void FullCodeGenerator::LoadContextField(Register dst, int context_index) {
- __ lw(dst, ContextOperand(cp, context_index));
+ __ lw(dst, ContextMemOperand(cp, context_index));
}
@@ -4819,14 +4813,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.
- __ lw(at, GlobalObjectOperand());
- __ lw(at, FieldMemOperand(at, JSGlobalObject::kNativeContextOffset));
- __ lw(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.
- __ lw(at, ContextOperand(cp, Context::CLOSURE_INDEX));
+ __ lw(at, ContextMemOperand(cp, Context::CLOSURE_INDEX));
} else {
DCHECK(closure_scope->is_function_scope());
__ lw(at, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset));
« no previous file with comments | « src/full-codegen/ia32/full-codegen-ia32.cc ('k') | src/full-codegen/mips64/full-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698