8256325: Remove duplicate asserts in PhaseMacroExpand::expand_macro_nodes

Reviewed-by: shade, redestad
This commit is contained in:
Tobias Hartmann 2020-11-17 09:37:36 +00:00
parent 5dbfae0176
commit 6d878565f8

@ -2564,7 +2564,7 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
for (int i = C->macro_count(); i > 0; i--) {
Node * n = C->macro_node(i-1);
bool success = false;
debug_only(int old_macro_count = C->macro_count(););
DEBUG_ONLY(int old_macro_count = C->macro_count();)
if (n->is_AbstractLock()) {
success = eliminate_locking_node(n->as_AbstractLock());
}
@ -2580,7 +2580,7 @@ void PhaseMacroExpand::eliminate_macro_nodes() {
for (int i = C->macro_count(); i > 0; i--) {
Node * n = C->macro_node(i-1);
bool success = false;
debug_only(int old_macro_count = C->macro_count(););
DEBUG_ONLY(int old_macro_count = C->macro_count();)
switch (n->class_id()) {
case Node::Class_Allocate:
case Node::Class_AllocateArray:
@ -2628,7 +2628,7 @@ bool PhaseMacroExpand::expand_macro_nodes() {
for (int i = C->macro_count(); i > 0; i--) {
Node* n = C->macro_node(i-1);
bool success = false;
debug_only(int old_macro_count = C->macro_count(););
DEBUG_ONLY(int old_macro_count = C->macro_count();)
if (n->Opcode() == Op_LoopLimit) {
// Remove it from macro list and put on IGVN worklist to optimize.
C->remove_macro_node(n);
@ -2714,28 +2714,24 @@ bool PhaseMacroExpand::expand_macro_nodes() {
return true;
}
debug_only(int old_macro_count = C->macro_count(););
DEBUG_ONLY(int old_macro_count = C->macro_count();)
switch (n->class_id()) {
case Node::Class_Lock:
expand_lock_node(n->as_Lock());
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
break;
case Node::Class_Unlock:
expand_unlock_node(n->as_Unlock());
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
break;
case Node::Class_ArrayCopy:
expand_arraycopy_node(n->as_ArrayCopy());
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
break;
case Node::Class_SubTypeCheck:
expand_subtypecheck_node(n->as_SubTypeCheck());
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
break;
default:
assert(false, "unknown node type in macro list");
}
assert(C->macro_count() < macro_count, "must have deleted a node from macro list");
assert(C->macro_count() == (old_macro_count - 1), "expansion must have deleted one node from macro list");
if (C->failing()) return true;
// Clean up the graph so we're less likely to hit the maximum node