8029025: PPC64 (part 203): opto: Move static _in_dump_cnt to Compile object.
Summary: Also introduces the compiler oracle 'option' feature for PrintAssembly.
Reviewed-by: kvn
--- a/hotspot/src/share/vm/code/nmethod.cpp Thu Nov 21 19:00:57 2013 -0800
+++ b/hotspot/src/share/vm/code/nmethod.cpp Fri Nov 22 12:14:09 2013 -0800
@@ -619,7 +619,7 @@
InstanceKlass::cast(klass)->add_dependent_nmethod(nm);
}
NOT_PRODUCT(nmethod_stats.note_nmethod(nm));
- if (PrintAssembly) {
+ if (PrintAssembly || CompilerOracle::has_option_string(method, "PrintAssembly")) {
Disassembler::decode(nm);
}
}
--- a/hotspot/src/share/vm/opto/callnode.cpp Thu Nov 21 19:00:57 2013 -0800
+++ b/hotspot/src/share/vm/opto/callnode.cpp Fri Nov 22 12:14:09 2013 -0800
@@ -342,7 +342,7 @@
st->print(" %s%d]=#"INT32_FORMAT,msg,i,t->is_int()->get_con());
break;
case Type::AnyPtr:
- assert( t == TypePtr::NULL_PTR, "" );
+ assert( t == TypePtr::NULL_PTR || n->in_dump(), "" );
st->print(" %s%d]=#NULL",msg,i);
break;
case Type::AryPtr:
@@ -887,7 +887,7 @@
if (!(call->req() > TypeFunc::Parms &&
call->in(TypeFunc::Parms) != NULL &&
call->in(TypeFunc::Parms)->is_Con())) {
- assert(_in_dump_cnt != 0, "OK if dumping");
+ assert(in_dump() != 0, "OK if dumping");
tty->print("[bad uncommon trap]");
return 0;
}
--- a/hotspot/src/share/vm/opto/compile.cpp Thu Nov 21 19:00:57 2013 -0800
+++ b/hotspot/src/share/vm/opto/compile.cpp Fri Nov 22 12:14:09 2013 -0800
@@ -647,6 +647,7 @@
_dead_node_count(0),
#ifndef PRODUCT
_trace_opto_output(TraceOptoOutput || method()->has_option("TraceOptoOutput")),
+ _in_dump_cnt(0),
_printer(IdealGraphPrinter::printer()),
#endif
_congraph(NULL),
@@ -936,6 +937,7 @@
_inner_loops(0),
#ifndef PRODUCT
_trace_opto_output(TraceOptoOutput),
+ _in_dump_cnt(0),
_printer(NULL),
#endif
_dead_node_list(comp_arena()),
--- a/hotspot/src/share/vm/opto/compile.hpp Thu Nov 21 19:00:57 2013 -0800
+++ b/hotspot/src/share/vm/opto/compile.hpp Fri Nov 22 12:14:09 2013 -0800
@@ -591,6 +591,7 @@
bool trace_opto_output() const { return _trace_opto_output; }
bool parsed_irreducible_loop() const { return _parsed_irreducible_loop; }
void set_parsed_irreducible_loop(bool z) { _parsed_irreducible_loop = z; }
+ int _in_dump_cnt; // Required for dumping ir nodes.
#endif
// JSR 292
--- a/hotspot/src/share/vm/opto/idealGraphPrinter.cpp Thu Nov 21 19:00:57 2013 -0800
+++ b/hotspot/src/share/vm/opto/idealGraphPrinter.cpp Fri Nov 22 12:14:09 2013 -0800
@@ -404,7 +404,7 @@
Node *node = n;
#ifndef PRODUCT
- node->_in_dump_cnt++;
+ Compile::current()->_in_dump_cnt++;
print_prop(NODE_NAME_PROPERTY, (const char *)node->Name());
const Type *t = node->bottom_type();
print_prop("type", t->msg());
@@ -623,7 +623,7 @@
print_prop("lrg", lrg_id);
}
- node->_in_dump_cnt--;
+ Compile::current()->_in_dump_cnt--;
#endif
tail(PROPERTIES_ELEMENT);
--- a/hotspot/src/share/vm/opto/node.cpp Thu Nov 21 19:00:57 2013 -0800
+++ b/hotspot/src/share/vm/opto/node.cpp Fri Nov 22 12:14:09 2013 -0800
@@ -1523,7 +1523,6 @@
#ifndef PRODUCT
-int Node::_in_dump_cnt = 0;
// -----------------------------Name-------------------------------------------
extern const char *NodeClassNames[];
@@ -1595,7 +1594,7 @@
void Node::dump(const char* suffix, outputStream *st) const {
Compile* C = Compile::current();
bool is_new = C->node_arena()->contains(this);
- _in_dump_cnt++;
+ C->_in_dump_cnt++;
st->print("%c%d\t%s\t=== ", is_new ? ' ' : 'o', _idx, Name());
// Dump the required and precedence inputs
@@ -1610,7 +1609,7 @@
dump_orig(debug_orig(), st);
#endif
st->cr();
- _in_dump_cnt--;
+ C->_in_dump_cnt--;
return; // don't process dead nodes
}
@@ -1662,7 +1661,7 @@
}
}
if (suffix) st->print(suffix);
- _in_dump_cnt--;
+ C->_in_dump_cnt--;
}
//------------------------------dump_req--------------------------------------
--- a/hotspot/src/share/vm/opto/node.hpp Thu Nov 21 19:00:57 2013 -0800
+++ b/hotspot/src/share/vm/opto/node.hpp Fri Nov 22 12:14:09 2013 -0800
@@ -1033,8 +1033,7 @@
// RegMask Print Functions
void dump_in_regmask(int idx) { in_RegMask(idx).dump(); }
void dump_out_regmask() { out_RegMask().dump(); }
- static int _in_dump_cnt;
- static bool in_dump() { return _in_dump_cnt > 0; }
+ static bool in_dump() { return Compile::current()->_in_dump_cnt > 0; }
void fast_dump() const {
tty->print("%4d: %-17s", _idx, Name());
for (uint i = 0; i < len(); i++)