src/share/vm/gc_implementation/shared/vmGCOperations.cpp

Print this page
rev 5733 : 8030812: Change the solaris DTrace implementation to use USDT2 instead of USDT1
Reviewed-by:


  39 #include "utilities/macros.hpp"
  40 #if INCLUDE_ALL_GCS
  41 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  42 #endif // INCLUDE_ALL_GCS
  43 
  44 #ifndef USDT2
  45 HS_DTRACE_PROBE_DECL1(hotspot, gc__begin, bool);
  46 HS_DTRACE_PROBE_DECL(hotspot, gc__end);
  47 #endif /* !USDT2 */
  48 
  49 // The same dtrace probe can't be inserted in two different files, so we
  50 // have to call it here, so it's only in one file.  Can't create new probes
  51 // for the other file anymore.   The dtrace probes have to remain stable.
  52 void VM_GC_Operation::notify_gc_begin(bool full) {
  53 #ifndef USDT2
  54   HS_DTRACE_PROBE1(hotspot, gc__begin, full);
  55   HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
  56 #else /* USDT2 */
  57   HOTSPOT_GC_BEGIN(
  58                    full);

  59 #endif /* USDT2 */
  60 }
  61 
  62 void VM_GC_Operation::notify_gc_end() {
  63 #ifndef USDT2
  64   HS_DTRACE_PROBE(hotspot, gc__end);
  65   HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
  66 #else /* USDT2 */
  67   HOTSPOT_GC_END(
  68 );
  69 #endif /* USDT2 */
  70 }
  71 
  72 void VM_GC_Operation::acquire_pending_list_lock() {
  73   // we may enter this with pending exception set
  74   InstanceRefKlass::acquire_pending_list_lock(&_pending_list_basic_lock);
  75 }
  76 
  77 
  78 void VM_GC_Operation::release_and_notify_pending_list_lock() {
  79 
  80   InstanceRefKlass::release_and_notify_pending_list_lock(&_pending_list_basic_lock);
  81 }
  82 
  83 // Allocations may fail in several threads at about the same time,
  84 // resulting in multiple gc requests.  We only want to do one of them.
  85 // In case a GC locker is active and the need for a GC is already signalled,
  86 // we want to skip this GC attempt altogether, without doing a futile
  87 // safepoint operation.
  88 bool VM_GC_Operation::skip_operation() const {




  39 #include "utilities/macros.hpp"
  40 #if INCLUDE_ALL_GCS
  41 #include "gc_implementation/g1/g1CollectedHeap.inline.hpp"
  42 #endif // INCLUDE_ALL_GCS
  43 
  44 #ifndef USDT2
  45 HS_DTRACE_PROBE_DECL1(hotspot, gc__begin, bool);
  46 HS_DTRACE_PROBE_DECL(hotspot, gc__end);
  47 #endif /* !USDT2 */
  48 
  49 // The same dtrace probe can't be inserted in two different files, so we
  50 // have to call it here, so it's only in one file.  Can't create new probes
  51 // for the other file anymore.   The dtrace probes have to remain stable.
  52 void VM_GC_Operation::notify_gc_begin(bool full) {
  53 #ifndef USDT2
  54   HS_DTRACE_PROBE1(hotspot, gc__begin, full);
  55   HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
  56 #else /* USDT2 */
  57   HOTSPOT_GC_BEGIN(
  58                    full);
  59   HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
  60 #endif /* USDT2 */
  61 }
  62 
  63 void VM_GC_Operation::notify_gc_end() {
  64 #ifndef USDT2
  65   HS_DTRACE_PROBE(hotspot, gc__end);
  66   HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
  67 #else /* USDT2 */
  68   HOTSPOT_GC_END();
  69   HS_DTRACE_WORKAROUND_TAIL_CALL_BUG();
  70 #endif /* USDT2 */
  71 }
  72 
  73 void VM_GC_Operation::acquire_pending_list_lock() {
  74   // we may enter this with pending exception set
  75   InstanceRefKlass::acquire_pending_list_lock(&_pending_list_basic_lock);
  76 }
  77 
  78 
  79 void VM_GC_Operation::release_and_notify_pending_list_lock() {
  80 
  81   InstanceRefKlass::release_and_notify_pending_list_lock(&_pending_list_basic_lock);
  82 }
  83 
  84 // Allocations may fail in several threads at about the same time,
  85 // resulting in multiple gc requests.  We only want to do one of them.
  86 // In case a GC locker is active and the need for a GC is already signalled,
  87 // we want to skip this GC attempt altogether, without doing a futile
  88 // safepoint operation.
  89 bool VM_GC_Operation::skip_operation() const {