Skip to content
Permalink
Browse files

8241595: Fix missing debug_orig information in Ideal Graph Visualizer

Show missing debug_orig information for nodes in Ideal Graph Visualizer.

Reviewed-by: kvn, neliasso
  • Loading branch information
Christian Hagedorn
Christian Hagedorn committed Mar 26, 2020
1 parent d882d52 commit 307b376a9bf42ea93ba91b3347a0f19387716338
@@ -584,12 +584,8 @@ void IdealGraphPrinter::visit_node(Node *n, bool edges, VectorSet* temp_set) {

#ifdef ASSERT
if (node->debug_orig() != NULL) {
temp_set->clear();
stringStream dorigStream;
Node* dorig = node->debug_orig();
while (dorig && temp_set->test_set(dorig->_idx)) {
dorigStream.print("%d ", dorig->_idx);
}
node->dump_orig(&dorigStream, false);
print_prop("debug_orig", dorigStream.as_string());
}
#endif
@@ -1624,12 +1624,15 @@ static bool is_disconnected(const Node* n) {
}

#ifdef ASSERT
static void dump_orig(Node* orig, outputStream *st) {
void Node::dump_orig(outputStream *st, bool print_key) const {
Compile* C = Compile::current();
Node* orig = _debug_orig;
if (NotANode(orig)) orig = NULL;
if (orig != NULL && !C->node_arena()->contains(orig)) orig = NULL;
if (orig == NULL) return;
st->print(" !orig=");
if (print_key) {
st->print(" !orig=");
}
Node* fast = orig->debug_orig(); // tortoise & hare algorithm to detect loops
if (NotANode(fast)) fast = NULL;
while (orig != NULL) {
@@ -1694,7 +1697,7 @@ void Node::dump(const char* suffix, bool mark, outputStream *st) const {
if (is_disconnected(this)) {
#ifdef ASSERT
st->print(" [%d]",debug_idx());
dump_orig(debug_orig(), st);
dump_orig(st);
#endif
st->cr();
C->_in_dump_cnt--;
@@ -1742,7 +1745,7 @@ void Node::dump(const char* suffix, bool mark, outputStream *st) const {
t->dump_on(st);
}
if (is_new) {
debug_only(dump_orig(debug_orig(), st));
DEBUG_ONLY(dump_orig(st));
Node_Notes* nn = C->node_notes_at(_idx);
if (nn != NULL && !nn->is_clear()) {
if (nn->jvms() != NULL) {
@@ -1181,6 +1181,7 @@ class Node {
Node* _debug_orig; // Original version of this, if any.
Node* debug_orig() const { return _debug_orig; }
void set_debug_orig(Node* orig); // _debug_orig = orig
void dump_orig(outputStream *st, bool print_key = true) const;

int _hash_lock; // Barrier to modifications of nodes in the hash table
void enter_hash_lock() { ++_hash_lock; assert(_hash_lock < 99, "in too many hash tables?"); }

0 comments on commit 307b376

Please sign in to comment.