Revision: 10327
Author:   [email protected]
Date:     Wed Jan  4 01:40:47 2012
Log: MIPS: Undo allocation of half-formed array during elements transition

Port r10320 (bb429e82)

BUG=
TEST=

Review URL: http://codereview.chromium.org/9082001
Patch from Gergely Kis <[email protected]>.
http://code.google.com/p/v8/source/detail?r=10327

Modified:
 /branches/bleeding_edge/src/mips/builtins-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/builtins-mips.cc Wed Jan 4 01:39:35 2012 +++ /branches/bleeding_edge/src/mips/builtins-mips.cc Wed Jan 4 01:40:47 2012
@@ -324,7 +324,8 @@
 static void ArrayNativeCode(MacroAssembler* masm,
                             Label* call_generic_code) {
   Counters* counters = masm->isolate()->counters();
-  Label argc_one_or_more, argc_two_or_more, not_empty_array, empty_array;
+  Label argc_one_or_more, argc_two_or_more, not_empty_array, empty_array,
+      has_non_smi_element;

   // Check for array construction with zero arguments or one.
   __ Branch(&argc_one_or_more, ne, a0, Operand(zero_reg));
@@ -422,7 +423,7 @@
   __ lw(a2, MemOperand(t3));
   __ Addu(t3, t3, kPointerSize);
   if (FLAG_smi_only_arrays) {
-    __ JumpIfNotSmi(a2, call_generic_code);
+    __ JumpIfNotSmi(a2, &has_non_smi_element);
   }
   __ Addu(t1, t1, -kPointerSize);
   __ sw(a2, MemOperand(t1));
@@ -438,6 +439,10 @@
   __ Addu(sp, sp, Operand(kPointerSize));
   __ mov(v0, a3);
   __ Ret();
+
+  __ bind(&has_non_smi_element);
+  __ UndoAllocationInNewSpace(a3, t0);
+  __ b(call_generic_code);
 }


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to