Revision: 15965
Author:   [email protected]
Date:     Tue Jul 30 15:28:54 2013
Log:      MIPS: Fix flaky mjsunit/harmony/generators-iteration test failure.

This fixes the result allocation in EmitCreateIteratorResult,
when a GC is required. The Runtime call returns the allocated
pointer in v0 register, but the rest of the function was
expected it in a0 register. Refactored the function to use v0 for
the result in the whole function.

BUG=

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

Modified:
 /branches/bleeding_edge/src/mips/full-codegen-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/full-codegen-mips.cc Sun Jul 21 22:50:10 2013 +++ /branches/bleeding_edge/src/mips/full-codegen-mips.cc Tue Jul 30 15:28:54 2013
@@ -2234,7 +2234,7 @@

   Handle<Map> map(isolate()->native_context()->generator_result_map());

-  __ Allocate(map->instance_size(), a0, a2, a3, &gc_required, TAG_OBJECT);
+  __ Allocate(map->instance_size(), v0, a2, a3, &gc_required, TAG_OBJECT);
   __ jmp(&allocated);

   __ bind(&gc_required);
@@ -2249,19 +2249,18 @@
   __ li(a3, Operand(isolate()->factory()->ToBoolean(done)));
   __ li(t0, Operand(isolate()->factory()->empty_fixed_array()));
   ASSERT_EQ(map->instance_size(), 5 * kPointerSize);
-  __ sw(a1, FieldMemOperand(a0, HeapObject::kMapOffset));
-  __ sw(t0, FieldMemOperand(a0, JSObject::kPropertiesOffset));
-  __ sw(t0, FieldMemOperand(a0, JSObject::kElementsOffset));
+  __ sw(a1, FieldMemOperand(v0, HeapObject::kMapOffset));
+  __ sw(t0, FieldMemOperand(v0, JSObject::kPropertiesOffset));
+  __ sw(t0, FieldMemOperand(v0, JSObject::kElementsOffset));
   __ sw(a2,
- FieldMemOperand(a0, JSGeneratorObject::kResultValuePropertyOffset)); + FieldMemOperand(v0, JSGeneratorObject::kResultValuePropertyOffset));
   __ sw(a3,
-        FieldMemOperand(a0, JSGeneratorObject::kResultDonePropertyOffset));
+        FieldMemOperand(v0, JSGeneratorObject::kResultDonePropertyOffset));

// Only the value field needs a write barrier, as the other values are in the
   // root set.
-  __ RecordWriteField(a0, JSGeneratorObject::kResultValuePropertyOffset,
+  __ RecordWriteField(v0, JSGeneratorObject::kResultValuePropertyOffset,
                       a2, a3, kRAHasBeenSaved, kDontSaveFPRegs);
-  __ mov(result_register(), a0);
 }


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