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

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

Issue 338963003: KeyedLoadIC should have same register spec as LoadIC. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Last comment response. Created 6 years, 6 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/ia32/debug-ia32.cc ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index 31066f0849c57793c6bd25a2c97dadc680644a29..88da9f0b30c5fa5b5fdf6a3210945e2b677825fc 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -1811,9 +1811,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
break;
case NAMED_PROPERTY:
if (expr->is_compound()) {
- // We need the receiver both on the stack and in edx.
+ // We need the receiver both on the stack and in the register.
VisitForStackValue(property->obj());
- __ mov(edx, Operand(esp, 0));
+ __ mov(LoadIC::ReceiverRegister(), Operand(esp, 0));
} else {
VisitForStackValue(property->obj());
}
@@ -1822,8 +1822,8 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) {
if (expr->is_compound()) {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
- __ mov(edx, Operand(esp, kPointerSize)); // Object.
- __ mov(ecx, Operand(esp, 0)); // Key.
+ __ mov(LoadIC::ReceiverRegister(), Operand(esp, kPointerSize));
+ __ mov(LoadIC::NameRegister(), Operand(esp, 0));
} else {
VisitForStackValue(property->obj());
VisitForStackValue(property->key());
@@ -1964,6 +1964,9 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
Label l_catch, l_try, l_suspend, l_continuation, l_resume;
Label l_next, l_call, l_loop;
+ Register load_receiver = LoadIC::ReceiverRegister();
+ Register load_name = LoadIC::NameRegister();
+
// Initial send value is undefined.
__ mov(eax, isolate()->factory()->undefined_value());
__ jmp(&l_next);
@@ -1971,10 +1974,10 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
// catch (e) { receiver = iter; f = 'throw'; arg = e; goto l_call; }
__ bind(&l_catch);
handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
- __ mov(ecx, isolate()->factory()->throw_string()); // "throw"
- __ push(ecx); // "throw"
- __ push(Operand(esp, 2 * kPointerSize)); // iter
- __ push(eax); // exception
+ __ mov(load_name, isolate()->factory()->throw_string()); // "throw"
+ __ push(load_name); // "throw"
+ __ push(Operand(esp, 2 * kPointerSize)); // iter
+ __ push(eax); // exception
__ jmp(&l_call);
// try { received = %yield result }
@@ -2009,20 +2012,15 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
// receiver = iter; f = iter.next; arg = received;
__ bind(&l_next);
- Register keyedload_receiver = KeyedLoadIC::ReceiverRegister();
- Register keyedload_name = KeyedLoadIC::NameRegister();
- ASSERT(keyedload_receiver.is(edx));
- ASSERT(keyedload_name.is(ecx));
- __ mov(keyedload_name,
- isolate()->factory()->next_string()); // "next"
- __ push(keyedload_name);
- __ push(Operand(esp, 2 * kPointerSize)); // iter
- __ push(eax); // received
+ __ mov(load_name, isolate()->factory()->next_string());
+ __ push(load_name); // "next"
+ __ push(Operand(esp, 2 * kPointerSize)); // iter
+ __ push(eax); // received
// result = receiver[f](arg);
__ bind(&l_call);
- __ mov(keyedload_receiver, Operand(esp, kPointerSize));
+ __ mov(load_receiver, Operand(esp, kPointerSize));
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize();
CallIC(ic, TypeFeedbackId::None());
__ mov(edi, eax);
@@ -2036,11 +2034,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
// if (!result.done) goto l_try;
__ bind(&l_loop);
__ push(eax); // save result
- Register load_receiver = LoadIC::ReceiverRegister();
- Register load_name = LoadIC::NameRegister();
- ASSERT(load_receiver.is(edx));
- ASSERT(load_name.is(ecx));
- __ mov(load_receiver, eax); // result
+ __ Move(load_receiver, eax); // result
__ mov(load_name,
isolate()->factory()->done_string()); // "done"
CallLoadIC(NOT_CONTEXTUAL); // result.done in eax
@@ -2510,15 +2504,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) {
if (key->IsPropertyName()) {
VisitForAccumulatorValue(expr->obj());
- __ mov(LoadIC::ReceiverRegister(), result_register());
+ __ Move(LoadIC::ReceiverRegister(), result_register());
EmitNamedPropertyLoad(expr);
PrepareForBailoutForId(expr->LoadId(), TOS_REG);
context()->Plug(eax);
} else {
VisitForStackValue(expr->obj());
VisitForAccumulatorValue(expr->key());
- __ pop(KeyedLoadIC::ReceiverRegister()); // Object.
- __ mov(KeyedLoadIC::NameRegister(), result_register()); // Key.
+ __ pop(LoadIC::ReceiverRegister()); // Object.
+ __ Move(LoadIC::NameRegister(), result_register()); // Key.
EmitKeyedPropertyLoad(expr);
context()->Plug(eax);
}
@@ -2573,9 +2567,8 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr,
// Load the function from the receiver.
ASSERT(callee->IsProperty());
- __ mov(KeyedLoadIC::ReceiverRegister(), Operand(esp, 0));
- // Move the key into the right register for the keyed load IC.
- __ mov(KeyedLoadIC::NameRegister(), eax);
+ __ mov(LoadIC::ReceiverRegister(), Operand(esp, 0));
+ __ mov(LoadIC::NameRegister(), eax);
EmitKeyedPropertyLoad(callee->AsProperty());
PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG);
@@ -4215,18 +4208,16 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) {
__ push(Immediate(Smi::FromInt(0)));
}
if (assign_type == NAMED_PROPERTY) {
- // Put the object both on the stack and in edx.
- VisitForAccumulatorValue(prop->obj());
- ASSERT(!eax.is(LoadIC::ReceiverRegister()));
- __ push(eax);
- __ mov(LoadIC::ReceiverRegister(), eax);
+ // Put the object both on the stack and in the register.
+ VisitForStackValue(prop->obj());
+ __ mov(LoadIC::ReceiverRegister(), Operand(esp, 0));
EmitNamedPropertyLoad(prop);
} else {
VisitForStackValue(prop->obj());
VisitForStackValue(prop->key());
- __ mov(KeyedLoadIC::ReceiverRegister(),
- Operand(esp, kPointerSize)); // Object.
- __ mov(KeyedLoadIC::NameRegister(), Operand(esp, 0)); // Key.
+ __ mov(LoadIC::ReceiverRegister(),
+ Operand(esp, kPointerSize)); // Object.
+ __ mov(LoadIC::NameRegister(), Operand(esp, 0)); // Key.
EmitKeyedPropertyLoad(prop);
}
}
« no previous file with comments | « src/ia32/debug-ia32.cc ('k') | src/ia32/ic-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698