Revision: 19341
Author: [email protected]
Date: Wed Feb 12 18:30:41 2014 UTC
Log: Don't propagate information through phis in loop headers.
To properly do this, we'd have to iterate over CompareMaps (and their
bodies) handling phis, until we have learned enough to decide which paths
can be taken. For now, just disable learning from phis in loop headers.
BUG=
[email protected]
Review URL: https://codereview.chromium.org/147023005
http://code.google.com/p/v8/source/detail?r=19341
Added:
/branches/bleeding_edge/test/mjsunit/regress/regress-check-eliminate-loop-phis.js
Modified:
/branches/bleeding_edge/src/hydrogen-check-elimination.cc
=======================================
--- /dev/null
+++
/branches/bleeding_edge/test/mjsunit/regress/regress-check-eliminate-loop-phis.js
Wed Feb 12 18:30:41 2014 UTC
@@ -0,0 +1,21 @@
+// 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() {
+ var o = {x:1};
+ var y = {y:2.5, x:0};
+ var result;
+ for (var i = 0; i < 2; i++) {
+ result = o.x + 3;
+ o = y;
+ }
+ return result;
+}
+
+f();
+f();
+%OptimizeFunctionOnNextCall(f);
+assertEquals(3, f());
=======================================
--- /branches/bleeding_edge/src/hydrogen-check-elimination.cc Wed Feb 12
15:38:42 2014 UTC
+++ /branches/bleeding_edge/src/hydrogen-check-elimination.cc Wed Feb 12
18:30:41 2014 UTC
@@ -164,7 +164,7 @@
copy->size_ = size_;
// Create entries for succ block's phis.
- if (succ->phis()->length() > 0) {
+ if (!succ->IsLoopHeader() && succ->phis()->length() > 0) {
int pred_index = succ->PredecessorIndexOf(from_block);
for (int phi_index = 0;
phi_index < succ->phis()->length();
--
--
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.