Reviewers: danno,

Message:
PTAL.

This is based on http://codereview.chromium.org/8354003/, basically extends that
CL to loads which turned out to be really easy.

Description:
ElementsKind transitioning support for keyed loads in Crankshaft


Please review this at http://codereview.chromium.org/8352012/

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

Affected files:
  M src/hydrogen.cc


Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 8a35ed61b6295f60df7214b75a3d9490a6507ea1..0b843bd45b32eb6d57c1efa86ee784c59290c817 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -4096,33 +4096,30 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,

   // Elements_kind transition support.
   MapList transition_target(maps->length());
-  if (is_store) {
-    // Collect possible transition targets.
-    MapList possible_transitioned_maps(maps->length());
-    for (int i = 0; i < maps->length(); ++i) {
-      Handle<Map> map = maps->at(i);
-      ElementsKind elements_kind = map->elements_kind();
-      if (elements_kind == FAST_DOUBLE_ELEMENTS ||
-          elements_kind == FAST_ELEMENTS) {
-        possible_transitioned_maps.Add(*map);
-      }
-    }
-    // Get transition target for each map (NULL == no transition).
-    for (int i = 0; i < maps->length(); ++i) {
-      Handle<Map> map = maps->at(i);
-      Map* transitioned_map =
-          map->FindTransitionedMap(&possible_transitioned_maps);
-      transition_target.Add(transitioned_map);
+  // Collect possible transition targets.
+  MapList possible_transitioned_maps(maps->length());
+  for (int i = 0; i < maps->length(); ++i) {
+    Handle<Map> map = maps->at(i);
+    ElementsKind elements_kind = map->elements_kind();
+    if (elements_kind == FAST_DOUBLE_ELEMENTS ||
+        elements_kind == FAST_ELEMENTS) {
+      possible_transitioned_maps.Add(*map);
     }
   }
+  // Get transition target for each map (NULL == no transition).
+  for (int i = 0; i < maps->length(); ++i) {
+    Handle<Map> map = maps->at(i);
+    Map* transitioned_map =
+        map->FindTransitionedMap(&possible_transitioned_maps);
+    transition_target.Add(transitioned_map);
+  }

   int num_untransitionable_maps = 0;
   Handle<Map> untransitionable_map;
   for (int i = 0; i < maps->length(); ++i) {
     Handle<Map> map = maps->at(i);
     ASSERT(map->IsMap());
-    ASSERT(!is_store || (transition_target.length() == maps->length()));
-    if (is_store && transition_target.at(i) != NULL) {
+    if (transition_target.at(i) != NULL) {
       object = AddInstruction(new(zone()) HTransitionElementsKind(
           object, map, Handle<Map>(transition_target.at(i))));
     } else {


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

Reply via email to