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

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

Issue 508673002: MIPS: Move register conventions out of the IC classes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix nits. Created 6 years, 4 months 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/mips/debug-mips.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips/full-codegen-mips.cc
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
index bd3e821ed2fb033e68ec4ce19be350d01352edd0..b08ccb01741c668dd9fb6e9880f536da859330e2 100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -1386,10 +1386,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
__ bind(&fast);
}
- __ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ li(LoadIC::NameRegister(), Operand(proxy->var()->name()));
+ __ lw(LoadConvention::ReceiverRegister(), GlobalObjectOperand());
+ __ li(LoadConvention::NameRegister(), Operand(proxy->var()->name()));
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
}
@@ -1475,10 +1475,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
switch (var->location()) {
case Variable::UNALLOCATED: {
Comment cmnt(masm_, "[ Global variable");
- __ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ li(LoadIC::NameRegister(), Operand(var->name()));
+ __ lw(LoadConvention::ReceiverRegister(), GlobalObjectOperand());
+ __ li(LoadConvention::NameRegister(), Operand(var->name()));
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
}
CallLoadIC(CONTEXTUAL);
@@ -1688,10 +1688,10 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
if (key->value()->IsInternalizedString()) {
if (property->emit_store()) {
VisitForAccumulatorValue(value);
- __ mov(StoreIC::ValueRegister(), result_register());
- DCHECK(StoreIC::ValueRegister().is(a0));
- __ li(StoreIC::NameRegister(), Operand(key->value()));
- __ lw(StoreIC::ReceiverRegister(), MemOperand(sp));
+ __ mov(StoreConvention::ValueRegister(), result_register());
+ DCHECK(StoreConvention::ValueRegister().is(a0));
+ __ li(StoreConvention::NameRegister(), Operand(key->value()));
+ __ lw(StoreConvention::ReceiverRegister(), MemOperand(sp));
CallStoreIC(key->LiteralFeedbackId());
PrepareForBailoutForId(key->id(), NO_REGISTERS);
} else {
@@ -1873,7 +1873,7 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
if (expr->is_compound()) {
// We need the receiver both on the stack and in the register.
VisitForStackValue(property->obj());
- __ lw(LoadIC::ReceiverRegister(), MemOperand(sp, 0));
+ __ lw(LoadConvention::ReceiverRegister(), MemOperand(sp, 0));
} else {
VisitForStackValue(property->obj());
}
@@ -1883,8 +1883,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
if (expr->is_compound()) {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
- __ lw(LoadIC::ReceiverRegister(), MemOperand(sp, 1 * kPointerSize));
- __ lw(LoadIC::NameRegister(), MemOperand(sp, 0));
+ __ lw(LoadConvention::ReceiverRegister(),
+ MemOperand(sp, 1 * kPointerSize));
+ __ lw(LoadConvention::NameRegister(), MemOperand(sp, 0));
} else {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
@@ -2022,8 +2023,8 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
Label l_catch, l_try, l_suspend, l_continuation, l_resume;
Label l_next, l_call;
- Register load_receiver = LoadIC::ReceiverRegister();
- Register load_name = LoadIC::NameRegister();
+ Register load_receiver = LoadConvention::ReceiverRegister();
+ Register load_name = LoadConvention::NameRegister();
// Initial send value is undefined.
__ LoadRoot(a0, Heap::kUndefinedValueRootIndex);
@@ -2081,7 +2082,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ lw(load_receiver, MemOperand(sp, kPointerSize));
__ lw(load_name, MemOperand(sp, 2 * kPointerSize));
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(expr->KeyedLoadFeedbackSlot())));
}
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
@@ -2101,7 +2102,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ push(load_receiver); // save result
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done"
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(expr->DoneFeedbackSlot())));
}
CallLoadIC(NOT_CONTEXTUAL); // v0=result.done
@@ -2114,7 +2115,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ pop(load_receiver); // result
__ LoadRoot(load_name, Heap::kvalue_stringRootIndex); // "value"
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(expr->ValueFeedbackSlot())));
}
CallLoadIC(NOT_CONTEXTUAL); // v0=result.value
@@ -2279,9 +2280,9 @@ void FullCodeGenerator::EmitCreateIteratorResult(bool done) {
void FullCodeGenerator::EmitNamedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Literal* key = prop->key()->AsLiteral();
- __ li(LoadIC::NameRegister(), Operand(key->value()));
+ __ li(LoadConvention::NameRegister(), Operand(key->value()));
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
CallLoadIC(NOT_CONTEXTUAL);
} else {
@@ -2294,7 +2295,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
SetSourcePosition(prop->position());
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(prop->PropertyFeedbackSlot())));
CallIC(ic);
} else {
@@ -2433,9 +2434,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
case NAMED_PROPERTY: {
__ push(result_register()); // Preserve value.
VisitForAccumulatorValue(prop->obj());
- __ mov(StoreIC::ReceiverRegister(), result_register());
- __ pop(StoreIC::ValueRegister()); // Restore value.
- __ li(StoreIC::NameRegister(),
+ __ mov(StoreConvention::ReceiverRegister(), result_register());
+ __ pop(StoreConvention::ValueRegister()); // Restore value.
+ __ li(StoreConvention::NameRegister(),
Operand(prop->key()->AsLiteral()->value()));
CallStoreIC();
break;
@@ -2444,8 +2445,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
__ push(result_register()); // Preserve value.
VisitForStackValue(prop->obj());
VisitForAccumulatorValue(prop->key());
- __ mov(KeyedStoreIC::NameRegister(), result_register());
- __ Pop(KeyedStoreIC::ValueRegister(), KeyedStoreIC::ReceiverRegister());
+ __ mov(StoreConvention::NameRegister(), result_register());
+ __ Pop(StoreConvention::ValueRegister(),
+ StoreConvention::ReceiverRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
@@ -2473,9 +2475,9 @@ void FullCodeGenerator::EmitStoreToStackLocalOrContextSlot(
void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) {
if (var->IsUnallocated()) {
// Global var, const, or let.
- __ mov(StoreIC::ValueRegister(), result_register());
- __ li(StoreIC::NameRegister(), Operand(var->name()));
- __ lw(StoreIC::ReceiverRegister(), GlobalObjectOperand());
+ __ mov(StoreConvention::ValueRegister(), result_register());
+ __ li(StoreConvention::NameRegister(), Operand(var->name()));
+ __ lw(StoreConvention::ReceiverRegister(), GlobalObjectOperand());
CallStoreIC();
} else if (op == Token::INIT_CONST_LEGACY) {
@@ -2545,9 +2547,10 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
// Record source code position before IC call.
SetSourcePosition(expr->position());
- __ mov(StoreIC::ValueRegister(), result_register());
- __ li(StoreIC::NameRegister(), Operand(prop->key()->AsLiteral()->value()));
- __ pop(StoreIC::ReceiverRegister());
+ __ mov(StoreConvention::ValueRegister(), result_register());
+ __ li(StoreConvention::NameRegister(),
+ Operand(prop->key()->AsLiteral()->value()));
+ __ pop(StoreConvention::ReceiverRegister());
CallStoreIC(expr->AssignmentFeedbackId());
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
@@ -2565,9 +2568,9 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
// - a0 is the value,
// - a1 is the key,
// - a2 is the receiver.
- __ mov(KeyedStoreIC::ValueRegister(), result_register());
- __ Pop(KeyedStoreIC::ReceiverRegister(), KeyedStoreIC::NameRegister());
- DCHECK(KeyedStoreIC::ValueRegister().is(a0));
+ __ mov(StoreConvention::ValueRegister(), result_register());
+ __ Pop(StoreConvention::ReceiverRegister(), StoreConvention::NameRegister());
+ DCHECK(StoreConvention::ValueRegister().is(a0));
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
@@ -2585,15 +2588,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
- __ Move(LoadIC::ReceiverRegister(), v0);
+ __ Move(LoadConvention::ReceiverRegister(), v0);
EmitNamedPropertyLoad(expr);
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(v0);
} else {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
- __ Move(LoadIC::NameRegister(), v0);
- __ pop(LoadIC::ReceiverRegister());
+ __ Move(LoadConvention::NameRegister(), v0);
+ __ pop(LoadConvention::ReceiverRegister());
EmitKeyedPropertyLoad(expr);
context()->Plug(v0);
}
@@ -2627,7 +2630,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) {
} else {
// Load the function from the receiver.
DCHECK(callee->IsProperty());
- __ lw(LoadIC::ReceiverRegister(), MemOperand(sp, 0));
+ __ lw(LoadConvention::ReceiverRegister(), MemOperand(sp, 0));
EmitNamedPropertyLoad(callee->AsProperty());
PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
// Push the target function under the receiver.
@@ -2650,8 +2653,8 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr,
// Load the function from the receiver.
DCHECK(callee->IsProperty());
- __ lw(LoadIC::ReceiverRegister(), MemOperand(sp, 0));
- __ Move(LoadIC::NameRegister(), v0);
+ __ lw(LoadConvention::ReceiverRegister(), MemOperand(sp, 0));
+ __ Move(LoadConvention::NameRegister(), v0);
EmitKeyedPropertyLoad(callee->AsProperty());
PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
@@ -4095,15 +4098,15 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) {
if (expr->is_jsruntime()) {
// Push the builtins object as the receiver.
- Register receiver = LoadIC::ReceiverRegister();
+ Register receiver = LoadConvention::ReceiverRegister();
__ lw(receiver, GlobalObjectOperand());
__ lw(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset));
__ push(receiver);
// Load the function from the receiver.
- __ li(LoadIC::NameRegister(), Operand(expr->name()));
+ __ li(LoadConvention::NameRegister(), Operand(expr->name()));
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(expr->CallRuntimeFeedbackSlot())));
CallLoadIC(NOT_CONTEXTUAL);
} else {
@@ -4286,13 +4289,14 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
if (assign_type == NAMED_PROPERTY) {
// Put the object both on the stack and in the register.
VisitForStackValue(prop->obj());
- __ lw(LoadIC::ReceiverRegister(), MemOperand(sp, 0));
+ __ lw(LoadConvention::ReceiverRegister(), MemOperand(sp, 0));
EmitNamedPropertyLoad(prop);
} else {
VisitForStackValue(prop->obj());
VisitForStackValue(prop->key());
- __ lw(LoadIC::ReceiverRegister(), MemOperand(sp, 1 * kPointerSize));
- __ lw(LoadIC::NameRegister(), MemOperand(sp, 0));
+ __ lw(LoadConvention::ReceiverRegister(),
+ MemOperand(sp, 1 * kPointerSize));
+ __ lw(LoadConvention::NameRegister(), MemOperand(sp, 0));
EmitKeyedPropertyLoad(prop);
}
}
@@ -4403,10 +4407,10 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
break;
case NAMED_PROPERTY: {
- __ mov(StoreIC::ValueRegister(), result_register());
- __ li(StoreIC::NameRegister(),
+ __ mov(StoreConvention::ValueRegister(), result_register());
+ __ li(StoreConvention::NameRegister(),
Operand(prop->key()->AsLiteral()->value()));
- __ pop(StoreIC::ReceiverRegister());
+ __ pop(StoreConvention::ReceiverRegister());
CallStoreIC(expr->CountStoreFeedbackId());
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@@ -4419,8 +4423,9 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
break;
}
case KEYED_PROPERTY: {
- __ mov(KeyedStoreIC::ValueRegister(), result_register());
- __ Pop(KeyedStoreIC::ReceiverRegister(), KeyedStoreIC::NameRegister());
+ __ mov(StoreConvention::ValueRegister(), result_register());
+ __ Pop(StoreConvention::ReceiverRegister(),
+ StoreConvention::NameRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
@@ -4445,10 +4450,10 @@ void FullCodeGenerator::VisitForTypeofValue(Expression* expr) {
VariableProxy* proxy = expr->AsVariableProxy();
if (proxy != NULL && proxy->var()->IsUnallocated()) {
Comment cmnt(masm_, "[ Global variable");
- __ lw(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ li(LoadIC::NameRegister(), Operand(proxy->name()));
+ __ lw(LoadConvention::ReceiverRegister(), GlobalObjectOperand());
+ __ li(LoadConvention::NameRegister(), Operand(proxy->name()));
if (FLAG_vector_ics) {
- __ li(LoadIC::SlotRegister(),
+ __ li(VectorLoadConvention::SlotRegister(),
Operand(Smi::FromInt(proxy->VariableFeedbackSlot())));
}
// Use a regular load, not a contextual load, to avoid a reference
« no previous file with comments | « src/mips/debug-mips.cc ('k') | src/mips/lithium-codegen-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698