Skip to content

Commit

Permalink
8283775: better dump: VM support for graph querying in debugger with …
Browse files Browse the repository at this point in the history
…BFS traversal and node filtering

Reviewed-by: kvn, chagedorn, thartmann, rcastanedalo
  • Loading branch information
eme64 committed Jun 13, 2022
1 parent ac28be7 commit 33ed036
Show file tree
Hide file tree
Showing 4 changed files with 746 additions and 32 deletions.
41 changes: 28 additions & 13 deletions src/hotspot/share/opto/callnode.cpp
Expand Up @@ -192,13 +192,18 @@ uint ReturnNode::match_edge(uint idx) const {


#ifndef PRODUCT
void ReturnNode::dump_req(outputStream *st) const {
// Dump the required inputs, enclosed in '(' and ')'
void ReturnNode::dump_req(outputStream *st, DumpConfig* dc) const {
// Dump the required inputs, after printing "returns"
uint i; // Exit value of loop
for (i = 0; i < req(); i++) { // For all required inputs
if (i == TypeFunc::Parms) st->print("returns");
if (in(i)) st->print("%c%d ", Compile::current()->node_arena()->contains(in(i)) ? ' ' : 'o', in(i)->_idx);
else st->print("_ ");
if (i == TypeFunc::Parms) st->print("returns ");
Node* p = in(i);
if (p != nullptr) {
p->dump_idx(false, st, dc);
st->print(" ");
} else {
st->print("_ ");
}
}
}
#endif
Expand Down Expand Up @@ -235,13 +240,18 @@ uint RethrowNode::match_edge(uint idx) const {
}

#ifndef PRODUCT
void RethrowNode::dump_req(outputStream *st) const {
// Dump the required inputs, enclosed in '(' and ')'
void RethrowNode::dump_req(outputStream *st, DumpConfig* dc) const {
// Dump the required inputs, after printing "exception"
uint i; // Exit value of loop
for (i = 0; i < req(); i++) { // For all required inputs
if (i == TypeFunc::Parms) st->print("exception");
if (in(i)) st->print("%c%d ", Compile::current()->node_arena()->contains(in(i)) ? ' ' : 'o', in(i)->_idx);
else st->print("_ ");
if (i == TypeFunc::Parms) st->print("exception ");
Node* p = in(i);
if (p != nullptr) {
p->dump_idx(false, st, dc);
st->print(" ");
} else {
st->print("_ ");
}
}
}
#endif
Expand Down Expand Up @@ -689,13 +699,18 @@ int JVMState::interpreter_frame_size() const {
bool CallNode::cmp( const Node &n ) const
{ return _tf == ((CallNode&)n)._tf && _jvms == ((CallNode&)n)._jvms; }
#ifndef PRODUCT
void CallNode::dump_req(outputStream *st) const {
void CallNode::dump_req(outputStream *st, DumpConfig* dc) const {
// Dump the required inputs, enclosed in '(' and ')'
uint i; // Exit value of loop
for (i = 0; i < req(); i++) { // For all required inputs
if (i == TypeFunc::Parms) st->print("(");
if (in(i)) st->print("%c%d ", Compile::current()->node_arena()->contains(in(i)) ? ' ' : 'o', in(i)->_idx);
else st->print("_ ");
Node* p = in(i);
if (p != nullptr) {
p->dump_idx(false, st, dc);
st->print(" ");
} else {
st->print("_ ");
}
}
st->print(")");
}
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/opto/callnode.hpp
Expand Up @@ -127,7 +127,7 @@ class ReturnNode : public Node {
virtual uint ideal_reg() const { return NotAMachineReg; }
virtual uint match_edge(uint idx) const;
#ifndef PRODUCT
virtual void dump_req(outputStream *st = tty) const;
virtual void dump_req(outputStream *st = tty, DumpConfig* dc = nullptr) const;
#endif
};

Expand All @@ -148,7 +148,7 @@ class RethrowNode : public Node {
virtual uint match_edge(uint idx) const;
virtual uint ideal_reg() const { return NotAMachineReg; }
#ifndef PRODUCT
virtual void dump_req(outputStream *st = tty) const;
virtual void dump_req(outputStream *st = tty, DumpConfig* dc = nullptr) const;
#endif
};

Expand Down Expand Up @@ -655,7 +655,7 @@ class CallNode : public SafePointNode {
virtual void copy_call_debug_info(PhaseIterGVN* phase, SafePointNode* sfpt) {}

#ifndef PRODUCT
virtual void dump_req(outputStream* st = tty) const;
virtual void dump_req(outputStream* st = tty, DumpConfig* dc = nullptr) const;
virtual void dump_spec(outputStream* st) const;
#endif
};
Expand Down

1 comment on commit 33ed036

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.