src/share/vm/compiler/compileTask.hpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/compiler

src/share/vm/compiler/compileTask.hpp

Print this page
rev 8995 : 8046155: JEP165: Compiler Control
Summary:
Reviewed-by:


  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_COMPILER_COMPILETASK_HPP
  26 #define SHARE_VM_COMPILER_COMPILETASK_HPP
  27 
  28 #include "code/nmethod.hpp"
  29 #include "ci/ciMethod.hpp"

  30 #include "compiler/compileLog.hpp"
  31 #include "memory/allocation.inline.hpp"
  32 #include "utilities/xmlstream.hpp"
  33 
  34 // CompileTask
  35 //
  36 // An entry in the compile queue.  It represents a pending or current
  37 // compilation.
  38 
  39 class CompileTask : public CHeapObj<mtCompiler> {
  40   friend class VMStructs;
  41 
  42  private:
  43   static CompileTask* _task_free_list;
  44 #ifdef ASSERT
  45   static int          _num_allocated_tasks;
  46 #endif
  47 
  48   Monitor*     _lock;
  49   uint         _compile_id;
  50   Method*      _method;
  51   jobject      _method_holder;
  52   int          _osr_bci;
  53   bool         _is_complete;
  54   bool         _is_success;
  55   bool         _is_blocking;
  56   int          _comp_level;
  57   int          _num_inlined_bytecodes;
  58   nmethodLocker* _code_handle;  // holder of eventual result
  59   CompileTask* _next, *_prev;
  60   bool         _is_free;
  61   // Fields used for logging why the compilation was initiated:
  62   jlong        _time_queued;  // in units of os::elapsed_counter()
  63   Method*      _hot_method;   // which method actually triggered this task
  64   jobject      _hot_method_holder;
  65   int          _hot_count;    // information about its invocation counter
  66   const char*  _comment;      // more info about the task
  67   const char*  _failure_reason;

  68 
  69  public:
  70   CompileTask() {
  71     _lock = new Monitor(Mutex::nonleaf+2, "CompileTaskLock");
  72   }
  73 
  74   void initialize(int compile_id, methodHandle method, int osr_bci, int comp_level,
  75                   methodHandle hot_method, int hot_count, const char* comment,
  76                   bool is_blocking);
  77 
  78   static CompileTask* allocate();
  79   static void         free(CompileTask* task);
  80 
  81   int          compile_id() const                { return _compile_id; }
  82   Method*      method() const                    { return _method; }
  83   Method*      hot_method() const                { return _hot_method; }
  84   int          osr_bci() const                   { return _osr_bci; }
  85   bool         is_complete() const               { return _is_complete; }
  86   bool         is_blocking() const               { return _is_blocking; }
  87   bool         is_success() const                { return _is_success; }




  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_COMPILER_COMPILETASK_HPP
  26 #define SHARE_VM_COMPILER_COMPILETASK_HPP
  27 
  28 #include "code/nmethod.hpp"
  29 #include "ci/ciMethod.hpp"
  30 #include "compiler/compilerDirectives.hpp"
  31 #include "compiler/compileLog.hpp"
  32 #include "memory/allocation.inline.hpp"
  33 #include "utilities/xmlstream.hpp"
  34 
  35 // CompileTask
  36 //
  37 // An entry in the compile queue.  It represents a pending or current
  38 // compilation.
  39 
  40 class CompileTask : public CHeapObj<mtCompiler> {
  41   friend class VMStructs;
  42 
  43  private:
  44   static CompileTask* _task_free_list;
  45 #ifdef ASSERT
  46   static int          _num_allocated_tasks;
  47 #endif
  48 
  49   Monitor*     _lock;
  50   uint         _compile_id;
  51   Method*      _method;
  52   jobject      _method_holder;
  53   int          _osr_bci;
  54   bool         _is_complete;
  55   bool         _is_success;
  56   bool         _is_blocking;
  57   int          _comp_level;
  58   int          _num_inlined_bytecodes;
  59   nmethodLocker* _code_handle;  // holder of eventual result
  60   CompileTask* _next, *_prev;
  61   bool         _is_free;
  62   // Fields used for logging why the compilation was initiated:
  63   jlong        _time_queued;  // in units of os::elapsed_counter()
  64   Method*      _hot_method;   // which method actually triggered this task
  65   jobject      _hot_method_holder;
  66   int          _hot_count;    // information about its invocation counter
  67   const char*  _comment;      // more info about the task
  68   const char*  _failure_reason;
  69   CompilerDirectives* _directives;
  70 
  71  public:
  72   CompileTask() {
  73     _lock = new Monitor(Mutex::nonleaf+2, "CompileTaskLock");
  74   }
  75 
  76   void initialize(int compile_id, methodHandle method, int osr_bci, int comp_level,
  77                   methodHandle hot_method, int hot_count, const char* comment,
  78                   bool is_blocking);
  79 
  80   static CompileTask* allocate();
  81   static void         free(CompileTask* task);
  82 
  83   int          compile_id() const                { return _compile_id; }
  84   Method*      method() const                    { return _method; }
  85   Method*      hot_method() const                { return _hot_method; }
  86   int          osr_bci() const                   { return _osr_bci; }
  87   bool         is_complete() const               { return _is_complete; }
  88   bool         is_blocking() const               { return _is_blocking; }
  89   bool         is_success() const                { return _is_success; }


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