< prev index next >

src/share/vm/runtime/thread.hpp

Print this page




 249   // If !allow_allocation(), then an assertion failure will happen during allocation
 250   // (Hence, !allow_safepoint() => !allow_allocation()).
 251   //
 252   // The two classes No_Safepoint_Verifier and No_Allocation_Verifier are used to set these counters.
 253   //
 254   NOT_PRODUCT(int _allow_safepoint_count;)      // If 0, thread allow a safepoint to happen
 255   debug_only(int _allow_allocation_count;)     // If 0, the thread is allowed to allocate oops.
 256 
 257   // Used by SkipGCALot class.
 258   NOT_PRODUCT(bool _skip_gcalot;)               // Should we elide gc-a-lot?
 259 
 260   friend class No_Alloc_Verifier;
 261   friend class No_Safepoint_Verifier;
 262   friend class Pause_No_Safepoint_Verifier;
 263   friend class ThreadLocalStorage;
 264   friend class GC_locker;
 265 
 266   ThreadLocalAllocBuffer _tlab;                 // Thread-local eden
 267   jlong _allocated_bytes;                       // Cumulative number of bytes allocated on
 268                                                 // the Java heap
 269   uint _gc_id;                                  // The current GC id when a thread takes part in GC
 270 
 271   TRACE_DATA _trace_data;                       // Thread-local data for tracing
 272 
 273   ThreadExt _ext;
 274 
 275   int   _vm_operation_started_count;            // VM_Operation support
 276   int   _vm_operation_completed_count;          // VM_Operation support
 277 
 278   ObjectMonitor* _current_pending_monitor;      // ObjectMonitor this thread
 279                                                 // is waiting to lock
 280   bool _current_pending_monitor_is_from_java;   // locking is from Java code
 281 
 282   // ObjectMonitor on which this thread called Object.wait()
 283   ObjectMonitor* _current_waiting_monitor;
 284 
 285   // Private thread-local objectmonitor list - a simple cache organized as a SLL.
 286  public:
 287   ObjectMonitor* omFreeList;
 288   int omFreeCount;                              // length of omFreeList
 289   int omFreeProvision;                          // reload chunk size


 408 
 409   // Internal handle support
 410   HandleArea* handle_area() const                { return _handle_area; }
 411   void set_handle_area(HandleArea* area)         { _handle_area = area; }
 412 
 413   GrowableArray<Metadata*>* metadata_handles() const          { return _metadata_handles; }
 414   void set_metadata_handles(GrowableArray<Metadata*>* handles){ _metadata_handles = handles; }
 415 
 416   // Thread-Local Allocation Buffer (TLAB) support
 417   ThreadLocalAllocBuffer& tlab()                 { return _tlab; }
 418   void initialize_tlab() {
 419     if (UseTLAB) {
 420       tlab().initialize();
 421     }
 422   }
 423 
 424   jlong allocated_bytes()               { return _allocated_bytes; }
 425   void set_allocated_bytes(jlong value) { _allocated_bytes = value; }
 426   void incr_allocated_bytes(jlong size) { _allocated_bytes += size; }
 427   inline jlong cooked_allocated_bytes();
 428 
 429   void set_gc_id(uint gc_id) { _gc_id = gc_id; }
 430   uint gc_id() { return _gc_id; }
 431 
 432   TRACE_DATA* trace_data()              { return &_trace_data; }
 433 
 434   const ThreadExt& ext() const          { return _ext; }
 435   ThreadExt& ext()                      { return _ext; }
 436 
 437   // VM operation support
 438   int vm_operation_ticket()                      { return ++_vm_operation_started_count; }
 439   int vm_operation_completed_count()             { return _vm_operation_completed_count; }
 440   void increment_vm_operation_completed_count()  { _vm_operation_completed_count++; }
 441 
 442   // For tracking the heavyweight monitor the thread is pending on.
 443   ObjectMonitor* current_pending_monitor() {
 444     return _current_pending_monitor;
 445   }
 446   void set_current_pending_monitor(ObjectMonitor* monitor) {
 447     _current_pending_monitor = monitor;
 448   }
 449   void set_current_pending_monitor_is_from_java(bool from_java) {
 450     _current_pending_monitor_is_from_java = from_java;




 249   // If !allow_allocation(), then an assertion failure will happen during allocation
 250   // (Hence, !allow_safepoint() => !allow_allocation()).
 251   //
 252   // The two classes No_Safepoint_Verifier and No_Allocation_Verifier are used to set these counters.
 253   //
 254   NOT_PRODUCT(int _allow_safepoint_count;)      // If 0, thread allow a safepoint to happen
 255   debug_only(int _allow_allocation_count;)     // If 0, the thread is allowed to allocate oops.
 256 
 257   // Used by SkipGCALot class.
 258   NOT_PRODUCT(bool _skip_gcalot;)               // Should we elide gc-a-lot?
 259 
 260   friend class No_Alloc_Verifier;
 261   friend class No_Safepoint_Verifier;
 262   friend class Pause_No_Safepoint_Verifier;
 263   friend class ThreadLocalStorage;
 264   friend class GC_locker;
 265 
 266   ThreadLocalAllocBuffer _tlab;                 // Thread-local eden
 267   jlong _allocated_bytes;                       // Cumulative number of bytes allocated on
 268                                                 // the Java heap

 269 
 270   TRACE_DATA _trace_data;                       // Thread-local data for tracing
 271 
 272   ThreadExt _ext;
 273 
 274   int   _vm_operation_started_count;            // VM_Operation support
 275   int   _vm_operation_completed_count;          // VM_Operation support
 276 
 277   ObjectMonitor* _current_pending_monitor;      // ObjectMonitor this thread
 278                                                 // is waiting to lock
 279   bool _current_pending_monitor_is_from_java;   // locking is from Java code
 280 
 281   // ObjectMonitor on which this thread called Object.wait()
 282   ObjectMonitor* _current_waiting_monitor;
 283 
 284   // Private thread-local objectmonitor list - a simple cache organized as a SLL.
 285  public:
 286   ObjectMonitor* omFreeList;
 287   int omFreeCount;                              // length of omFreeList
 288   int omFreeProvision;                          // reload chunk size


 407 
 408   // Internal handle support
 409   HandleArea* handle_area() const                { return _handle_area; }
 410   void set_handle_area(HandleArea* area)         { _handle_area = area; }
 411 
 412   GrowableArray<Metadata*>* metadata_handles() const          { return _metadata_handles; }
 413   void set_metadata_handles(GrowableArray<Metadata*>* handles){ _metadata_handles = handles; }
 414 
 415   // Thread-Local Allocation Buffer (TLAB) support
 416   ThreadLocalAllocBuffer& tlab()                 { return _tlab; }
 417   void initialize_tlab() {
 418     if (UseTLAB) {
 419       tlab().initialize();
 420     }
 421   }
 422 
 423   jlong allocated_bytes()               { return _allocated_bytes; }
 424   void set_allocated_bytes(jlong value) { _allocated_bytes = value; }
 425   void incr_allocated_bytes(jlong size) { _allocated_bytes += size; }
 426   inline jlong cooked_allocated_bytes();



 427 
 428   TRACE_DATA* trace_data()              { return &_trace_data; }
 429 
 430   const ThreadExt& ext() const          { return _ext; }
 431   ThreadExt& ext()                      { return _ext; }
 432 
 433   // VM operation support
 434   int vm_operation_ticket()                      { return ++_vm_operation_started_count; }
 435   int vm_operation_completed_count()             { return _vm_operation_completed_count; }
 436   void increment_vm_operation_completed_count()  { _vm_operation_completed_count++; }
 437 
 438   // For tracking the heavyweight monitor the thread is pending on.
 439   ObjectMonitor* current_pending_monitor() {
 440     return _current_pending_monitor;
 441   }
 442   void set_current_pending_monitor(ObjectMonitor* monitor) {
 443     _current_pending_monitor = monitor;
 444   }
 445   void set_current_pending_monitor_is_from_java(bool from_java) {
 446     _current_pending_monitor_is_from_java = from_java;


< prev index next >