view ppc_patches/0203_opto-Move_static_in_dump_cnt_to_Compile_object.patch @ 5766:338e318f1e12

opto: Introduce MemBarAcquire/ReleaseWide nodes.
author goetz
date Fri, 15 Nov 2013 17:00:39 +0100
parents df79d76c17ab
children
line wrap: on
line source
# HG changeset patch
# Parent 6163574eadba7446c32c8a402961c84c7fa909d9
opto: Move static _in_dump_cnt to Compile object.

If there are two or more compiler threads, a single static variable
does not suffice.

diff -r 6163574eadba src/share/vm/opto/callnode.cpp
--- a/src/share/vm/opto/callnode.cpp	Thu Nov 07 10:20:16 2013 +0100
+++ b/src/share/vm/opto/callnode.cpp	Thu Nov 07 10:27:00 2013 +0100
@@ -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;
   }
diff -r 6163574eadba src/share/vm/opto/compile.cpp
--- a/src/share/vm/opto/compile.cpp	Thu Nov 07 10:20:16 2013 +0100
+++ b/src/share/vm/opto/compile.cpp	Thu Nov 07 10:27:00 2013 +0100
@@ -659,6 +659,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),
@@ -947,6 +948,7 @@
     _inner_loops(0),
 #ifndef PRODUCT
     _trace_opto_output(TraceOptoOutput),
+    _in_dump_cnt(0),
     _printer(NULL),
 #endif
     _dead_node_list(comp_arena()),
diff -r 6163574eadba src/share/vm/opto/compile.hpp
--- a/src/share/vm/opto/compile.hpp	Thu Nov 07 10:20:16 2013 +0100
+++ b/src/share/vm/opto/compile.hpp	Thu Nov 07 10:27:00 2013 +0100
@@ -593,6 +593,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
diff -r 6163574eadba src/share/vm/opto/idealGraphPrinter.cpp
--- a/src/share/vm/opto/idealGraphPrinter.cpp	Thu Nov 07 10:20:16 2013 +0100
+++ b/src/share/vm/opto/idealGraphPrinter.cpp	Thu Nov 07 10:27:00 2013 +0100
@@ -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);
diff -r 6163574eadba src/share/vm/opto/node.cpp
--- a/src/share/vm/opto/node.cpp	Thu Nov 07 10:20:16 2013 +0100
+++ b/src/share/vm/opto/node.cpp	Thu Nov 07 10:27:00 2013 +0100
@@ -1526,7 +1526,6 @@
 
 
 #ifndef PRODUCT
-int Node::_in_dump_cnt = 0;
 
 // -----------------------------Name-------------------------------------------
 extern const char *NodeClassNames[];
@@ -1598,7 +1597,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
@@ -1613,7 +1612,7 @@
     dump_orig(debug_orig(), st);
 #endif
     st->cr();
-    _in_dump_cnt--;
+    C->_in_dump_cnt--;
     return;                     // don't process dead nodes
   }
 
@@ -1665,7 +1664,7 @@
     }
   }
   if (suffix) st->print(suffix);
-  _in_dump_cnt--;
+  C->_in_dump_cnt--;
 }
 
 //------------------------------dump_req--------------------------------------
diff -r 6163574eadba src/share/vm/opto/node.hpp
--- a/src/share/vm/opto/node.hpp	Thu Nov 07 10:20:16 2013 +0100
+++ b/src/share/vm/opto/node.hpp	Thu Nov 07 10:27:00 2013 +0100
@@ -1035,8 +1035,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++)