Skip to content

Commit 20c93b3

Browse files
committed
8261914: IfNode::fold_compares_helper faces non-canonicalized bool when running JRuby JSON workload
Reviewed-by: kvn, shade
1 parent ddd550a commit 20c93b3

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/hotspot/share/opto/ifnode.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -884,8 +884,6 @@ bool IfNode::fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* f
884884
hi_type->_hi == max_jint && lo_type->_lo == min_jint && lo_test != BoolTest::ne) {
885885
assert((dom_bool->_test.is_less() && !proj->_con) ||
886886
(dom_bool->_test.is_greater() && proj->_con), "incorrect test");
887-
// this test was canonicalized
888-
assert(this_bool->_test.is_less() && fail->_con, "incorrect test");
889887

890888
// this_bool = <
891889
// dom_bool = >= (proj = True) or dom_bool = < (proj = False)
@@ -922,9 +920,11 @@ bool IfNode::fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* f
922920
return false;
923921
}
924922
} else {
925-
assert(false, "unhandled hi_test: %d", hi_test);
923+
assert(igvn->_worklist.member(in(1)) && in(1)->Value(igvn) != igvn->type(in(1)), "unhandled hi_test: %d", hi_test);
926924
return false;
927925
}
926+
// this test was canonicalized
927+
assert(this_bool->_test.is_less() && fail->_con, "incorrect test");
928928
} else if (lo_type != NULL && hi_type != NULL && lo_type->_lo > hi_type->_hi &&
929929
lo_type->_hi == max_jint && hi_type->_lo == min_jint && lo_test != BoolTest::ne) {
930930

@@ -951,8 +951,6 @@ bool IfNode::fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* f
951951

952952
assert((dom_bool->_test.is_less() && proj->_con) ||
953953
(dom_bool->_test.is_greater() && !proj->_con), "incorrect test");
954-
// this test was canonicalized
955-
assert(this_bool->_test.is_less() && !fail->_con, "incorrect test");
956954

957955
cond = (hi_test == BoolTest::le || hi_test == BoolTest::gt) ? BoolTest::gt : BoolTest::ge;
958956

@@ -980,9 +978,11 @@ bool IfNode::fold_compares_helper(ProjNode* proj, ProjNode* success, ProjNode* f
980978
return false;
981979
}
982980
} else {
983-
assert(false, "unhandled lo_test: %d", lo_test);
981+
assert(igvn->_worklist.member(in(1)) && in(1)->Value(igvn) != igvn->type(in(1)), "unhandled lo_test: %d", lo_test);
984982
return false;
985983
}
984+
// this test was canonicalized
985+
assert(this_bool->_test.is_less() && !fail->_con, "incorrect test");
986986
} else {
987987
const TypeInt* failtype = filtered_int_type(igvn, n, proj);
988988
if (failtype != NULL) {

0 commit comments

Comments
 (0)