Revision: 19530
Author:   [email protected]
Date:     Mon Feb 24 13:15:31 2014 UTC
Log:      Fix optimistic BCE to back off after deopt

BUG=v8:3176
LOG=n
[email protected]

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

Added:
 /branches/bleeding_edge/test/mjsunit/regress/regress-3176.js
Modified:
 /branches/bleeding_edge/src/hydrogen-bce.cc

=======================================
--- /dev/null
+++ /branches/bleeding_edge/test/mjsunit/regress/regress-3176.js Mon Feb 24 13:15:31 2014 UTC
@@ -0,0 +1,28 @@
+// 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(a) {
+  var sum = 0;
+  for (var i = 0; i < 10; i++) {
+    sum += a[i];
+
+    if (i > 6) {
+      sum -= a[i - 4];
+      sum -= a[i - 5];
+    }
+  }
+  return sum;
+}
+
+var a = new Int32Array(10);
+
+foo(a);
+foo(a);
+%OptimizeFunctionOnNextCall(foo);
+foo(a);
+%OptimizeFunctionOnNextCall(foo);
+foo(a);
+assertOptimized(foo);
=======================================
--- /branches/bleeding_edge/src/hydrogen-bce.cc Wed Feb 19 12:30:10 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen-bce.cc Mon Feb 24 13:15:31 2014 UTC
@@ -375,7 +375,8 @@
       check->DeleteAndReplaceWith(check->ActualValue());
     } else if (data->BasicBlock() == bb) {
       data->CoverCheck(check, offset);
-    } else {
+    } else if (graph()->use_optimistic_licm() ||
+               bb->IsLoopSuccessorDominator()) {
       int32_t new_lower_offset = offset < data->LowerOffset()
           ? offset
           : data->LowerOffset();

--
--
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/groups/opt_out.

Reply via email to