Revision: 23255
Author:   [email protected]
Date:     Thu Aug 21 06:23:44 2014 UTC
Log:      Don't inline Array.shift() if receiver map is not extensible.

TEST=mjsunit/regress/regress-crbug-405517
BUG=405517
LOG=y
[email protected]

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

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

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-405517.js Thu Aug 21 06:23:44 2014 UTC
@@ -0,0 +1,16 @@
+// 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 --gc-interval=203
+
+function f() {
+ var e = [0];
+ %PreventExtensions(e);
+ for (var i = 0; i < 4; i++) e.shift();
+}
+
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+f();
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Wed Aug 20 15:08:20 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Thu Aug 21 06:23:44 2014 UTC
@@ -8343,7 +8343,7 @@
       ElementsKind kind = receiver_map->elements_kind();
       if (!IsFastElementsKind(kind)) return false;
       if (receiver_map->is_observed()) return false;
-      DCHECK(receiver_map->is_extensible());
+      if (!receiver_map->is_extensible()) return false;

// If there may be elements accessors in the prototype chain, the fast
       // inlined version can't be used.

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