Skip to content

Commit dbb2c4b

Browse files
committed
8288897: Clean up node dump code
Reviewed-by: chagedorn, xliu
1 parent 9833c02 commit dbb2c4b

18 files changed

+129
-630
lines changed

src/hotspot/share/opto/c2_globals.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,6 @@
117117
notproduct(bool, PrintIdeal, false, \
118118
"Print ideal graph before code generation") \
119119
\
120-
notproduct(uintx, PrintIdealIndentThreshold, 0, \
121-
"A depth threshold of ideal graph. Indentation is disabled " \
122-
"when users attempt to dump an ideal graph deeper than it.") \
123-
\
124120
notproduct(bool, PrintOpto, false, \
125121
"Print compiler2 attempts") \
126122
\

src/hotspot/share/opto/callnode.cpp

-30
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ void ParmNode::dump_compact_spec(outputStream *st) const {
138138
bottom_type()->dump_on(st);
139139
}
140140
}
141-
142-
// For a ParmNode, all immediate inputs and outputs are considered relevant
143-
// both in compact and standard representation.
144-
void ParmNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
145-
this->collect_nodes(in_rel, 1, false, false);
146-
this->collect_nodes(out_rel, -1, false, false);
147-
}
148141
#endif
149142

150143
uint ParmNode::ideal_reg() const {
@@ -1373,19 +1366,6 @@ void SafePointNode::dump_spec(outputStream *st) const {
13731366
st->print(" SafePoint ");
13741367
_replaced_nodes.dump(st);
13751368
}
1376-
1377-
// The related nodes of a SafepointNode are all data inputs, excluding the
1378-
// control boundary, as well as all outputs till level 2 (to include projection
1379-
// nodes and targets). In compact mode, just include inputs till level 1 and
1380-
// outputs as before.
1381-
void SafePointNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
1382-
if (compact) {
1383-
this->collect_nodes(in_rel, 1, false, false);
1384-
} else {
1385-
this->collect_nodes_in_all_data(in_rel, false);
1386-
}
1387-
this->collect_nodes(out_rel, -2, false, false);
1388-
}
13891369
#endif
13901370

13911371
const RegMask &SafePointNode::in_RegMask(uint idx) const {
@@ -2005,16 +1985,6 @@ void AbstractLockNode::dump_spec(outputStream* st) const {
20051985
void AbstractLockNode::dump_compact_spec(outputStream* st) const {
20061986
st->print("%s", _kind_names[_kind]);
20071987
}
2008-
2009-
// The related set of lock nodes includes the control boundary.
2010-
void AbstractLockNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
2011-
if (compact) {
2012-
this->collect_nodes(in_rel, 1, false, false);
2013-
} else {
2014-
this->collect_nodes_in_all_data(in_rel, true);
2015-
}
2016-
this->collect_nodes(out_rel, -2, false, false);
2017-
}
20181988
#endif
20191989

20201990
//=============================================================================

src/hotspot/share/opto/callnode.hpp

-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ class ParmNode : public ProjNode {
108108
#ifndef PRODUCT
109109
virtual void dump_spec(outputStream *st) const;
110110
virtual void dump_compact_spec(outputStream *st) const;
111-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
112111
#endif
113112
};
114113

@@ -500,7 +499,6 @@ class SafePointNode : public MultiNode {
500499

501500
#ifndef PRODUCT
502501
virtual void dump_spec(outputStream *st) const;
503-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
504502
#endif
505503
};
506504

@@ -1080,7 +1078,6 @@ class AbstractLockNode: public CallNode {
10801078
NamedCounter* counter() const { return _counter; }
10811079
virtual void dump_spec(outputStream* st) const;
10821080
virtual void dump_compact_spec(outputStream* st) const;
1083-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
10841081
#endif
10851082
};
10861083

src/hotspot/share/opto/cfgnode.cpp

-36
Original file line numberDiff line numberDiff line change
@@ -2581,14 +2581,6 @@ const RegMask &PhiNode::out_RegMask() const {
25812581
}
25822582

25832583
#ifndef PRODUCT
2584-
void PhiNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
2585-
// For a PhiNode, the set of related nodes includes all inputs till level 2,
2586-
// and all outputs till level 1. In compact mode, inputs till level 1 are
2587-
// collected.
2588-
this->collect_nodes(in_rel, compact ? 1 : 2, false, false);
2589-
this->collect_nodes(out_rel, -1, false, false);
2590-
}
2591-
25922584
void PhiNode::dump_spec(outputStream *st) const {
25932585
TypeNode::dump_spec(st);
25942586
if (is_tripcount(T_INT) || is_tripcount(T_LONG)) {
@@ -2613,33 +2605,11 @@ const RegMask &GotoNode::out_RegMask() const {
26132605
return RegMask::Empty;
26142606
}
26152607

2616-
#ifndef PRODUCT
2617-
//-----------------------------related-----------------------------------------
2618-
// The related nodes of a GotoNode are all inputs at level 1, as well as the
2619-
// outputs at level 1. This is regardless of compact mode.
2620-
void GotoNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
2621-
this->collect_nodes(in_rel, 1, false, false);
2622-
this->collect_nodes(out_rel, -1, false, false);
2623-
}
2624-
#endif
2625-
2626-
26272608
//=============================================================================
26282609
const RegMask &JumpNode::out_RegMask() const {
26292610
return RegMask::Empty;
26302611
}
26312612

2632-
#ifndef PRODUCT
2633-
//-----------------------------related-----------------------------------------
2634-
// The related nodes of a JumpNode are all inputs at level 1, as well as the
2635-
// outputs at level 2 (to include actual jump targets beyond projection nodes).
2636-
// This is regardless of compact mode.
2637-
void JumpNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
2638-
this->collect_nodes(in_rel, 1, false, false);
2639-
this->collect_nodes(out_rel, -2, false, false);
2640-
}
2641-
#endif
2642-
26432613
//=============================================================================
26442614
const RegMask &JProjNode::out_RegMask() const {
26452615
return RegMask::Empty;
@@ -2700,12 +2670,6 @@ void JumpProjNode::dump_compact_spec(outputStream *st) const {
27002670
ProjNode::dump_compact_spec(st);
27012671
st->print("(%d)%d@%d", _switch_val, _proj_no, _dest_bci);
27022672
}
2703-
2704-
void JumpProjNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
2705-
// The related nodes of a JumpProjNode are its inputs and outputs at level 1.
2706-
this->collect_nodes(in_rel, 1, false, false);
2707-
this->collect_nodes(out_rel, -1, false, false);
2708-
}
27092673
#endif
27102674

27112675
//=============================================================================

src/hotspot/share/opto/cfgnode.hpp

-15
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,6 @@ class PhiNode : public TypeNode {
224224
virtual const RegMask &out_RegMask() const;
225225
virtual const RegMask &in_RegMask(uint) const;
226226
#ifndef PRODUCT
227-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
228227
virtual void dump_spec(outputStream *st) const;
229228
#endif
230229
#ifdef ASSERT
@@ -250,10 +249,6 @@ class GotoNode : public Node {
250249
virtual const Type* Value(PhaseGVN* phase) const;
251250
virtual Node* Identity(PhaseGVN* phase);
252251
virtual const RegMask &out_RegMask() const;
253-
254-
#ifndef PRODUCT
255-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
256-
#endif
257252
};
258253

259254
//------------------------------CProjNode--------------------------------------
@@ -406,7 +401,6 @@ class IfNode : public MultiBranchNode {
406401

407402
#ifndef PRODUCT
408403
virtual void dump_spec(outputStream *st) const;
409-
virtual void related(GrowableArray <Node *> *in_rel, GrowableArray <Node *> *out_rel, bool compact) const;
410404
#endif
411405
};
412406

@@ -432,11 +426,6 @@ class IfProjNode : public CProjNode {
432426
protected:
433427
// Type of If input when this branch is always taken
434428
virtual bool always_taken(const TypeTuple* t) const = 0;
435-
436-
#ifndef PRODUCT
437-
public:
438-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
439-
#endif
440429
};
441430

442431
class IfTrueNode : public IfProjNode {
@@ -504,9 +493,6 @@ class JumpNode : public PCTableNode {
504493
virtual int Opcode() const;
505494
virtual const RegMask& out_RegMask() const;
506495
virtual const Node* is_block_proj() const { return this; }
507-
#ifndef PRODUCT
508-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
509-
#endif
510496
};
511497

512498
class JumpProjNode : public JProjNode {
@@ -532,7 +518,6 @@ class JumpProjNode : public JProjNode {
532518
#ifndef PRODUCT
533519
virtual void dump_spec(outputStream *st) const;
534520
virtual void dump_compact_spec(outputStream *st) const;
535-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
536521
#endif
537522
};
538523

src/hotspot/share/opto/ifnode.cpp

-30
Original file line numberDiff line numberDiff line change
@@ -1740,40 +1740,10 @@ Node* IfProjNode::Identity(PhaseGVN* phase) {
17401740
}
17411741

17421742
#ifndef PRODUCT
1743-
//-------------------------------related---------------------------------------
1744-
// An IfProjNode's related node set consists of its input (an IfNode) including
1745-
// the IfNode's condition, plus all of its outputs at level 1. In compact mode,
1746-
// the restrictions for IfNode apply (see IfNode::rel).
1747-
void IfProjNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
1748-
Node* ifNode = this->in(0);
1749-
in_rel->append(ifNode);
1750-
if (compact) {
1751-
ifNode->collect_nodes(in_rel, 3, false, true);
1752-
} else {
1753-
ifNode->collect_nodes_in_all_data(in_rel, false);
1754-
}
1755-
this->collect_nodes(out_rel, -1, false, false);
1756-
}
1757-
17581743
//------------------------------dump_spec--------------------------------------
17591744
void IfNode::dump_spec(outputStream *st) const {
17601745
st->print("P=%f, C=%f",_prob,_fcnt);
17611746
}
1762-
1763-
//-------------------------------related---------------------------------------
1764-
// For an IfNode, the set of related output nodes is just the output nodes till
1765-
// depth 2, i.e, the IfTrue/IfFalse projection nodes plus the nodes they refer.
1766-
// The related input nodes contain no control nodes, but all data nodes
1767-
// pertaining to the condition. In compact mode, the input nodes are collected
1768-
// up to a depth of 3.
1769-
void IfNode::related(GrowableArray <Node *> *in_rel, GrowableArray <Node *> *out_rel, bool compact) const {
1770-
if (compact) {
1771-
this->collect_nodes(in_rel, 3, false, true);
1772-
} else {
1773-
this->collect_nodes_in_all_data(in_rel, false);
1774-
}
1775-
this->collect_nodes(out_rel, -2, false, false);
1776-
}
17771747
#endif
17781748

17791749
//------------------------------idealize_test----------------------------------

src/hotspot/share/opto/lcm.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ bool PhaseCFG::schedule_local(Block* block, GrowableArray<int>& ready_cnt, Vecto
944944
tty->print_cr("# --- schedule_local B%d, before: ---", block->_pre_order);
945945
for (uint i = 0;i < block->number_of_nodes(); i++) {
946946
tty->print("# ");
947-
block->get_node(i)->fast_dump();
947+
block->get_node(i)->dump();
948948
}
949949
tty->print_cr("#");
950950
}
@@ -1212,7 +1212,7 @@ bool PhaseCFG::schedule_local(Block* block, GrowableArray<int>& ready_cnt, Vecto
12121212
tty->print_cr("# after schedule_local");
12131213
for (uint i = 0;i < block->number_of_nodes();i++) {
12141214
tty->print("# ");
1215-
block->get_node(i)->fast_dump();
1215+
block->get_node(i)->dump();
12161216
}
12171217
tty->print_cr("# ");
12181218

src/hotspot/share/opto/matcher.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ class Matcher : public PhaseTransform {
524524

525525
void dump_old2new_map(); // machine-independent to machine-dependent
526526

527-
Node* find_old_node(Node* new_node) {
527+
Node* find_old_node(const Node* new_node) {
528528
return _new2old_map[new_node->_idx];
529529
}
530530
#endif // !PRODUCT

src/hotspot/share/opto/movenode.cpp

-15
Original file line numberDiff line numberDiff line change
@@ -462,18 +462,3 @@ Node* MoveD2LNode::Identity(PhaseGVN* phase) {
462462
}
463463
return this;
464464
}
465-
466-
#ifndef PRODUCT
467-
//----------------------------BinaryNode---------------------------------------
468-
// The set of related nodes for a BinaryNode is all data inputs and all outputs
469-
// till level 2 (i.e., one beyond the associated CMoveNode). In compact mode,
470-
// it's the inputs till level 1 and the outputs till level 2.
471-
void BinaryNode::related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const {
472-
if (compact) {
473-
this->collect_nodes(in_rel, 1, false, true);
474-
} else {
475-
this->collect_nodes_in_all_data(in_rel, false);
476-
}
477-
this->collect_nodes(out_rel, -2, false, false);
478-
}
479-
#endif

src/hotspot/share/opto/movenode.hpp

-4
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,6 @@ class BinaryNode : public Node {
160160
BinaryNode( Node *n1, Node *n2 ) : Node(0,n1,n2) { }
161161
virtual int Opcode() const;
162162
virtual uint ideal_reg() const { return 0; }
163-
164-
#ifndef PRODUCT
165-
virtual void related(GrowableArray<Node*> *in_rel, GrowableArray<Node*> *out_rel, bool compact) const;
166-
#endif
167163
};
168164

169165

0 commit comments

Comments
 (0)