Skip to content

Commit 6d87856

Browse files
committed
8256325: Remove duplicate asserts in PhaseMacroExpand::expand_macro_nodes
Reviewed-by: shade, redestad
1 parent 5dbfae0 commit 6d87856

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/hotspot/share/opto/macro.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,7 +2564,7 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
25642564
for (int i = C->macro_count(); i > 0; i--) {
25652565
Node * n = C->macro_node(i-1);
25662566
bool success = false;
2567-
debug_only(int old_macro_count = C->macro_count(););
2567+
DEBUG_ONLY(int old_macro_count = C->macro_count();)
25682568
if (n->is_AbstractLock()) {
25692569
success = eliminate_locking_node(n->as_AbstractLock());
25702570
}
@@ -2580,7 +2580,7 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
25802580
for (int i = C->macro_count(); i > 0; i--) {
25812581
Node * n = C->macro_node(i-1);
25822582
bool success = false;
2583-
debug_only(int old_macro_count = C->macro_count(););
2583+
DEBUG_ONLY(int old_macro_count = C->macro_count();)
25842584
switch (n->class_id()) {
25852585
case Node::Class_Allocate:
25862586
case Node::Class_AllocateArray:
@@ -2628,7 +2628,7 @@ bool PhaseMacroExpand::expand_macro_nodes() {
26282628
for (int i = C->macro_count(); i > 0; i--) {
26292629
Node* n = C->macro_node(i-1);
26302630
bool success = false;
2631-
debug_only(int old_macro_count = C->macro_count(););
2631+
DEBUG_ONLY(int old_macro_count = C->macro_count();)
26322632
if (n->Opcode() == Op_LoopLimit) {
26332633
// Remove it from macro list and put on IGVN worklist to optimize.
26342634
C->remove_macro_node(n);
@@ -2714,28 +2714,24 @@ bool PhaseMacroExpand::expand_macro_nodes() {
27142714
return true;
27152715
}
27162716

2717-
debug_only(int old_macro_count = C->macro_count(););
2717+
DEBUG_ONLY(int old_macro_count = C->macro_count();)
27182718
switch (n->class_id()) {
27192719
case Node::Class_Lock:
27202720
expand_lock_node(n->as_Lock());
2721-
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
27222721
break;
27232722
case Node::Class_Unlock:
27242723
expand_unlock_node(n->as_Unlock());
2725-
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
27262724
break;
27272725
case Node::Class_ArrayCopy:
27282726
expand_arraycopy_node(n->as_ArrayCopy());
2729-
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
27302727
break;
27312728
case Node::Class_SubTypeCheck:
27322729
expand_subtypecheck_node(n->as_SubTypeCheck());
2733-
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
27342730
break;
27352731
default:
27362732
assert(false, "unknown node type in macro list");
27372733
}
2738-
assert(C->macro_count() < macro_count, "must have deleted a node from macro list");
2734+
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
27392735
if (C->failing()) return true;
27402736

27412737
// Clean up the graph so we're less likely to hit the maximum node

0 commit comments

Comments
 (0)