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

Unified Diff: src/mips64/full-codegen-mips64.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/mips64/debug-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mips64/full-codegen-mips64.cc
diff --git a/src/mips64/full-codegen-mips64.cc b/src/mips64/full-codegen-mips64.cc
index dc90608211cb1d97824784af0f36e27305cadfaf..a40a1aaec37616dc10a06b3653e7e024ff252f5c 100644
--- a/src/mips64/full-codegen-mips64.cc
+++ b/src/mips64/full-codegen-mips64.cc
@@ -1381,10 +1381,10 @@ void FullCodeGenerator::EmitLoadGlobalCheckExtensions(VariableProxy* proxy,
__ bind(&fast);
}
- __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ li(LoadIC::NameRegister(), Operand(proxy->var()->name()));
+ __ ld(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())));
}
@@ -1472,10 +1472,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
Comment cmnt(masm_, "[ Global variable");
// Use inline caching. Variable name is passed in a2 and the global
// object (receiver) in a0.
- __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ li(LoadIC::NameRegister(), Operand(var->name()));
+ __ ld(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);
@@ -1685,10 +1685,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()));
- __ ld(StoreIC::ReceiverRegister(), MemOperand(sp));
+ __ mov(StoreConvention::ValueRegister(), result_register());
+ DCHECK(StoreConvention::ValueRegister().is(a0));
+ __ li(StoreConvention::NameRegister(), Operand(key->value()));
+ __ ld(StoreConvention::ReceiverRegister(), MemOperand(sp));
CallStoreIC(key->LiteralFeedbackId());
PrepareForBailoutForId(key->id(), NO_REGISTERS);
} else {
@@ -1870,7 +1870,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());
- __ ld(LoadIC::ReceiverRegister(), MemOperand(sp, 0));
+ __ ld(LoadConvention::ReceiverRegister(), MemOperand(sp, 0));
} else {
VisitForStackValue(property->obj());
}
@@ -1880,8 +1880,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
if (expr->is_compound()) {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
- __ ld(LoadIC::ReceiverRegister(), MemOperand(sp, 1 * kPointerSize));
- __ ld(LoadIC::NameRegister(), MemOperand(sp, 0));
+ __ ld(LoadConvention::ReceiverRegister(),
+ MemOperand(sp, 1 * kPointerSize));
+ __ ld(LoadConvention::NameRegister(), MemOperand(sp, 0));
} else {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
@@ -2019,8 +2020,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);
__ Branch(&l_next);
@@ -2076,7 +2077,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ ld(load_receiver, MemOperand(sp, kPointerSize));
__ ld(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();
@@ -2096,7 +2097,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
@@ -2109,7 +2110,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
@@ -2276,9 +2277,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 {
@@ -2292,7 +2293,7 @@ void FullCodeGenerator::EmitKeyedPropertyLoad(Property* prop) {
// Call keyed load IC. It has register arguments receiver and key.
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 {
@@ -2430,9 +2431,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;
@@ -2441,8 +2442,9 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
__ push(result_register()); // Preserve value.
VisitForStackValue(prop->obj());
VisitForAccumulatorValue(prop->key());
- __ Move(KeyedStoreIC::NameRegister(), result_register());
- __ Pop(KeyedStoreIC::ValueRegister(), KeyedStoreIC::ReceiverRegister());
+ __ Move(StoreConvention::NameRegister(), result_register());
+ __ Pop(StoreConvention::ValueRegister(),
+ StoreConvention::ReceiverRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
@@ -2470,9 +2472,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()));
- __ ld(StoreIC::ReceiverRegister(), GlobalObjectOperand());
+ __ mov(StoreConvention::ValueRegister(), result_register());
+ __ li(StoreConvention::NameRegister(), Operand(var->name()));
+ __ ld(StoreConvention::ReceiverRegister(), GlobalObjectOperand());
CallStoreIC();
} else if (op == Token::INIT_CONST_LEGACY) {
// Const initializers need a write barrier.
@@ -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());
- __ ld(LoadIC::ReceiverRegister(), MemOperand(sp, 0));
+ __ ld(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());
- __ ld(LoadIC::ReceiverRegister(), MemOperand(sp, 0));
- __ Move(LoadIC::NameRegister(), v0);
+ __ ld(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();
__ ld(receiver, GlobalObjectOperand());
__ ld(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());
- __ ld(LoadIC::ReceiverRegister(), MemOperand(sp, 0));
+ __ ld(LoadConvention::ReceiverRegister(), MemOperand(sp, 0));
EmitNamedPropertyLoad(prop);
} else {
VisitForStackValue(prop->obj());
VisitForStackValue(prop->key());
- __ ld(LoadIC::ReceiverRegister(), MemOperand(sp, 1 * kPointerSize));
- __ ld(LoadIC::NameRegister(), MemOperand(sp, 0));
+ __ ld(LoadConvention::ReceiverRegister(),
+ MemOperand(sp, 1 * kPointerSize));
+ __ ld(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");
- __ ld(LoadIC::ReceiverRegister(), GlobalObjectOperand());
- __ li(LoadIC::NameRegister(), Operand(proxy->name()));
+ __ ld(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/mips64/debug-mips64.cc ('k') | src/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698