Revision: 21401
Author:   [email protected]
Date:     Wed May 21 08:51:29 2014 UTC
Log:      Fix ArrayShift hydrogen support

BUG=chromium:374838
LOG=y
[email protected]

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

Added:
 /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-374838.js
Modified:
 /branches/bleeding_edge/src/hydrogen-instructions.h
 /branches/bleeding_edge/src/hydrogen.cc

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-374838.js Wed May 21 08:51:29 2014 UTC
@@ -0,0 +1,20 @@
+// Copyright 2014 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+function foo() {
+  var a = [0];
+  result = 0;
+  for (var i = 0; i < 4; i++) {
+    result += a.length;
+    a.shift();
+  }
+  return result;
+}
+
+assertEquals(1, foo());
+assertEquals(1, foo());
+%OptimizeFunctionOnNextCall(foo);
+assertEquals(1, foo());
=======================================
--- /branches/bleeding_edge/src/hydrogen-instructions.h Tue May 20 13:03:25 2014 UTC +++ /branches/bleeding_edge/src/hydrogen-instructions.h Wed May 21 08:51:29 2014 UTC
@@ -7123,6 +7123,7 @@
       : kind_(kind) {
     SetOperandAt(0, context);
     SetOperandAt(1, object);
+    SetChangesFlag(kArrayLengths);
     SetChangesFlag(kNewSpacePromotion);
     set_representation(Representation::Tagged());
     if (IsFastSmiOrObjectElementsKind(kind)) {
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Tue May 20 17:12:18 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Wed May 21 08:51:29 2014 UTC
@@ -7927,10 +7927,6 @@
       return true;
     }
     case kArrayShift: {
-      // Something in here seems to be causing crbug.com/374838.
-      // TODO(bmeurer): Investigate the problem and re-enable this code.
-      return false;
-
       if (receiver_map.is_null()) return false;
       if (receiver_map->instance_type() != JS_ARRAY_TYPE) return false;
       ElementsKind kind = receiver_map->elements_kind();

--
--
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/d/optout.

Reply via email to