Revision: 21665
Author:   [email protected]
Date:     Wed Jun  4 08:21:39 2014 UTC
Log:      Fix invalid loop condition for Array.lastIndexOf().

BUG=380512
LOG=y
[email protected]

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

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

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-380512.js Wed Jun 4 08:21:39 2014 UTC
@@ -0,0 +1,12 @@
+// 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 f() { [].lastIndexOf(42); }
+
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+f();
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Tue Jun  3 08:12:43 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Wed Jun  4 08:21:39 2014 UTC
@@ -8385,7 +8385,7 @@
     ASSERT_EQ(kLastIndexOf, mode);
     initial = length;
     terminating = graph()->GetConstant0();
-    token = Token::GTE;
+    token = Token::GT;
     direction = LoopBuilder::kPreDecrement;
   }

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