Skip to content

Commit

Permalink
8345154: IGV: Show Parse and Assertion Predicate type as extra label
Browse files Browse the repository at this point in the history
  • Loading branch information
chhagedorn committed Nov 28, 2024
1 parent b9c6ce9 commit 1f53b32
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/share/opto/ifnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2213,10 +2213,10 @@ void ParsePredicateNode::dump_spec(outputStream* st) const {
st->print("Loop ");
break;
case Deoptimization::DeoptReason::Reason_profile_predicate:
st->print("Profiled_Loop ");
st->print("Profiled Loop ");
break;
case Deoptimization::DeoptReason::Reason_loop_limit_check:
st->print("Loop_Limit_Check ");
st->print("Loop Limit Check ");
break;
default:
fatal("unknown kind");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,27 @@ editProperty(matches("name", "CallLeafDirect|CallLeafDirectVector|CallLeafNoFPDi
// Show pre/main/post at CountedLoopNodes.
editProperty(hasProperty("loop_kind"), ["loop_kind"], "extra_label",
function(loop_kind) { return loop_kind[0]; });

// Show Parse Predicate type.
function parsePredicateInfo(dump_spec) {
// It's easier to match with ".*" because type "Loop" can also be found in type "Loop Limit Check" and "Profiled Loop".
// Matching with ".*" also requires us to exclude the optional "#useless" string at the end.
var predicateMatch = /#(.*)(#useless)?/.exec(dump_spec);
if (predicateMatch != null) {
return predicateMatch[1].trim();
}
return null;
}
editProperty(matches("name", "ParsePredicate"), ["dump_spec"], "extra_label",
function(dump_spec) { return parsePredicateInfo(dump_spec[0]);});

// Show Assertion Predicate type.
function assertionPredicateInfo(dump_spec) {
var predicateMatch = /#((Init|Last) Value Assertion Predicate)/.exec(dump_spec);
if (predicateMatch != null) {
return predicateMatch[1];
}
return null;
}
editProperty(matches("name", "If|RangeCheck"), ["dump_spec"], "extra_label",
function(dump_spec) { return assertionPredicateInfo(dump_spec[0]);});

0 comments on commit 1f53b32

Please sign in to comment.