< prev index next >

src/hotspot/share/runtime/thread.hpp

Print this page
rev 50303 : Thread Dump Extension (memory allocation)


  36 #include "runtime/handshake.hpp"
  37 #include "runtime/javaFrameAnchor.hpp"
  38 #include "runtime/jniHandles.hpp"
  39 #include "runtime/mutexLocker.hpp"
  40 #include "runtime/os.hpp"
  41 #include "runtime/osThread.hpp"
  42 #include "runtime/park.hpp"
  43 #include "runtime/safepoint.hpp"
  44 #include "runtime/stubRoutines.hpp"
  45 #include "runtime/threadLocalStorage.hpp"
  46 #include "runtime/unhandledOops.hpp"
  47 #include "utilities/align.hpp"
  48 #include "utilities/exceptions.hpp"
  49 #include "utilities/macros.hpp"
  50 #ifdef ZERO
  51 # include "stack_zero.hpp"
  52 #endif
  53 #if INCLUDE_JFR
  54 #include "jfr/support/jfrThreadExtension.hpp"
  55 #endif

  56 
  57 
  58 class SafeThreadsListPtr;
  59 class ThreadSafepointState;
  60 class ThreadsList;
  61 class ThreadsSMRSupport;
  62 
  63 class JvmtiThreadState;
  64 class JvmtiGetLoadedClassesClosure;
  65 class ThreadStatistics;
  66 class ConcurrentLocksDump;
  67 class ParkEvent;
  68 class Parker;
  69 
  70 class ciEnv;
  71 class CompileThread;
  72 class CompileLog;
  73 class CompileTask;
  74 class CompileQueue;
  75 class CompilerCounters;


 322   //
 323   // The two classes NoSafepointVerifier and No_Allocation_Verifier are used to set these counters.
 324   //
 325   NOT_PRODUCT(int _allow_safepoint_count;)      // If 0, thread allow a safepoint to happen
 326   debug_only(int _allow_allocation_count;)     // If 0, the thread is allowed to allocate oops.
 327 
 328   // Used by SkipGCALot class.
 329   NOT_PRODUCT(bool _skip_gcalot;)               // Should we elide gc-a-lot?
 330 
 331   friend class NoAllocVerifier;
 332   friend class NoSafepointVerifier;
 333   friend class PauseNoSafepointVerifier;
 334   friend class GCLocker;
 335 
 336   volatile void* _polling_page;                 // Thread local polling page
 337 
 338   ThreadLocalAllocBuffer _tlab;                 // Thread-local eden
 339   jlong _allocated_bytes;                       // Cumulative number of bytes allocated on
 340                                                 // the Java heap
 341 


 342   JFR_ONLY(DEFINE_THREAD_LOCAL_FIELD_JFR;)      // Thread-local data for jfr
 343 
 344   int   _vm_operation_started_count;            // VM_Operation support
 345   int   _vm_operation_completed_count;          // VM_Operation support
 346 
 347   ObjectMonitor* _current_pending_monitor;      // ObjectMonitor this thread
 348                                                 // is waiting to lock
 349   bool _current_pending_monitor_is_from_java;   // locking is from Java code
 350 
 351   // ObjectMonitor on which this thread called Object.wait()
 352   ObjectMonitor* _current_waiting_monitor;
 353 
 354   // Private thread-local objectmonitor list - a simple cache organized as a SLL.
 355  public:
 356   ObjectMonitor* omFreeList;
 357   int omFreeCount;                              // length of omFreeList
 358   int omFreeProvision;                          // reload chunk size
 359   ObjectMonitor* omInUseList;                   // SLL to track monitors in circulation
 360   int omInUseCount;                             // length of omInUseList
 361 


 500   // Internal handle support
 501   HandleArea* handle_area() const                { return _handle_area; }
 502   void set_handle_area(HandleArea* area)         { _handle_area = area; }
 503 
 504   GrowableArray<Metadata*>* metadata_handles() const          { return _metadata_handles; }
 505   void set_metadata_handles(GrowableArray<Metadata*>* handles){ _metadata_handles = handles; }
 506 
 507   // Thread-Local Allocation Buffer (TLAB) support
 508   ThreadLocalAllocBuffer& tlab()                 { return _tlab; }
 509   void initialize_tlab() {
 510     if (UseTLAB) {
 511       tlab().initialize();
 512     }
 513   }
 514 
 515   jlong allocated_bytes()               { return _allocated_bytes; }
 516   void set_allocated_bytes(jlong value) { _allocated_bytes = value; }
 517   void incr_allocated_bytes(jlong size) { _allocated_bytes += size; }
 518   inline jlong cooked_allocated_bytes();
 519 


 520   JFR_ONLY(DEFINE_THREAD_LOCAL_ACCESSOR_JFR;)
 521 
 522   bool is_trace_suspend()               { return (_suspend_flags & _trace_flag) != 0; }
 523 
 524   // VM operation support
 525   int vm_operation_ticket()                      { return ++_vm_operation_started_count; }
 526   int vm_operation_completed_count()             { return _vm_operation_completed_count; }
 527   void increment_vm_operation_completed_count()  { _vm_operation_completed_count++; }
 528 
 529   // For tracking the heavyweight monitor the thread is pending on.
 530   ObjectMonitor* current_pending_monitor() {
 531     return _current_pending_monitor;
 532   }
 533   void set_current_pending_monitor(ObjectMonitor* monitor) {
 534     _current_pending_monitor = monitor;
 535   }
 536   void set_current_pending_monitor_is_from_java(bool from_java) {
 537     _current_pending_monitor_is_from_java = from_java;
 538   }
 539   bool current_pending_monitor_is_from_java() {




  36 #include "runtime/handshake.hpp"
  37 #include "runtime/javaFrameAnchor.hpp"
  38 #include "runtime/jniHandles.hpp"
  39 #include "runtime/mutexLocker.hpp"
  40 #include "runtime/os.hpp"
  41 #include "runtime/osThread.hpp"
  42 #include "runtime/park.hpp"
  43 #include "runtime/safepoint.hpp"
  44 #include "runtime/stubRoutines.hpp"
  45 #include "runtime/threadLocalStorage.hpp"
  46 #include "runtime/unhandledOops.hpp"
  47 #include "utilities/align.hpp"
  48 #include "utilities/exceptions.hpp"
  49 #include "utilities/macros.hpp"
  50 #ifdef ZERO
  51 # include "stack_zero.hpp"
  52 #endif
  53 #if INCLUDE_JFR
  54 #include "jfr/support/jfrThreadExtension.hpp"
  55 #endif
  56 #include "runtime/threadStatisticInfo.hpp"
  57 
  58 
  59 class SafeThreadsListPtr;
  60 class ThreadSafepointState;
  61 class ThreadsList;
  62 class ThreadsSMRSupport;
  63 
  64 class JvmtiThreadState;
  65 class JvmtiGetLoadedClassesClosure;
  66 class ThreadStatistics;
  67 class ConcurrentLocksDump;
  68 class ParkEvent;
  69 class Parker;
  70 
  71 class ciEnv;
  72 class CompileThread;
  73 class CompileLog;
  74 class CompileTask;
  75 class CompileQueue;
  76 class CompilerCounters;


 323   //
 324   // The two classes NoSafepointVerifier and No_Allocation_Verifier are used to set these counters.
 325   //
 326   NOT_PRODUCT(int _allow_safepoint_count;)      // If 0, thread allow a safepoint to happen
 327   debug_only(int _allow_allocation_count;)     // If 0, the thread is allowed to allocate oops.
 328 
 329   // Used by SkipGCALot class.
 330   NOT_PRODUCT(bool _skip_gcalot;)               // Should we elide gc-a-lot?
 331 
 332   friend class NoAllocVerifier;
 333   friend class NoSafepointVerifier;
 334   friend class PauseNoSafepointVerifier;
 335   friend class GCLocker;
 336 
 337   volatile void* _polling_page;                 // Thread local polling page
 338 
 339   ThreadLocalAllocBuffer _tlab;                 // Thread-local eden
 340   jlong _allocated_bytes;                       // Cumulative number of bytes allocated on
 341                                                 // the Java heap
 342 
 343   ThreadStatisticInfo _statistic_info;          // Statistic info about the thread
 344 
 345   JFR_ONLY(DEFINE_THREAD_LOCAL_FIELD_JFR;)      // Thread-local data for jfr
 346 
 347   int   _vm_operation_started_count;            // VM_Operation support
 348   int   _vm_operation_completed_count;          // VM_Operation support
 349 
 350   ObjectMonitor* _current_pending_monitor;      // ObjectMonitor this thread
 351                                                 // is waiting to lock
 352   bool _current_pending_monitor_is_from_java;   // locking is from Java code
 353 
 354   // ObjectMonitor on which this thread called Object.wait()
 355   ObjectMonitor* _current_waiting_monitor;
 356 
 357   // Private thread-local objectmonitor list - a simple cache organized as a SLL.
 358  public:
 359   ObjectMonitor* omFreeList;
 360   int omFreeCount;                              // length of omFreeList
 361   int omFreeProvision;                          // reload chunk size
 362   ObjectMonitor* omInUseList;                   // SLL to track monitors in circulation
 363   int omInUseCount;                             // length of omInUseList
 364 


 503   // Internal handle support
 504   HandleArea* handle_area() const                { return _handle_area; }
 505   void set_handle_area(HandleArea* area)         { _handle_area = area; }
 506 
 507   GrowableArray<Metadata*>* metadata_handles() const          { return _metadata_handles; }
 508   void set_metadata_handles(GrowableArray<Metadata*>* handles){ _metadata_handles = handles; }
 509 
 510   // Thread-Local Allocation Buffer (TLAB) support
 511   ThreadLocalAllocBuffer& tlab()                 { return _tlab; }
 512   void initialize_tlab() {
 513     if (UseTLAB) {
 514       tlab().initialize();
 515     }
 516   }
 517 
 518   jlong allocated_bytes()               { return _allocated_bytes; }
 519   void set_allocated_bytes(jlong value) { _allocated_bytes = value; }
 520   void incr_allocated_bytes(jlong size) { _allocated_bytes += size; }
 521   inline jlong cooked_allocated_bytes();
 522 
 523   ThreadStatisticInfo& statistic_info() { return _statistic_info; }
 524 
 525   JFR_ONLY(DEFINE_THREAD_LOCAL_ACCESSOR_JFR;)
 526 
 527   bool is_trace_suspend()               { return (_suspend_flags & _trace_flag) != 0; }
 528 
 529   // VM operation support
 530   int vm_operation_ticket()                      { return ++_vm_operation_started_count; }
 531   int vm_operation_completed_count()             { return _vm_operation_completed_count; }
 532   void increment_vm_operation_completed_count()  { _vm_operation_completed_count++; }
 533 
 534   // For tracking the heavyweight monitor the thread is pending on.
 535   ObjectMonitor* current_pending_monitor() {
 536     return _current_pending_monitor;
 537   }
 538   void set_current_pending_monitor(ObjectMonitor* monitor) {
 539     _current_pending_monitor = monitor;
 540   }
 541   void set_current_pending_monitor_is_from_java(bool from_java) {
 542     _current_pending_monitor_is_from_java = from_java;
 543   }
 544   bool current_pending_monitor_is_from_java() {


< prev index next >