src/share/vm/runtime/thread.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 6996747 Sdiff src/share/vm/runtime

src/share/vm/runtime/thread.hpp

Print this page




 422     _current_pending_monitor = monitor;
 423   }
 424   void set_current_pending_monitor_is_from_java(bool from_java) {
 425     _current_pending_monitor_is_from_java = from_java;
 426   }
 427   bool current_pending_monitor_is_from_java() {
 428     return _current_pending_monitor_is_from_java;
 429   }
 430 
 431   // For tracking the ObjectMonitor on which this thread called Object.wait()
 432   ObjectMonitor* current_waiting_monitor() {
 433     return _current_waiting_monitor;
 434   }
 435   void set_current_waiting_monitor(ObjectMonitor* monitor) {
 436     _current_waiting_monitor = monitor;
 437   }
 438 
 439   // GC support
 440   // Apply "f->do_oop" to all root oops in "this".
 441   // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
 442   void oops_do(OopClosure* f, CodeBlobClosure* cf);
 443 
 444   // Handles the parallel case for the method below.
 445 private:
 446   bool claim_oops_do_par_case(int collection_parity);
 447 public:
 448   // Requires that "collection_parity" is that of the current strong roots
 449   // iteration.  If "is_par" is false, sets the parity of "this" to
 450   // "collection_parity", and returns "true".  If "is_par" is true,
 451   // uses an atomic instruction to set the current threads parity to
 452   // "collection_parity", if it is not already.  Returns "true" iff the
 453   // calling thread does the update, this indicates that the calling thread
 454   // has claimed the thread's stack as a root groop in the current
 455   // collection.
 456   bool claim_oops_do(bool is_par, int collection_parity) {
 457     if (!is_par) {
 458       _oops_do_parity = collection_parity;
 459       return true;
 460     } else {
 461       return claim_oops_do_par_case(collection_parity);
 462     }


1681   if ( _stack_guard_state == stack_guard_unused) {
1682     low_addr =  stack_base() - stack_size();
1683   } else {
1684     low_addr = stack_yellow_zone_base();
1685   }
1686   return cur_sp > low_addr ? cur_sp - low_addr : 0;
1687 }
1688 
1689 // A thread used for Compilation.
1690 class CompilerThread : public JavaThread {
1691   friend class VMStructs;
1692  private:
1693   CompilerCounters* _counters;
1694 
1695   ciEnv*        _env;
1696   CompileLog*   _log;
1697   CompileTask*  _task;
1698   CompileQueue* _queue;
1699   BufferBlob*   _buffer_blob;
1700 


1701  public:
1702 
1703   static CompilerThread* current();
1704 
1705   CompilerThread(CompileQueue* queue, CompilerCounters* counters);
1706 
1707   bool is_Compiler_thread() const                { return true; }
1708   // Hide this compiler thread from external view.
1709   bool is_hidden_from_external_view() const      { return true; }
1710 
1711   CompileQueue* queue()                          { return _queue; }
1712   CompilerCounters* counters()                   { return _counters; }
1713 
1714   // Get/set the thread's compilation environment.
1715   ciEnv*        env()                            { return _env; }
1716   void          set_env(ciEnv* env)              { _env = env; }
1717 
1718   BufferBlob*   get_buffer_blob()                { return _buffer_blob; }
1719   void          set_buffer_blob(BufferBlob* b)   { _buffer_blob = b; };
1720 
1721   // Get/set the thread's logging information
1722   CompileLog*   log()                            { return _log; }
1723   void          init_log(CompileLog* log) {
1724     // Set once, for good.
1725     assert(_log == NULL, "set only once");
1726     _log = log;
1727   }
1728 





1729 #ifndef PRODUCT
1730 private:
1731   IdealGraphPrinter *_ideal_graph_printer;
1732 public:
1733   IdealGraphPrinter *ideal_graph_printer()                       { return _ideal_graph_printer; }
1734   void set_ideal_graph_printer(IdealGraphPrinter *n)             { _ideal_graph_printer = n; }
1735 #endif
1736 
1737   // Get/set the thread's current task
1738   CompileTask*  task()                           { return _task; }
1739   void          set_task(CompileTask* task)      { _task = task; }






1740 };
1741 
1742 inline CompilerThread* CompilerThread::current() {
1743   return JavaThread::current()->as_CompilerThread();
1744 }
1745 
1746 
1747 // The active thread queue. It also keeps track of the current used
1748 // thread priorities.
1749 class Threads: AllStatic {
1750   friend class VMStructs;
1751  private:
1752   static JavaThread* _thread_list;
1753   static int         _number_of_threads;
1754   static int         _number_of_non_daemon_threads;
1755   static int         _return_code;
1756 
1757  public:
1758   // Thread management
1759   // force_daemon is a concession to JNI, where we may need to add a




 422     _current_pending_monitor = monitor;
 423   }
 424   void set_current_pending_monitor_is_from_java(bool from_java) {
 425     _current_pending_monitor_is_from_java = from_java;
 426   }
 427   bool current_pending_monitor_is_from_java() {
 428     return _current_pending_monitor_is_from_java;
 429   }
 430 
 431   // For tracking the ObjectMonitor on which this thread called Object.wait()
 432   ObjectMonitor* current_waiting_monitor() {
 433     return _current_waiting_monitor;
 434   }
 435   void set_current_waiting_monitor(ObjectMonitor* monitor) {
 436     _current_waiting_monitor = monitor;
 437   }
 438 
 439   // GC support
 440   // Apply "f->do_oop" to all root oops in "this".
 441   // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
 442   virtual void oops_do(OopClosure* f, CodeBlobClosure* cf);
 443 
 444   // Handles the parallel case for the method below.
 445 private:
 446   bool claim_oops_do_par_case(int collection_parity);
 447 public:
 448   // Requires that "collection_parity" is that of the current strong roots
 449   // iteration.  If "is_par" is false, sets the parity of "this" to
 450   // "collection_parity", and returns "true".  If "is_par" is true,
 451   // uses an atomic instruction to set the current threads parity to
 452   // "collection_parity", if it is not already.  Returns "true" iff the
 453   // calling thread does the update, this indicates that the calling thread
 454   // has claimed the thread's stack as a root groop in the current
 455   // collection.
 456   bool claim_oops_do(bool is_par, int collection_parity) {
 457     if (!is_par) {
 458       _oops_do_parity = collection_parity;
 459       return true;
 460     } else {
 461       return claim_oops_do_par_case(collection_parity);
 462     }


1681   if ( _stack_guard_state == stack_guard_unused) {
1682     low_addr =  stack_base() - stack_size();
1683   } else {
1684     low_addr = stack_yellow_zone_base();
1685   }
1686   return cur_sp > low_addr ? cur_sp - low_addr : 0;
1687 }
1688 
1689 // A thread used for Compilation.
1690 class CompilerThread : public JavaThread {
1691   friend class VMStructs;
1692  private:
1693   CompilerCounters* _counters;
1694 
1695   ciEnv*        _env;
1696   CompileLog*   _log;
1697   CompileTask*  _task;
1698   CompileQueue* _queue;
1699   BufferBlob*   _buffer_blob;
1700 
1701   nmethod*      _scanned_nmethod;  // nmethod being scanned by the sweeper
1702 
1703  public:
1704 
1705   static CompilerThread* current();
1706 
1707   CompilerThread(CompileQueue* queue, CompilerCounters* counters);
1708 
1709   bool is_Compiler_thread() const                { return true; }
1710   // Hide this compiler thread from external view.
1711   bool is_hidden_from_external_view() const      { return true; }
1712 
1713   CompileQueue* queue()                          { return _queue; }
1714   CompilerCounters* counters()                   { return _counters; }
1715 
1716   // Get/set the thread's compilation environment.
1717   ciEnv*        env()                            { return _env; }
1718   void          set_env(ciEnv* env)              { _env = env; }
1719 
1720   BufferBlob*   get_buffer_blob()                { return _buffer_blob; }
1721   void          set_buffer_blob(BufferBlob* b)   { _buffer_blob = b; };
1722 
1723   // Get/set the thread's logging information
1724   CompileLog*   log()                            { return _log; }
1725   void          init_log(CompileLog* log) {
1726     // Set once, for good.
1727     assert(_log == NULL, "set only once");
1728     _log = log;
1729   }
1730 
1731   // GC support
1732   // Apply "f->do_oop" to all root oops in "this".
1733   // Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
1734   void oops_do(OopClosure* f, CodeBlobClosure* cf);
1735 
1736 #ifndef PRODUCT
1737 private:
1738   IdealGraphPrinter *_ideal_graph_printer;
1739 public:
1740   IdealGraphPrinter *ideal_graph_printer()                       { return _ideal_graph_printer; }
1741   void set_ideal_graph_printer(IdealGraphPrinter *n)             { _ideal_graph_printer = n; }
1742 #endif
1743 
1744   // Get/set the thread's current task
1745   CompileTask*  task()                           { return _task; }
1746   void          set_task(CompileTask* task)      { _task = task; }
1747 
1748   // Track the nmethod currently being scanned by the sweeper
1749   void          set_scanned_nmethod(nmethod* nm) {
1750     assert(_scanned_nmethod == NULL || nm == NULL, "should reset to NULL before writing a new value");
1751     _scanned_nmethod = nm;
1752   }
1753 };
1754 
1755 inline CompilerThread* CompilerThread::current() {
1756   return JavaThread::current()->as_CompilerThread();
1757 }
1758 
1759 
1760 // The active thread queue. It also keeps track of the current used
1761 // thread priorities.
1762 class Threads: AllStatic {
1763   friend class VMStructs;
1764  private:
1765   static JavaThread* _thread_list;
1766   static int         _number_of_threads;
1767   static int         _number_of_non_daemon_threads;
1768   static int         _return_code;
1769 
1770  public:
1771   // Thread management
1772   // force_daemon is a concession to JNI, where we may need to add a


src/share/vm/runtime/thread.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File