Mercurial > hg > truffle
changeset 108:a761c2d3b76a
6684385: Loop unswitching crashes without LoopNode
Summary: Without LoopNode, exit early from loop unswitching and partial peeling
Reviewed-by: kvn, never, sgoldman
author | rasbold |
---|---|
date | Wed, 09 Apr 2008 09:25:45 -0700 |
parents | 93b6525e3b82 |
children | 9f4457a14b58 |
files | src/share/vm/opto/loopUnswitch.cpp src/share/vm/opto/loopopts.cpp |
diffstat | 2 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/vm/opto/loopUnswitch.cpp Tue Apr 08 12:23:15 2008 -0400 +++ b/src/share/vm/opto/loopUnswitch.cpp Wed Apr 09 09:25:45 2008 -0700 @@ -51,6 +51,9 @@ if( !LoopUnswitching ) { return false; } + if (!_head->is_Loop()) { + return false; + } uint nodes_left = MaxNodeLimit - phase->C->unique(); if (2 * _body.size() > nodes_left) { return false; // Too speculative if running low on nodes.
--- a/src/share/vm/opto/loopopts.cpp Tue Apr 08 12:23:15 2008 -0400 +++ b/src/share/vm/opto/loopopts.cpp Wed Apr 09 09:25:45 2008 -0700 @@ -2257,6 +2257,9 @@ // bool PhaseIdealLoop::partial_peel( IdealLoopTree *loop, Node_List &old_new ) { + if (!loop->_head->is_Loop()) { + return false; } + LoopNode *head = loop->_head->as_Loop(); if (head->is_partial_peel_loop() || head->partial_peel_has_failed()) {