Revision: 15051
Author:   [email protected]
Date:     Mon Jun 10 12:35:04 2013
Log:      Merged r15047, r15048, r15049 into trunk branch.

MIPS: add a default value for return value

MIPS: Fix LoadIC calling convention.

MIPS: Generator object "next" method takes optional send value.

BUG=v8:2355, v8:2715

[email protected]

Review URL: https://codereview.chromium.org/16703007
http://code.google.com/p/v8/source/detail?r=15051

Modified:
 /trunk/src/mips/full-codegen-mips.cc
 /trunk/src/mips/ic-mips.cc
 /trunk/src/mips/stub-cache-mips.cc
 /trunk/src/version.cc

=======================================
--- /trunk/src/mips/full-codegen-mips.cc        Sat Jun  8 07:05:11 2013
+++ /trunk/src/mips/full-codegen-mips.cc        Mon Jun 10 12:35:04 2013
@@ -2036,10 +2036,10 @@
       // [sp + 1 * kPointerSize] iter
       // [sp + 0 * kPointerSize] g

-      Label l_catch, l_try, l_resume, l_send, l_call, l_loop;
+      Label l_catch, l_try, l_resume, l_next, l_call, l_loop;
       // Initial send value is undefined.
       __ LoadRoot(a0, Heap::kUndefinedValueRootIndex);
-      __ Branch(&l_send);
+      __ Branch(&l_next);

// catch (e) { receiver = iter; f = iter.throw; arg = e; goto l_call; }
       __ bind(&l_catch);
@@ -2049,12 +2049,10 @@
       __ push(a3);                                       // iter
       __ push(a0);                                       // exception
       __ mov(a0, a3);                                    // iter
- __ push(a0); // push LoadIC state
       __ LoadRoot(a2, Heap::kthrow_stringRootIndex);     // "throw"
       Handle<Code> throw_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(throw_ic); // iter.throw in a0
       __ mov(a0, v0);
- __ Addu(sp, sp, Operand(kPointerSize)); // drop LoadIC state
       __ jmp(&l_call);

       // try { received = yield result.value }
@@ -2076,18 +2074,16 @@
       __ bind(&l_resume);                                // received in a0
       __ PopTryHandler();

-      // receiver = iter; f = iter.send; arg = received;
-      __ bind(&l_send);
+      // receiver = iter; f = iter.next; arg = received;
+      __ bind(&l_next);
       __ lw(a3, MemOperand(sp, 1 * kPointerSize));       // iter
       __ push(a3);                                       // iter
       __ push(a0);                                       // received
       __ mov(a0, a3);                                    // iter
- __ push(a0); // push LoadIC state
-      __ LoadRoot(a2, Heap::ksend_stringRootIndex);      // "send"
-      Handle<Code> send_ic = isolate()->builtins()->LoadIC_Initialize();
-      CallIC(send_ic);                                   // iter.send in a0
+      __ LoadRoot(a2, Heap::knext_stringRootIndex);      // "next"
+      Handle<Code> next_ic = isolate()->builtins()->LoadIC_Initialize();
+      CallIC(next_ic);                                   // iter.next in a0
       __ mov(a0, v0);
- __ Addu(sp, sp, Operand(kPointerSize)); // drop LoadIC state

       // result = f.call(receiver, arg);
       __ bind(&l_call);
@@ -2117,11 +2113,9 @@
       __ pop(a1);                                        // result
       __ push(a0);                                       // result.value
       __ mov(a0, a1);                                    // result
- __ push(a0); // push LoadIC state
       __ LoadRoot(a2, Heap::kdone_stringRootIndex);      // "done"
       Handle<Code> done_ic = isolate()->builtins()->LoadIC_Initialize();
CallIC(done_ic); // result.done in v0 - __ Addu(sp, sp, Operand(kPointerSize)); // drop LoadIC state
       __ mov(a0, v0);
       Handle<Code> bool_ic = ToBooleanStub::GetUninitialized(isolate());
       CallIC(bool_ic);
@@ -2193,7 +2187,7 @@

// If we are sending a value and there is no operand stack, we can jump back
   // in directly.
-  if (resume_mode == JSGeneratorObject::SEND) {
+  if (resume_mode == JSGeneratorObject::NEXT) {
     Label slow_resume;
     __ Branch(&slow_resume, ne, a3, Operand(zero_reg));
     __ lw(a3, FieldMemOperand(t0, JSFunction::kCodeEntryOffset));
=======================================
--- /trunk/src/mips/ic-mips.cc  Wed Jun  5 15:27:04 2013
+++ /trunk/src/mips/ic-mips.cc  Mon Jun 10 12:35:04 2013
@@ -651,7 +651,6 @@
   //  -- a2    : name
   //  -- ra    : return address
   //  -- a0    : receiver
-  //  -- sp[0] : receiver
   // -----------------------------------

   // Probe the stub cache.
@@ -671,7 +670,6 @@
   //  -- a2    : name
   //  -- lr    : return address
   //  -- a0    : receiver
-  //  -- sp[0] : receiver
   // -----------------------------------
   Label miss;

@@ -692,7 +690,6 @@
   //  -- a2    : name
   //  -- ra    : return address
   //  -- a0    : receiver
-  //  -- sp[0] : receiver
   // -----------------------------------
   Isolate* isolate = masm->isolate();

@@ -712,7 +709,6 @@
   //  -- a2    : name
   //  -- ra    : return address
   //  -- a0    : receiver
-  //  -- sp[0] : receiver
   // -----------------------------------

   __ mov(a3, a0);
=======================================
--- /trunk/src/mips/stub-cache-mips.cc  Mon Jun 10 08:11:22 2013
+++ /trunk/src/mips/stub-cache-mips.cc  Mon Jun 10 12:35:04 2013
@@ -883,11 +883,12 @@
   //  -- sp[4]              : callee JS function
   //  -- sp[8]              : call data
   //  -- sp[12]             : isolate
-  //  -- sp[16]             : ReturnValue
-  //  -- sp[20]             : last JS argument
+  //  -- sp[16]             : ReturnValue default value
+  //  -- sp[20]             : ReturnValue
+  //  -- sp[24]             : last JS argument
   //  -- ...
-  //  -- sp[(argc + 4) * 4] : first JS argument
-  //  -- sp[(argc + 5) * 4] : receiver
+  //  -- sp[(argc + 5) * 4] : first JS argument
+  //  -- sp[(argc + 6) * 4] : receiver
   // -----------------------------------
   // Get the function and setup the context.
   Handle<JSFunction> function = optimization.constant_function();
@@ -905,15 +906,16 @@
   }

   __ li(t3, Operand(ExternalReference::isolate_address(masm->isolate())));
-  // Store JS function, call data, isolate and ReturnValue.
+ // Store JS function, call data, isolate ReturnValue default and ReturnValue.
   __ sw(t1, MemOperand(sp, 1 * kPointerSize));
   __ sw(t2, MemOperand(sp, 2 * kPointerSize));
   __ sw(t3, MemOperand(sp, 3 * kPointerSize));
   __ LoadRoot(t1, Heap::kUndefinedValueRootIndex);
   __ sw(t1, MemOperand(sp, 4 * kPointerSize));
+  __ sw(t1, MemOperand(sp, 5 * kPointerSize));

   // Prepare arguments.
-  __ Addu(a2, sp, Operand(4 * kPointerSize));
+  __ Addu(a2, sp, Operand(5 * kPointerSize));

   // Allocate the v8::Arguments structure in the arguments' space since
   // it's not controlled by GC.
@@ -1435,13 +1437,14 @@
   } else {
     __ li(scratch3(), Handle<Object>(callback->data(), isolate()));
   }
-  __ Subu(sp, sp, 5 * kPointerSize);
-  __ sw(reg, MemOperand(sp, 4 * kPointerSize));
-  __ sw(scratch3(), MemOperand(sp, 3 * kPointerSize));
+  __ Subu(sp, sp, 6 * kPointerSize);
+  __ sw(reg, MemOperand(sp, 5 * kPointerSize));
+  __ sw(scratch3(), MemOperand(sp, 4 * kPointerSize));
   __ LoadRoot(scratch3(), Heap::kUndefinedValueRootIndex);
+  __ sw(scratch3(), MemOperand(sp, 3 * kPointerSize));
+  __ sw(scratch3(), MemOperand(sp, 2 * kPointerSize));
   __ li(scratch4(),
         Operand(ExternalReference::isolate_address(isolate())));
-  __ sw(scratch3(), MemOperand(sp, 2 * kPointerSize));
   __ sw(scratch4(), MemOperand(sp, 1 * kPointerSize));
   __ sw(name(), MemOperand(sp, 0 * kPointerSize));

@@ -1481,7 +1484,7 @@
   __ CallApiFunctionAndReturn(ref,
                               kStackUnwindSpace,
                               returns_handle,
-                              4);
+                              5);
 }


=======================================
--- /trunk/src/version.cc       Mon Jun 10 08:11:22 2013
+++ /trunk/src/version.cc       Mon Jun 10 12:35:04 2013
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     19
 #define BUILD_NUMBER      12
-#define PATCH_LEVEL       0
+#define PATCH_LEVEL       1
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0

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