Reviewers: Toon Verwaest,

Message:
Hi Toon, here is the code we discussed. Thx for spotting :)
--Michael

Description:
A bug in AllocationSite::GetMode(from, to) meant that we didn't update
boilerplates for SMI to SMI_HOLEY transitions.

BUG=

Please review this at https://codereview.chromium.org/18917003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/objects-inl.h
  M test/mjsunit/allocation-site-info.js


Index: src/objects-inl.h
diff --git a/src/objects-inl.h b/src/objects-inl.h
index f25112939cada014a807e9c7c35d2d61d8230a75..ae96c24c7283c61d76aee2d0b2256deac933c5b5 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -1335,7 +1335,8 @@ AllocationSiteMode AllocationSite::GetMode(ElementsKind from,
                                            ElementsKind to) {
   if (FLAG_track_allocation_sites &&
       IsFastSmiElementsKind(from) &&
-      (IsFastObjectElementsKind(to) || IsFastDoubleElementsKind(to))) {
+      IsFastElementsKind(to) &&
+      from != to) {
     return TRACK_ALLOCATION_SITE;
   }

Index: test/mjsunit/allocation-site-info.js
diff --git a/test/mjsunit/allocation-site-info.js b/test/mjsunit/allocation-site-info.js index 72df772b0c11986940ec61b0f6e17ca5c0d951f7..b8b1076ff9f11450f18f6821c4514b63df9a5d6c 100644
--- a/test/mjsunit/allocation-site-info.js
+++ b/test/mjsunit/allocation-site-info.js
@@ -175,6 +175,20 @@ if (support_smi_only_arrays) {
   obj = fastliteralcase_smifast(2);
   assertKind(elements_kind.fast, obj);

+  // Case: make sure transitions from packed to holey are tracked
+  function fastliteralcase_smiholey(index, value) {
+    var literal = [1, 2, 3, 4];
+    literal[index] = value;
+    return literal;
+  }
+
+  obj = fastliteralcase_smiholey(5, 1);
+  assertKind(elements_kind.fast_smi_only, obj);
+  assertHoley(obj);
+  obj = fastliteralcase_smiholey(0, 1);
+  assertKind(elements_kind.fast_smi_only, obj);
+  assertHoley(obj);
+
   function newarraycase_smidouble(value) {
     var a = new Array();
     a[0] = value;


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