src/share/vm/compiler/compileBroker.cpp

Print this page
rev 5893 : 8034080: Remove the USDT1 dtrace code from Hotspot


  43 #include "runtime/os.hpp"
  44 #include "runtime/sharedRuntime.hpp"
  45 #include "runtime/sweeper.hpp"
  46 #include "trace/tracing.hpp"
  47 #include "utilities/dtrace.hpp"
  48 #include "utilities/events.hpp"
  49 #ifdef COMPILER1
  50 #include "c1/c1_Compiler.hpp"
  51 #endif
  52 #ifdef COMPILER2
  53 #include "opto/c2compiler.hpp"
  54 #endif
  55 #ifdef SHARK
  56 #include "shark/sharkCompiler.hpp"
  57 #endif
  58 
  59 #ifdef DTRACE_ENABLED
  60 
  61 // Only bother with this argument setup if dtrace is available
  62 
  63 #ifndef USDT2
  64 HS_DTRACE_PROBE_DECL8(hotspot, method__compile__begin,
  65   char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t);
  66 HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
  67   char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t, bool);
  68 
  69 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, comp_name)             \
  70   {                                                                      \
  71     Symbol* klass_name = (method)->klass_name();                         \
  72     Symbol* name = (method)->name();                                     \
  73     Symbol* signature = (method)->signature();                           \
  74     HS_DTRACE_PROBE8(hotspot, method__compile__begin,                    \
  75       comp_name, strlen(comp_name),                                      \
  76       klass_name->bytes(), klass_name->utf8_length(),                    \
  77       name->bytes(), name->utf8_length(),                                \
  78       signature->bytes(), signature->utf8_length());                     \
  79   }
  80 
  81 #define DTRACE_METHOD_COMPILE_END_PROBE(method, comp_name, success)      \
  82   {                                                                      \
  83     Symbol* klass_name = (method)->klass_name();                         \
  84     Symbol* name = (method)->name();                                     \
  85     Symbol* signature = (method)->signature();                           \
  86     HS_DTRACE_PROBE9(hotspot, method__compile__end,                      \
  87       comp_name, strlen(comp_name),                                      \
  88       klass_name->bytes(), klass_name->utf8_length(),                    \
  89       name->bytes(), name->utf8_length(),                                \
  90       signature->bytes(), signature->utf8_length(), (success));          \
  91   }
  92 
  93 #else /* USDT2 */
  94 
  95 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, comp_name)             \
  96   {                                                                      \
  97     Symbol* klass_name = (method)->klass_name();                         \
  98     Symbol* name = (method)->name();                                     \
  99     Symbol* signature = (method)->signature();                           \
 100     HOTSPOT_METHOD_COMPILE_BEGIN(                                        \
 101       (char *) comp_name, strlen(comp_name),                             \
 102       (char *) klass_name->bytes(), klass_name->utf8_length(),           \
 103       (char *) name->bytes(), name->utf8_length(),                       \
 104       (char *) signature->bytes(), signature->utf8_length());            \
 105   }
 106 
 107 #define DTRACE_METHOD_COMPILE_END_PROBE(method, comp_name, success)      \
 108   {                                                                      \
 109     Symbol* klass_name = (method)->klass_name();                         \
 110     Symbol* name = (method)->name();                                     \
 111     Symbol* signature = (method)->signature();                           \
 112     HOTSPOT_METHOD_COMPILE_END(                                          \
 113       (char *) comp_name, strlen(comp_name),                             \
 114       (char *) klass_name->bytes(), klass_name->utf8_length(),           \
 115       (char *) name->bytes(), name->utf8_length(),                       \
 116       (char *) signature->bytes(), signature->utf8_length(), (success)); \
 117   }
 118 #endif /* USDT2 */
 119 
 120 #else //  ndef DTRACE_ENABLED
 121 
 122 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, comp_name)
 123 #define DTRACE_METHOD_COMPILE_END_PROBE(method, comp_name, success)
 124 
 125 #endif // ndef DTRACE_ENABLED
 126 
 127 bool CompileBroker::_initialized = false;
 128 volatile bool CompileBroker::_should_block = false;
 129 volatile jint CompileBroker::_print_compilation_warning = 0;
 130 volatile jint CompileBroker::_should_compile_new_jobs = run_compilation;
 131 
 132 // The installed compiler(s)
 133 AbstractCompiler* CompileBroker::_compilers[2];
 134 
 135 // These counters are used to assign an unique ID to each compilation.
 136 volatile jint CompileBroker::_compilation_id     = 0;
 137 volatile jint CompileBroker::_osr_compilation_id = 0;
 138 




  43 #include "runtime/os.hpp"
  44 #include "runtime/sharedRuntime.hpp"
  45 #include "runtime/sweeper.hpp"
  46 #include "trace/tracing.hpp"
  47 #include "utilities/dtrace.hpp"
  48 #include "utilities/events.hpp"
  49 #ifdef COMPILER1
  50 #include "c1/c1_Compiler.hpp"
  51 #endif
  52 #ifdef COMPILER2
  53 #include "opto/c2compiler.hpp"
  54 #endif
  55 #ifdef SHARK
  56 #include "shark/sharkCompiler.hpp"
  57 #endif
  58 
  59 #ifdef DTRACE_ENABLED
  60 
  61 // Only bother with this argument setup if dtrace is available
  62 
































  63 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, comp_name)             \
  64   {                                                                      \
  65     Symbol* klass_name = (method)->klass_name();                         \
  66     Symbol* name = (method)->name();                                     \
  67     Symbol* signature = (method)->signature();                           \
  68     HOTSPOT_METHOD_COMPILE_BEGIN(                                        \
  69       (char *) comp_name, strlen(comp_name),                             \
  70       (char *) klass_name->bytes(), klass_name->utf8_length(),           \
  71       (char *) name->bytes(), name->utf8_length(),                       \
  72       (char *) signature->bytes(), signature->utf8_length());            \
  73   }
  74 
  75 #define DTRACE_METHOD_COMPILE_END_PROBE(method, comp_name, success)      \
  76   {                                                                      \
  77     Symbol* klass_name = (method)->klass_name();                         \
  78     Symbol* name = (method)->name();                                     \
  79     Symbol* signature = (method)->signature();                           \
  80     HOTSPOT_METHOD_COMPILE_END(                                          \
  81       (char *) comp_name, strlen(comp_name),                             \
  82       (char *) klass_name->bytes(), klass_name->utf8_length(),           \
  83       (char *) name->bytes(), name->utf8_length(),                       \
  84       (char *) signature->bytes(), signature->utf8_length(), (success)); \
  85   }

  86 
  87 #else //  ndef DTRACE_ENABLED
  88 
  89 #define DTRACE_METHOD_COMPILE_BEGIN_PROBE(method, comp_name)
  90 #define DTRACE_METHOD_COMPILE_END_PROBE(method, comp_name, success)
  91 
  92 #endif // ndef DTRACE_ENABLED
  93 
  94 bool CompileBroker::_initialized = false;
  95 volatile bool CompileBroker::_should_block = false;
  96 volatile jint CompileBroker::_print_compilation_warning = 0;
  97 volatile jint CompileBroker::_should_compile_new_jobs = run_compilation;
  98 
  99 // The installed compiler(s)
 100 AbstractCompiler* CompileBroker::_compilers[2];
 101 
 102 // These counters are used to assign an unique ID to each compilation.
 103 volatile jint CompileBroker::_compilation_id     = 0;
 104 volatile jint CompileBroker::_osr_compilation_id = 0;
 105