From cbd76283eddd2b7451e1ef0243f8d2ab0dee1001 Mon Sep 17 00:00:00 2001 From: goetz Date: Fri, 22 Nov 2013 12:14:09 -0800 Subject: [PATCH] 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 --- src/share/vm/code/nmethod.cpp | 2 +- src/share/vm/opto/callnode.cpp | 4 ++-- src/share/vm/opto/compile.cpp | 2 ++ src/share/vm/opto/compile.hpp | 1 + src/share/vm/opto/idealGraphPrinter.cpp | 4 ++-- src/share/vm/opto/node.cpp | 7 +++---- src/share/vm/opto/node.hpp | 3 +-- 7 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/share/vm/code/nmethod.cpp b/src/share/vm/code/nmethod.cpp index 68718499a..3cf1f8ff8 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 594b650de..12dcf38b0 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 fbc7c4a21..069e8d764 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 5ad53e5d1..96b847179 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 4589f6e4a..851b70d3f 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 1df5eb51a..0e0b8a0c5 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 d380a35f0..b04a0fad7 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++) -- GitLab