Revision: 15594
Author:   [email protected]
Date:     Wed Jul 10 06:24:51 2013
Log: Insert HTrapAllocationMemento only when required for TransitionElementsKindStub.

[email protected]

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

Modified:
 /branches/bleeding_edge/src/code-stubs-hydrogen.cc

=======================================
--- /branches/bleeding_edge/src/code-stubs-hydrogen.cc Wed Jul 10 05:19:02 2013 +++ /branches/bleeding_edge/src/code-stubs-hydrogen.cc Wed Jul 10 06:24:51 2013
@@ -528,12 +528,18 @@

 template <>
 HValue* CodeStubGraphBuilder<TransitionElementsKindStub>::BuildCodeStub() {
+  TransitionElementsKindStub* stub = casted_stub();
+  ElementsKind from_kind = stub->from_kind();
+  ElementsKind to_kind = stub->to_kind();
+
   HValue* js_array = GetParameter(0);
   HValue* map = GetParameter(1);

   info()->MarkAsSavesCallerDoubles();

-  Add<HTrapAllocationMemento>(js_array);
+ if (AllocationSite::GetMode(from_kind, to_kind) == TRACK_ALLOCATION_SITE) {
+    Add<HTrapAllocationMemento>(js_array);
+  }

   HInstruction* array_length =
       AddLoad(js_array, HObjectAccess::ForArrayLength());
@@ -550,9 +556,7 @@

   HInstruction* elements_length = AddLoadFixedArrayLength(elements);

-  BuildGrowElementsCapacity(js_array, elements,
-                            casted_stub()->from_kind(),
-                            casted_stub()->to_kind(),
+  BuildGrowElementsCapacity(js_array, elements, from_kind, to_kind,
                             array_length, elements_length);

   if_builder.End();

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