< prev index next >

src/hotspot/share/runtime/thread.hpp

Print this page
rev 49289 : 8198756: Lazy allocation of compiler threads
Reviewed-by:


2028 
2029 // A thread used for Compilation.
2030 class CompilerThread : public JavaThread {
2031   friend class VMStructs;
2032  private:
2033   CompilerCounters* _counters;
2034 
2035   ciEnv*                _env;
2036   CompileLog*           _log;
2037   CompileTask* volatile _task;  // print_threads_compiling can read this concurrently.
2038   CompileQueue*         _queue;
2039   BufferBlob*           _buffer_blob;
2040 
2041   AbstractCompiler*     _compiler;
2042 
2043  public:
2044 
2045   static CompilerThread* current();
2046 
2047   CompilerThread(CompileQueue* queue, CompilerCounters* counters);

2048 
2049   bool is_Compiler_thread() const                { return true; }
2050 
2051   virtual bool can_call_java() const;
2052 
2053   // Hide native compiler threads from external view.
2054   bool is_hidden_from_external_view() const      { return !can_call_java(); }
2055 
2056   void set_compiler(AbstractCompiler* c)         { _compiler = c; }
2057   AbstractCompiler* compiler() const             { return _compiler; }
2058 
2059   CompileQueue* queue()        const             { return _queue; }
2060   CompilerCounters* counters() const             { return _counters; }
2061 
2062   // Get/set the thread's compilation environment.
2063   ciEnv*        env()                            { return _env; }
2064   void          set_env(ciEnv* env)              { _env = env; }
2065 
2066   BufferBlob*   get_buffer_blob() const          { return _buffer_blob; }
2067   void          set_buffer_blob(BufferBlob* b)   { _buffer_blob = b; }




2028 
2029 // A thread used for Compilation.
2030 class CompilerThread : public JavaThread {
2031   friend class VMStructs;
2032  private:
2033   CompilerCounters* _counters;
2034 
2035   ciEnv*                _env;
2036   CompileLog*           _log;
2037   CompileTask* volatile _task;  // print_threads_compiling can read this concurrently.
2038   CompileQueue*         _queue;
2039   BufferBlob*           _buffer_blob;
2040 
2041   AbstractCompiler*     _compiler;
2042 
2043  public:
2044 
2045   static CompilerThread* current();
2046 
2047   CompilerThread(CompileQueue* queue, CompilerCounters* counters);
2048   ~CompilerThread();
2049 
2050   bool is_Compiler_thread() const                { return true; }
2051 
2052   virtual bool can_call_java() const;
2053 
2054   // Hide native compiler threads from external view.
2055   bool is_hidden_from_external_view() const      { return !can_call_java(); }
2056 
2057   void set_compiler(AbstractCompiler* c)         { _compiler = c; }
2058   AbstractCompiler* compiler() const             { return _compiler; }
2059 
2060   CompileQueue* queue()        const             { return _queue; }
2061   CompilerCounters* counters() const             { return _counters; }
2062 
2063   // Get/set the thread's compilation environment.
2064   ciEnv*        env()                            { return _env; }
2065   void          set_env(ciEnv* env)              { _env = env; }
2066 
2067   BufferBlob*   get_buffer_blob() const          { return _buffer_blob; }
2068   void          set_buffer_blob(BufferBlob* b)   { _buffer_blob = b; }


< prev index next >