6730192: expression stack wrong at deoptimization point
Summary: add safepoint before popping expression stack, not after
Reviewed-by: kvn
--- a/hotspot/src/share/vm/opto/parse2.cpp Mon Jul 28 17:12:52 2008 -0700
+++ b/hotspot/src/share/vm/opto/parse2.cpp Tue Jul 29 14:48:25 2008 -0700
@@ -925,9 +925,6 @@
return;
}
- // If this is a backwards branch in the bytecodes, add Safepoint
- maybe_add_safepoint(target_bci);
-
explicit_null_checks_inserted++;
// Generate real control flow
@@ -1009,9 +1006,6 @@
return;
}
- // If this is a backwards branch in the bytecodes, add Safepoint
- maybe_add_safepoint(target_bci);
-
// Sanity check the probability value
assert(0.0f < prob && prob < 1.0f,"Bad probability in Parser");
@@ -2100,6 +2094,8 @@
case Bytecodes::_ifnull: btest = BoolTest::eq; goto handle_if_null;
case Bytecodes::_ifnonnull: btest = BoolTest::ne; goto handle_if_null;
handle_if_null:
+ // If this is a backwards branch in the bytecodes, add Safepoint
+ maybe_add_safepoint(iter().get_dest());
a = null();
b = pop();
c = _gvn.transform( new (C, 3) CmpPNode(b, a) );
@@ -2109,6 +2105,8 @@
case Bytecodes::_if_acmpeq: btest = BoolTest::eq; goto handle_if_acmp;
case Bytecodes::_if_acmpne: btest = BoolTest::ne; goto handle_if_acmp;
handle_if_acmp:
+ // If this is a backwards branch in the bytecodes, add Safepoint
+ maybe_add_safepoint(iter().get_dest());
a = pop();
b = pop();
c = _gvn.transform( new (C, 3) CmpPNode(b, a) );
@@ -2122,6 +2120,8 @@
case Bytecodes::_ifgt: btest = BoolTest::gt; goto handle_ifxx;
case Bytecodes::_ifge: btest = BoolTest::ge; goto handle_ifxx;
handle_ifxx:
+ // If this is a backwards branch in the bytecodes, add Safepoint
+ maybe_add_safepoint(iter().get_dest());
a = _gvn.intcon(0);
b = pop();
c = _gvn.transform( new (C, 3) CmpINode(b, a) );
@@ -2135,6 +2135,8 @@
case Bytecodes::_if_icmpgt: btest = BoolTest::gt; goto handle_if_icmp;
case Bytecodes::_if_icmpge: btest = BoolTest::ge; goto handle_if_icmp;
handle_if_icmp:
+ // If this is a backwards branch in the bytecodes, add Safepoint
+ maybe_add_safepoint(iter().get_dest());
a = pop();
b = pop();
c = _gvn.transform( new (C, 3) CmpINode( b, a ) );