Commit 19b86954 authored by wingo@igalia.com's avatar wingo@igalia.com

Avoid loading "iter" twice.

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14667 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 25c1d78e
......@@ -1973,13 +1973,13 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ LoadRoot(r0, Heap::kUndefinedValueRootIndex);
__ b(&l_send);
// catch (e) { receiver = iter; f = iter.throw; arg = e; }
// catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; }
__ bind(&l_catch);
handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
__ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
__ push(r3); // iter
__ push(r0); // exception
__ ldr(r0, MemOperand(sp, 3 * kPointerSize)); // iter
__ mov(r0, r3); // iter
__ push(r0); // push LoadIC state
__ LoadRoot(r2, Heap::kthrow_stringRootIndex); // "throw"
Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize();
......@@ -2009,7 +2009,7 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ ldr(r3, MemOperand(sp, 1 * kPointerSize)); // iter
__ push(r3); // iter
__ push(r0); // received
__ ldr(r0, MemOperand(sp, 3 * kPointerSize)); // iter
__ mov(r0, r3); // iter
__ push(r0); // push LoadIC state
__ LoadRoot(r2, Heap::ksend_stringRootIndex); // "send"
Handle<Code> send_ic = isolate()->builtins()->LoadIC_Initialize();
......
......@@ -1934,12 +1934,12 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ mov(eax, isolate()->factory()->undefined_value());
__ jmp(&l_send);
// catch (e) { receiver = iter; f = iter.throw; arg = e; }
// catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; }
__ bind(&l_catch);
handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
__ push(Operand(esp, 1 * kPointerSize)); // iter
__ mov(edx, Operand(esp, 1 * kPointerSize)); // iter
__ push(edx); // iter
__ push(eax); // exception
__ mov(edx, Operand(esp, 3 * kPointerSize)); // iter
__ mov(ecx, isolate()->factory()->throw_string()); // "throw"
Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(throw_ic); // iter.throw in eax
......@@ -1963,12 +1963,12 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
// receiver = iter; f = iter.send; arg = received;
__ bind(&l_send);
__ push(Operand(esp, 1 * kPointerSize)); // iter
__ mov(edx, Operand(esp, 1 * kPointerSize)); // iter
__ push(edx); // iter
__ push(eax); // received
__ mov(edx, Operand(esp, 3 * kPointerSize)); // iter
__ mov(ecx, isolate()->factory()->send_string()); // "send"
Handle<Code> send_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(send_ic); // iter.send in rax
CallIC(send_ic); // iter.send in eax
// result = f.call(receiver, arg);
__ bind(&l_call);
......@@ -1993,13 +1993,13 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ mov(edx, eax); // result
__ mov(ecx, isolate()->factory()->value_string()); // "value"
Handle<Code> value_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(value_ic); // result.value in rax
CallIC(value_ic); // result.value in eax
__ pop(ebx); // result
__ push(eax); // result.value
__ mov(edx, ebx); // result
__ mov(ecx, isolate()->factory()->done_string()); // "done"
Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(done_ic); // result.done in rax
CallIC(done_ic); // result.done in eax
ToBooleanStub stub(eax);
__ push(eax);
__ CallStub(&stub);
......
......@@ -1958,12 +1958,13 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
__ LoadRoot(rax, Heap::kUndefinedValueRootIndex);
__ jmp(&l_send);
// catch (e) { receiver = iter; f = iter.throw; arg = e; }
// catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; }
__ bind(&l_catch);
handler_table()->set(expr->index(), Smi::FromInt(l_catch.pos()));
__ push(Operand(rsp, 1 * kPointerSize)); // iter
__ movq(rcx, Operand(rsp, 1 * kPointerSize)); // iter
__ push(rcx); // iter
__ push(rax); // exception
__ movq(rax, Operand(rsp, 3 * kPointerSize)); // iter
__ movq(rax, rcx); // iter
__ LoadRoot(rcx, Heap::kthrow_stringRootIndex); // "throw"
Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(throw_ic); // iter.throw in rax
......@@ -1987,9 +1988,10 @@ void FullCodeGenerator::VisitYield(Yield* expr) {
// receiver = iter; f = iter.send; arg = received;
__ bind(&l_send);
__ push(Operand(rsp, 1 * kPointerSize)); // iter
__ movq(rcx, Operand(rsp, 1 * kPointerSize)); // iter
__ push(rcx); // iter
__ push(rax); // received
__ movq(rax, Operand(rsp, 3 * kPointerSize)); // iter
__ movq(rax, rcx); // iter
__ LoadRoot(rcx, Heap::ksend_stringRootIndex); // "send"
Handle<Code> send_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(send_ic); // iter.send in rax
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment