Revision: 21727
Author:   [email protected]
Date:     Tue Jun 10 04:26:15 2014 UTC
Log:      Fix missing smi check in inlined indexOf/lastIndexOf.

BUG=382513
LOG=y
[email protected]

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

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

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-crbug-382513.js Tue Jun 10 04:26:15 2014 UTC
@@ -0,0 +1,11 @@
+// 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() { return [+0,false].indexOf(-(4/3)); }
+foo();
+foo();
+%OptimizeFunctionOnNextCall(foo);
+foo();
=======================================
--- /branches/bleeding_edge/src/hydrogen.cc     Fri Jun  6 13:33:27 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen.cc     Tue Jun 10 04:26:15 2014 UTC
@@ -8538,7 +8538,8 @@
               elements, index, static_cast<HValue*>(NULL),
               kind, ALLOW_RETURN_HOLE);
           IfBuilder if_issame(this);
-          HCompareMap* issame = if_issame.If<HCompareMap>(
+          if_issame.IfNot<HIsSmiAndBranch>(element);
+          HCompareMap* issame = if_issame.AndIf<HCompareMap>(
               element, isolate()->factory()->heap_number_map());
           if_issame.And();
           HValue* number = Add<HLoadNamedField>(

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