diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp index 68718499a00fc8966be8102af5a69196003c0472..3cf1f8ff80dfe35166f5c0c90e9a6377fde61e9d 100644 --- a/src/share/vm/code/nmethod.cpp +++ b/src/share/vm/code/nmethod.cpp @@ -619,7 +619,7 @@ nmethod* nmethod::new_nmethod(methodHandle method, 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); } } diff --git a/src/share/vm/opto/callnode.cpp b/src/share/vm/opto/callnode.cpp index 594b650decbfc3a01e3e3b8ffff2e3266caa14c5..12dcf38b0f285e7cc2c62ac39c122160068c3aed 100644 --- a/src/share/vm/opto/callnode.cpp +++ b/src/share/vm/opto/callnode.cpp @@ -342,7 +342,7 @@ static void format_helper( PhaseRegAlloc *regalloc, outputStream* st, Node *n, c 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 @@ int CallStaticJavaNode::extract_uncommon_trap_request(const Node* call) { 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; } diff --git a/src/share/vm/opto/compile.cpp b/src/share/vm/opto/compile.cpp index fbc7c4a21dbbbbf1ef4d6c593682a1932ace7a19..069e8d7646b71b9dd25dda995595b4927a772b87 100644 --- a/src/share/vm/opto/compile.cpp +++ b/src/share/vm/opto/compile.cpp @@ -647,6 +647,7 @@ Compile::Compile( ciEnv* ci_env, C2Compiler* compiler, ciMethod* target, int osr _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 @@ Compile::Compile( ciEnv* ci_env, _inner_loops(0), #ifndef PRODUCT _trace_opto_output(TraceOptoOutput), + _in_dump_cnt(0), _printer(NULL), #endif _dead_node_list(comp_arena()), diff --git a/src/share/vm/opto/compile.hpp b/src/share/vm/opto/compile.hpp index 5ad53e5d1636edf039bf58ee269e63bf5072ff52..96b847179d5cbd3696041749fc6b5295947fff84 100644 --- a/src/share/vm/opto/compile.hpp +++ b/src/share/vm/opto/compile.hpp @@ -591,6 +591,7 @@ class Compile : public Phase { 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 diff --git a/src/share/vm/opto/idealGraphPrinter.cpp b/src/share/vm/opto/idealGraphPrinter.cpp index 4589f6e4a8d41a92f16a60caa4c3e849950d1147..851b70d3f8fc2f59008c64a97a2c8a84b20d13d9 100644 --- a/src/share/vm/opto/idealGraphPrinter.cpp +++ b/src/share/vm/opto/idealGraphPrinter.cpp @@ -404,7 +404,7 @@ void IdealGraphPrinter::visit_node(Node *n, bool edges, VectorSet* temp_set) { 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 @@ void IdealGraphPrinter::visit_node(Node *n, bool edges, VectorSet* temp_set) { print_prop("lrg", lrg_id); } - node->_in_dump_cnt--; + Compile::current()->_in_dump_cnt--; #endif tail(PROPERTIES_ELEMENT); diff --git a/src/share/vm/opto/node.cpp b/src/share/vm/opto/node.cpp index 1df5eb51a8cfb80f8b393f089109ced5c5fe288c..0e0b8a0c51878df48a81548421b54bc9fc5929f6 100644 --- a/src/share/vm/opto/node.cpp +++ b/src/share/vm/opto/node.cpp @@ -1523,7 +1523,6 @@ Node* Node::find_ctrl(int idx) const { #ifndef PRODUCT -int Node::_in_dump_cnt = 0; // -----------------------------Name------------------------------------------- extern const char *NodeClassNames[]; @@ -1595,7 +1594,7 @@ void Node::set_debug_orig(Node* orig) { 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 @@ void Node::dump(const char* suffix, outputStream *st) const { 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 @@ void Node::dump(const char* suffix, outputStream *st) const { } } if (suffix) st->print(suffix); - _in_dump_cnt--; + C->_in_dump_cnt--; } //------------------------------dump_req-------------------------------------- diff --git a/src/share/vm/opto/node.hpp b/src/share/vm/opto/node.hpp index d380a35f0db749672a5d2d6009031bab8147f91e..b04a0fad78e3fd5a0ffb3c859345c9a827530825 100644 --- a/src/share/vm/opto/node.hpp +++ b/src/share/vm/opto/node.hpp @@ -1033,8 +1033,7 @@ public: // 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++)