Reviewers: danno,
Message:
As discussed.
Description:
Fix optimistic BCE to back off after deopt
BUG=v8:3176
LOG=n
Please review this at https://codereview.chromium.org/177523002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+30, -1 lines):
M src/hydrogen-bce.cc
A test/mjsunit/regress/regress-3176.js
Index: src/hydrogen-bce.cc
diff --git a/src/hydrogen-bce.cc b/src/hydrogen-bce.cc
index
2514f7d259de8d63095bc416b5219762f8cca145..e1a28471273f75274a85056b2c78ff06dba8cf10
100644
--- a/src/hydrogen-bce.cc
+++ b/src/hydrogen-bce.cc
@@ -375,7 +375,8 @@ BoundsCheckBbData*
HBoundsCheckEliminationPhase::PreProcessBlock(
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();
Index: test/mjsunit/regress/regress-3176.js
diff --git a/test/mjsunit/regress/regress-3176.js
b/test/mjsunit/regress/regress-3176.js
new file mode 100644
index
0000000000000000000000000000000000000000..e2563c0d3aad14101db34d53103a5da740f1e0a3
--- /dev/null
+++ b/test/mjsunit/regress/regress-3176.js
@@ -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);
--
--
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.