Revision: 17759
Author:   [email protected]
Date:     Thu Nov 14 18:44:05 2013 UTC
Log:      MIPS: Inline zero argument array constructor.

Port r17741 (fe14ef8)

Original commit message:
patch from issue 54583003 (dependent code).

Zero arguments - very easy

1 argument - three special cases:
a) If length is a constant in valid array length range,
no need to check it at runtime.
b) respect DoNotInline feedback on the AllocationSite for
cases that the argument is not a smi or is an integer
with a length that should create a dictionary.
c) if kind feedback is non-holey, and length is non-constant,
we'd have to generate a lot of code to be correct.
Don't inline this case.

N arguments - one special case:
a) If a deopt ever occurs because an input argument isn't
compatible with the elements kind, then set the
DoNotInline flag.

BUG=
[email protected]

Review URL: https://codereview.chromium.org/72893003

Patch from Balazs Kilvady <[email protected]>.
http://code.google.com/p/v8/source/detail?r=17759

Modified:
 /branches/bleeding_edge/src/mips/code-stubs-mips.cc
 /branches/bleeding_edge/src/mips/stub-cache-mips.cc

=======================================
--- /branches/bleeding_edge/src/mips/code-stubs-mips.cc Wed Nov 13 18:23:42 2013 UTC +++ /branches/bleeding_edge/src/mips/code-stubs-mips.cc Thu Nov 14 18:44:05 2013 UTC
@@ -6005,11 +6005,14 @@
       __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset));
     }

-    // Save the resulting elements kind in type info
-    __ SmiTag(a3);
-    __ lw(t1, FieldMemOperand(a2, Cell::kValueOffset));
-    __ sw(a3, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset));
-    __ SmiUntag(a3);
+ // Save the resulting elements kind in type info. We can't just store a3 + // in the AllocationSite::transition_info field because elements kind is + // restricted to a portion of the field...upper bits need to be left alone.
+    STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
+    __ lw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset));
+    __ Addu(t0, t0, Operand(Smi::FromInt(kFastElementsKindPackedToHoley)));
+    __ sw(t0, FieldMemOperand(t1, AllocationSite::kTransitionInfoOffset));
+

     __ bind(&normal_sequence);
     int last_index = GetSequenceIndexFromFastElementsKind(
@@ -6151,6 +6154,8 @@

   __ lw(a3, FieldMemOperand(a3, AllocationSite::kTransitionInfoOffset));
   __ SmiUntag(a3);
+  STATIC_ASSERT(AllocationSite::ElementsKindBits::kShift == 0);
+  __ And(a3, a3, Operand(AllocationSite::ElementsKindBits::kMask));
   GenerateDispatchToArrayStub(masm, DONT_OVERRIDE);

   __ bind(&no_info);
=======================================
--- /branches/bleeding_edge/src/mips/stub-cache-mips.cc Thu Nov 7 20:11:18 2013 UTC +++ /branches/bleeding_edge/src/mips/stub-cache-mips.cc Thu Nov 14 18:44:05 2013 UTC
@@ -1673,7 +1673,7 @@
   }

   Handle<AllocationSite> site = isolate()->factory()->NewAllocationSite();
-  site->set_transition_info(Smi::FromInt(GetInitialFastElementsKind()));
+  site->SetElementsKind(GetInitialFastElementsKind());
   Handle<Cell> site_feedback_cell = isolate()->factory()->NewCell(site);
   __ li(a0, Operand(argc));
   __ li(a2, Operand(site_feedback_cell));

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