< prev index next >

src/hotspot/share/opto/idealGraphPrinter.cpp

Print this page
rev 47287 : Port 09.17.Thread_SMR_logging_update from JDK9 to JDK10
rev 47289 : eosterlund, stefank CR - refactor code into threadSMR.cpp and threadSMR.hpp
rev 47292 : stefank, coleenp CR - refactor most JavaThreadIterator usage to use JavaThreadIteratorWithHandle.


  75 int IdealGraphPrinter::_file_count = 0;
  76 
  77 IdealGraphPrinter *IdealGraphPrinter::printer() {
  78   if (!PrintIdealGraph) {
  79     return NULL;
  80   }
  81 
  82   JavaThread *thread = JavaThread::current();
  83   if (!thread->is_Compiler_thread()) return NULL;
  84 
  85   CompilerThread *compiler_thread = (CompilerThread *)thread;
  86   if (compiler_thread->ideal_graph_printer() == NULL) {
  87     IdealGraphPrinter *printer = new IdealGraphPrinter();
  88     compiler_thread->set_ideal_graph_printer(printer);
  89   }
  90 
  91   return compiler_thread->ideal_graph_printer();
  92 }
  93 
  94 void IdealGraphPrinter::clean_up() {
  95   ThreadsListHandle tlh;
  96   JavaThreadIterator jti(tlh.list());
  97   for (JavaThread *p = jti.first(); p != NULL; p = jti.next()) {
  98     if (p->is_Compiler_thread()) {
  99       CompilerThread *c = (CompilerThread *)p;
 100       IdealGraphPrinter *printer = c->ideal_graph_printer();
 101       if (printer) {
 102         delete printer;
 103       }
 104       c->set_ideal_graph_printer(NULL);
 105     }
 106   }
 107 }
 108 
 109 // Constructor, either file or network output
 110 IdealGraphPrinter::IdealGraphPrinter() {
 111 
 112   // By default dump both ins and outs since dead or unreachable code
 113   // needs to appear in the graph.  There are also some special cases
 114   // in the mach where kill projections have no users but should
 115   // appear in the dump.
 116   _traverse_outs = true;
 117   _should_send_method = true;




  75 int IdealGraphPrinter::_file_count = 0;
  76 
  77 IdealGraphPrinter *IdealGraphPrinter::printer() {
  78   if (!PrintIdealGraph) {
  79     return NULL;
  80   }
  81 
  82   JavaThread *thread = JavaThread::current();
  83   if (!thread->is_Compiler_thread()) return NULL;
  84 
  85   CompilerThread *compiler_thread = (CompilerThread *)thread;
  86   if (compiler_thread->ideal_graph_printer() == NULL) {
  87     IdealGraphPrinter *printer = new IdealGraphPrinter();
  88     compiler_thread->set_ideal_graph_printer(printer);
  89   }
  90 
  91   return compiler_thread->ideal_graph_printer();
  92 }
  93 
  94 void IdealGraphPrinter::clean_up() {
  95   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *p = jtiwh.next(); ) {


  96     if (p->is_Compiler_thread()) {
  97       CompilerThread *c = (CompilerThread *)p;
  98       IdealGraphPrinter *printer = c->ideal_graph_printer();
  99       if (printer) {
 100         delete printer;
 101       }
 102       c->set_ideal_graph_printer(NULL);
 103     }
 104   }
 105 }
 106 
 107 // Constructor, either file or network output
 108 IdealGraphPrinter::IdealGraphPrinter() {
 109 
 110   // By default dump both ins and outs since dead or unreachable code
 111   // needs to appear in the graph.  There are also some special cases
 112   // in the mach where kill projections have no users but should
 113   // appear in the dump.
 114   _traverse_outs = true;
 115   _should_send_method = true;


< prev index next >