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

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

Issue 383913002: MIPS: Use a register spec for StoreIC and KeyedStoreIC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed typo. Created 6 years, 5 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/ic-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 11a67b7adb2a44bf756c0d9d26836905e440389b..1704b2ff9aa042efd58e708fd6fc00aefbe5db8e 100644
--- a/src/mips/full-codegen-mips.cc
+++ b/src/mips/full-codegen-mips.cc
@@ -1689,9 +1689,10 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) {
if (key->value()->IsInternalizedString()) {
if (property->emit_store()) {
VisitForAccumulatorValue(value);
- __ mov(a0, result_register());
- __ li(a2, Operand(key->value()));
- __ lw(a1, MemOperand(sp));
+ __ mov(StoreIC::ValueRegister(), result_register());
+ ASSERT(StoreIC::ValueRegister().is(a0));
+ __ li(StoreIC::NameRegister(), Operand(key->value()));
+ __ lw(StoreIC::ReceiverRegister(), MemOperand(sp));
CallStoreIC(key->LiteralFeedbackId());
PrepareForBailoutForId(key->id(), NO_REGISTERS);
} else {
@@ -2414,9 +2415,10 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
case NAMED_PROPERTY: {
__ push(result_register()); // Preserve value.
VisitForAccumulatorValue(prop->obj());
- __ mov(a1, result_register());
- __ pop(a0); // Restore value.
- __ li(a2, Operand(prop->key()->AsLiteral()->value()));
+ __ mov(StoreIC::ReceiverRegister(), result_register());
+ __ pop(StoreIC::ValueRegister()); // Restore value.
+ __ li(StoreIC::NameRegister(),
+ Operand(prop->key()->AsLiteral()->value()));
CallStoreIC();
break;
}
@@ -2424,8 +2426,8 @@ void FullCodeGenerator::EmitAssignment(Expression* expr) {
__ push(result_register()); // Preserve value.
VisitForStackValue(prop->obj());
VisitForAccumulatorValue(prop->key());
- __ mov(a1, result_register());
- __ Pop(a0, a2); // a0 = restored value.
+ __ mov(KeyedStoreIC::NameRegister(), result_register());
+ __ Pop(KeyedStoreIC::ValueRegister(), KeyedStoreIC::ReceiverRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
@@ -2462,9 +2464,9 @@ void FullCodeGenerator::EmitCallStoreContextSlot(
void FullCodeGenerator::EmitVariableAssignment(Variable* var, Token::Value op) {
if (var->IsUnallocated()) {
// Global var, const, or let.
- __ mov(a0, result_register());
- __ li(a2, Operand(var->name()));
- __ lw(a1, GlobalObjectOperand());
+ __ mov(StoreIC::ValueRegister(), result_register());
+ __ li(StoreIC::NameRegister(), Operand(var->name()));
+ __ lw(StoreIC::ReceiverRegister(), GlobalObjectOperand());
CallStoreIC();
} else if (op == Token::INIT_CONST_LEGACY) {
@@ -2533,10 +2535,9 @@ void FullCodeGenerator::EmitNamedPropertyAssignment(Assignment* expr) {
// Record source code position before IC call.
SetSourcePosition(expr->position());
- __ mov(a0, result_register()); // Load the value.
- __ li(a2, Operand(prop->key()->AsLiteral()->value()));
- __ pop(a1);
-
+ __ mov(StoreIC::ValueRegister(), result_register());
+ __ li(StoreIC::NameRegister(), Operand(prop->key()->AsLiteral()->value()));
+ __ pop(StoreIC::ReceiverRegister());
CallStoreIC(expr->AssignmentFeedbackId());
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
@@ -2554,8 +2555,9 @@ void FullCodeGenerator::EmitKeyedPropertyAssignment(Assignment* expr) {
// - a0 is the value,
// - a1 is the key,
// - a2 is the receiver.
- __ mov(a0, result_register());
- __ Pop(a2, a1); // a1 = key.
+ __ mov(KeyedStoreIC::ValueRegister(), result_register());
+ __ Pop(KeyedStoreIC::ReceiverRegister(), KeyedStoreIC::NameRegister());
+ ASSERT(KeyedStoreIC::ValueRegister().is(a0));
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
@@ -4387,9 +4389,10 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
}
break;
case NAMED_PROPERTY: {
- __ mov(a0, result_register()); // Value.
- __ li(a2, Operand(prop->key()->AsLiteral()->value())); // Name.
- __ pop(a1); // Receiver.
+ __ mov(StoreIC::ValueRegister(), result_register());
+ __ li(StoreIC::NameRegister(),
+ Operand(prop->key()->AsLiteral()->value()));
+ __ pop(StoreIC::ReceiverRegister());
CallStoreIC(expr->CountStoreFeedbackId());
PrepareForBailoutForId(expr->AssignmentId(), TOS_REG);
if (expr->is_postfix()) {
@@ -4402,8 +4405,8 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
break;
}
case KEYED_PROPERTY: {
- __ mov(a0, result_register()); // Value.
- __ Pop(a2, a1); // a1 = key, a2 = receiver.
+ __ mov(KeyedStoreIC::ValueRegister(), result_register());
+ __ Pop(KeyedStoreIC::ReceiverRegister(), KeyedStoreIC::NameRegister());
Handle<Code> ic = strict_mode() == SLOPPY
? isolate()->builtins()->KeyedStoreIC_Initialize()
: isolate()->builtins()->KeyedStoreIC_Initialize_Strict();
« no previous file with comments | « src/mips/debug-mips.cc ('k') | src/mips/ic-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698