Mercurial > hg > truffle
diff src/share/vm/opto/cfgnode.cpp @ 126:72f4a668df19
6625997: CastPP, CheckCastPP and Proj nodes are not dead loop safe
Summary: EA and initialization optimizations could bypass these nodes.
Reviewed-by: rasbold, never
author | kvn |
---|---|
date | Wed, 23 Apr 2008 19:09:16 -0700 |
parents | ba764ed4b6f2 |
children | e0bd2e08e3d0 |
line wrap: on
line diff
--- a/src/share/vm/opto/cfgnode.cpp Wed Apr 23 13:57:14 2008 -0700 +++ b/src/share/vm/opto/cfgnode.cpp Wed Apr 23 19:09:16 2008 -0700 @@ -1419,7 +1419,8 @@ // Check inputs of phi's inputs also. // It is much less expensive then full graph walk. uint cnt = in->req(); - for (uint i = 1; i < cnt; ++i) { + uint i = (in->is_Proj() && !in->is_CFG()) ? 0 : 1; + for (; i < cnt; ++i) { Node* m = in->in(i); if (m == (Node*)this) return UnsafeLoop; // Unsafe loop @@ -1467,7 +1468,8 @@ while (nstack.size() != 0) { Node* n = nstack.pop(); uint cnt = n->req(); - for (uint i = 1; i < cnt; i++) { // Only data paths + uint i = (n->is_Proj() && !n->is_CFG()) ? 0 : 1; + for (; i < cnt; i++) { Node* m = n->in(i); if (m == (Node*)this) { return true; // Data loop