8077504: Unsafe load can loose control dependency and cause crash

Node::depends_only_on_test() should return false for Unsafe loads

Reviewed-by: kvn, adinn
This commit is contained in:
Roland Westrelin 2015-05-21 13:54:07 +02:00
parent 9f6b61b959
commit a3c77df5f1
13 changed files with 228 additions and 67 deletions

View file

@ -437,7 +437,13 @@ class Invariance : public StackObj {
}
}
if (all_inputs_invariant) {
_invariant.set(n->_idx); // I am a invariant too
// If n's control is a predicate that was moved out of the
// loop, it was marked invariant but n is only invariant if
// it depends only on that test. Otherwise, unless that test
// is out of the loop, it's not invariant.
if (n->is_CFG() || n->depends_only_on_test() || n->in(0) == NULL || !_phase->is_member(_lpt, n->in(0))) {
_invariant.set(n->_idx); // I am a invariant too
}
}
} else { // process next input
_stack.set_index(idx + 1);