aboutsummaryrefslogtreecommitdiff
path: root/src/share/vm/opto/parse2.cpp
diff options
context:
space:
mode:
authorrasbold <none@none>2008-07-21 13:37:05 -0700
committerrasbold <none@none>2008-07-21 13:37:05 -0700
commit10ceb292a81808efe8344f7fab2faa78f4575d9b (patch)
tree8ffae54eb9dbc0b9ae8059781b8d201ea31a1e8c /src/share/vm/opto/parse2.cpp
parent52e5443b66f3a0ce4886b9c2b14b046cd6d7695a (diff)
downloadjdk8u_hotspot-10ceb292a81808efe8344f7fab2faa78f4575d9b.tar.gz
6726504: handle do_ifxxx calls in parser more uniformly
Summary: make do_ifnull() handling similar to do_if() Reviewed-by: jrose, kvn
Diffstat (limited to 'src/share/vm/opto/parse2.cpp')
-rw-r--r--src/share/vm/opto/parse2.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/share/vm/opto/parse2.cpp b/src/share/vm/opto/parse2.cpp
index e244d6a09..a71c7726a 100644
--- a/src/share/vm/opto/parse2.cpp
+++ b/src/share/vm/opto/parse2.cpp
@@ -894,7 +894,7 @@ inline void Parse::repush_if_args() {
}
//----------------------------------do_ifnull----------------------------------
-void Parse::do_ifnull(BoolTest::mask btest) {
+void Parse::do_ifnull(BoolTest::mask btest, Node *c) {
int target_bci = iter().get_dest();
Block* branch_block = successor_for_bci(target_bci);
@@ -906,8 +906,9 @@ void Parse::do_ifnull(BoolTest::mask btest) {
// (An earlier version of do_ifnull omitted this trap for OSR methods.)
#ifndef PRODUCT
if (PrintOpto && Verbose)
- tty->print_cr("Never-taken backedge stops compilation at bci %d",bci());
+ tty->print_cr("Never-taken edge stops compilation at bci %d",bci());
#endif
+ repush_if_args(); // to gather stats on loop
// We need to mark this branch as taken so that if we recompile we will
// see that it is possible. In the tiered system the interpreter doesn't
// do profiling and by the time we get to the lower tier from the interpreter
@@ -928,14 +929,6 @@ void Parse::do_ifnull(BoolTest::mask btest) {
maybe_add_safepoint(target_bci);
explicit_null_checks_inserted++;
- Node* a = null();
- Node* b = pop();
- Node* c = _gvn.transform( new (C, 3) CmpPNode(b, a) );
-
- // Make a cast-away-nullness that is control dependent on the test
- const Type *t = _gvn.type(b);
- const Type *t_not_null = t->join(TypePtr::NOTNULL);
- Node *cast = new (C, 2) CastPPNode(b,t_not_null);
// Generate real control flow
Node *tst = _gvn.transform( new (C, 2) BoolNode( c, btest ) );
@@ -997,7 +990,7 @@ void Parse::do_if(BoolTest::mask btest, Node* c) {
if (prob == PROB_UNKNOWN) {
#ifndef PRODUCT
if (PrintOpto && Verbose)
- tty->print_cr("Never-taken backedge stops compilation at bci %d",bci());
+ tty->print_cr("Never-taken edge stops compilation at bci %d",bci());
#endif
repush_if_args(); // to gather stats on loop
// We need to mark this branch as taken so that if we recompile we will
@@ -1016,6 +1009,9 @@ void Parse::do_if(BoolTest::mask btest, Node* c) {
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");
@@ -2101,18 +2097,18 @@ void Parse::do_one_bytecode() {
break;
}
- case Bytecodes::_ifnull:
- do_ifnull(BoolTest::eq);
- break;
- case Bytecodes::_ifnonnull:
- do_ifnull(BoolTest::ne);
+ case Bytecodes::_ifnull: btest = BoolTest::eq; goto handle_if_null;
+ case Bytecodes::_ifnonnull: btest = BoolTest::ne; goto handle_if_null;
+ handle_if_null:
+ a = null();
+ b = pop();
+ c = _gvn.transform( new (C, 3) CmpPNode(b, a) );
+ do_ifnull(btest, c);
break;
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) );
@@ -2126,8 +2122,6 @@ void Parse::do_one_bytecode() {
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) );
@@ -2141,8 +2135,6 @@ void Parse::do_one_bytecode() {
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 ) );