Revision: 14667
Author:   [email protected]
Date:     Tue May 14 08:59:37 2013
Log:      Avoid loading "iter" twice.
http://code.google.com/p/v8/source/detail?r=14667

Modified:
 /branches/bleeding_edge/src/arm/full-codegen-arm.cc
 /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc
 /branches/bleeding_edge/src/x64/full-codegen-x64.cc

=======================================
--- /branches/bleeding_edge/src/arm/full-codegen-arm.cc Tue May 14 08:59:25 2013 +++ /branches/bleeding_edge/src/arm/full-codegen-arm.cc Tue May 14 08:59:37 2013
@@ -1973,13 +1973,13 @@
       __ 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 @@
       __ 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();
=======================================
--- /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Tue May 14 08:59:25 2013 +++ /branches/bleeding_edge/src/ia32/full-codegen-ia32.cc Tue May 14 08:59:37 2013
@@ -1934,12 +1934,12 @@
       __ 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 @@

       // 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 @@
       __ 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);
=======================================
--- /branches/bleeding_edge/src/x64/full-codegen-x64.cc Tue May 14 08:59:25 2013 +++ /branches/bleeding_edge/src/x64/full-codegen-x64.cc Tue May 14 08:59:37 2013
@@ -1958,12 +1958,13 @@
       __ 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 @@

       // 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

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to