Index: src/arm/full-codegen-arm.cc |
diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc |
index 1f9273bc8171f6572de8fa2c1d52a64546de2d4e..c3100c027027113bc5337bd8792c8289eb105e51 100644 |
--- a/src/arm/full-codegen-arm.cc |
+++ b/src/arm/full-codegen-arm.cc |
@@ -1857,9 +1857,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
break; |
case NAMED_PROPERTY: |
if (expr->is_compound()) { |
- // We need the receiver both on the stack and in the accumulator. |
- VisitForAccumulatorValue(property->obj()); |
- __ push(result_register()); |
+ // We need the receiver both on the stack and in the register. |
+ VisitForStackValue(property->obj()); |
+ __ ldr(LoadIC::ReceiverRegister(), MemOperand(sp, 0)); |
} else { |
VisitForStackValue(property->obj()); |
} |
@@ -1867,9 +1867,9 @@ void FullCodeGenerator::VisitAssignment(Assignment* expr) { |
case KEYED_PROPERTY: |
if (expr->is_compound()) { |
VisitForStackValue(property->obj()); |
- VisitForAccumulatorValue(property->key()); |
- __ ldr(r1, MemOperand(sp, 0)); |
- __ push(r0); |
+ VisitForStackValue(property->key()); |
+ __ ldr(LoadIC::ReceiverRegister(), MemOperand(sp, 1 * kPointerSize)); |
+ __ ldr(LoadIC::NameRegister(), MemOperand(sp, 0)); |
} else { |
VisitForStackValue(property->obj()); |
VisitForStackValue(property->key()); |
@@ -2008,6 +2008,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. |
__ LoadRoot(r0, Heap::kUndefinedValueRootIndex); |
__ b(&l_next); |
@@ -2015,9 +2018,9 @@ 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())); |
- __ LoadRoot(r2, Heap::kthrow_stringRootIndex); // "throw" |
- __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter |
- __ Push(r2, r3, r0); // "throw", iter, except |
+ __ LoadRoot(load_name, Heap::kthrow_stringRootIndex); // "throw" |
+ __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter |
+ __ Push(load_name, r3, r0); // "throw", iter, except |
__ jmp(&l_call); |
// try { received = %yield result } |
@@ -2051,19 +2054,15 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
// receiver = iter; f = 'next'; arg = received; |
__ bind(&l_next); |
- Register keyedload_receiver = KeyedLoadIC::ReceiverRegister(); |
- Register keyedload_name = KeyedLoadIC::NameRegister(); |
- ASSERT(keyedload_receiver.is(r1)); |
- ASSERT(keyedload_name.is(r0)); |
- __ LoadRoot(r2, Heap::knext_stringRootIndex); // "next" |
- __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter |
- __ Push(r2, r3, r0); // "next", iter, received |
+ __ LoadRoot(load_name, Heap::knext_stringRootIndex); // "next" |
+ __ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter |
+ __ Push(load_name, r3, r0); // "next", iter, received |
// result = receiver[f](arg); |
__ bind(&l_call); |
- __ ldr(keyedload_receiver, MemOperand(sp, kPointerSize)); |
- __ ldr(keyedload_name, MemOperand(sp, 2 * kPointerSize)); |
+ __ ldr(load_receiver, MemOperand(sp, kPointerSize)); |
+ __ ldr(load_name, MemOperand(sp, 2 * kPointerSize)); |
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
CallIC(ic, TypeFeedbackId::None()); |
__ mov(r1, r0); |
@@ -2076,10 +2075,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
// if (!result.done) goto l_try; |
__ bind(&l_loop); |
- Register load_receiver = LoadIC::ReceiverRegister(); |
- Register load_name = LoadIC::NameRegister(); |
- ASSERT(load_receiver.is(r0)); |
- ASSERT(load_name.is(r2)); |
+ __ Move(load_receiver, r0); |
__ push(load_receiver); // save result |
__ LoadRoot(load_name, Heap::kdone_stringRootIndex); // "done" |
@@ -2563,15 +2559,15 @@ void FullCodeGenerator::VisitProperty(Property* expr) { |
if (key->IsPropertyName()) { |
VisitForAccumulatorValue(expr->obj()); |
- ASSERT(r0.is(LoadIC::ReceiverRegister())); |
+ __ Move(LoadIC::ReceiverRegister(), r0); |
EmitNamedPropertyLoad(expr); |
PrepareForBailoutForId(expr->LoadId(), TOS_REG); |
context()->Plug(r0); |
} else { |
VisitForStackValue(expr->obj()); |
VisitForAccumulatorValue(expr->key()); |
- ASSERT(r0.is(KeyedLoadIC::NameRegister())); |
- __ pop(KeyedLoadIC::ReceiverRegister()); |
+ __ Move(LoadIC::NameRegister(), r0); |
+ __ pop(LoadIC::ReceiverRegister()); |
EmitKeyedPropertyLoad(expr); |
context()->Plug(r0); |
} |
@@ -2626,13 +2622,13 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, |
Expression* key) { |
// Load the key. |
VisitForAccumulatorValue(key); |
- ASSERT(r0.is(KeyedLoadIC::NameRegister())); |
Expression* callee = expr->expression(); |
// Load the function from the receiver. |
ASSERT(callee->IsProperty()); |
- __ ldr(KeyedLoadIC::ReceiverRegister(), MemOperand(sp, 0)); |
+ __ ldr(LoadIC::ReceiverRegister(), MemOperand(sp, 0)); |
+ __ Move(LoadIC::NameRegister(), r0); |
EmitKeyedPropertyLoad(callee->AsProperty()); |
PrepareForBailoutForId(callee->AsProperty()->LoadId(), TOS_REG); |
@@ -4045,12 +4041,12 @@ void FullCodeGenerator::VisitCallRuntime(CallRuntime* expr) { |
if (expr->is_jsruntime()) { |
// Push the builtins object as the receiver. |
- __ ldr(r0, GlobalObjectOperand()); |
- __ ldr(r0, FieldMemOperand(r0, GlobalObject::kBuiltinsOffset)); |
- __ push(r0); |
+ Register receiver = LoadIC::ReceiverRegister(); |
+ __ ldr(receiver, GlobalObjectOperand()); |
+ __ ldr(receiver, FieldMemOperand(receiver, GlobalObject::kBuiltinsOffset)); |
+ __ push(receiver); |
// Load the function from the receiver. |
- ASSERT(r0.is(LoadIC::ReceiverRegister())); |
__ mov(LoadIC::NameRegister(), Operand(expr->name())); |
CallLoadIC(NOT_CONTEXTUAL, expr->CallRuntimeFeedbackId()); |
@@ -4228,17 +4224,15 @@ void FullCodeGenerator::VisitCountOperation(CountOperation* expr) { |
__ push(ip); |
} |
if (assign_type == NAMED_PROPERTY) { |
- // Put the object both on the stack and in the accumulator. |
- VisitForAccumulatorValue(prop->obj()); |
- ASSERT(r0.is(LoadIC::ReceiverRegister())); |
- __ push(LoadIC::ReceiverRegister()); |
+ // Put the object both on the stack and in the register. |
+ VisitForStackValue(prop->obj()); |
+ __ ldr(LoadIC::ReceiverRegister(), MemOperand(sp, 0)); |
EmitNamedPropertyLoad(prop); |
} else { |
VisitForStackValue(prop->obj()); |
- VisitForAccumulatorValue(prop->key()); |
- ASSERT(r0.is(KeyedLoadIC::NameRegister())); |
- __ ldr(KeyedLoadIC::ReceiverRegister(), MemOperand(sp, 0)); |
- __ push(KeyedLoadIC::NameRegister()); |
+ VisitForStackValue(prop->key()); |
+ __ ldr(LoadIC::ReceiverRegister(), MemOperand(sp, 1 * kPointerSize)); |
+ __ ldr(LoadIC::NameRegister(), MemOperand(sp, 0)); |
EmitKeyedPropertyLoad(prop); |
} |
} |