src/hotspot/share/compiler/compileTask.hpp
changeset 54015 cd701366fcf8
parent 53417 126c5e7b97b1
child 54150 5529640c5f67
equal deleted inserted replaced
54014:083d7a34bbfd 54015:cd701366fcf8
    96   int          _num_inlined_bytecodes;
    96   int          _num_inlined_bytecodes;
    97   nmethodLocker* _code_handle;  // holder of eventual result
    97   nmethodLocker* _code_handle;  // holder of eventual result
    98   CompileTask* _next, *_prev;
    98   CompileTask* _next, *_prev;
    99   bool         _is_free;
    99   bool         _is_free;
   100   // Fields used for logging why the compilation was initiated:
   100   // Fields used for logging why the compilation was initiated:
   101   jlong        _time_queued;  // in units of os::elapsed_counter()
   101   jlong        _time_queued;  // time when task was enqueued
       
   102   jlong        _time_started; // time when compilation started
   102   Method*      _hot_method;   // which method actually triggered this task
   103   Method*      _hot_method;   // which method actually triggered this task
   103   jobject      _hot_method_holder;
   104   jobject      _hot_method_holder;
   104   int          _hot_count;    // information about its invocation counter
   105   int          _hot_count;    // information about its invocation counter
   105   CompileReason _compile_reason;      // more info about the task
   106   CompileReason _compile_reason;      // more info about the task
   106   const char*  _failure_reason;
   107   const char*  _failure_reason;
   154 
   155 
   155   Monitor*     lock() const                      { return _lock; }
   156   Monitor*     lock() const                      { return _lock; }
   156 
   157 
   157   void         mark_complete()                   { _is_complete = true; }
   158   void         mark_complete()                   { _is_complete = true; }
   158   void         mark_success()                    { _is_success = true; }
   159   void         mark_success()                    { _is_success = true; }
       
   160   void         mark_started(jlong time)          { _time_started = time; }
   159 
   161 
   160   int          comp_level()                      { return _comp_level;}
   162   int          comp_level()                      { return _comp_level;}
   161   void         set_comp_level(int comp_level)    { _comp_level = comp_level;}
   163   void         set_comp_level(int comp_level)    { _comp_level = comp_level;}
   162 
   164 
   163   AbstractCompiler* compiler();
   165   AbstractCompiler* compiler();
       
   166   CompileTask*      select_for_compilation();
   164 
   167 
   165   int          num_inlined_bytecodes() const     { return _num_inlined_bytecodes; }
   168   int          num_inlined_bytecodes() const     { return _num_inlined_bytecodes; }
   166   void         set_num_inlined_bytecodes(int n)  { _num_inlined_bytecodes = n; }
   169   void         set_num_inlined_bytecodes(int n)  { _num_inlined_bytecodes = n; }
   167 
   170 
   168   CompileTask* next() const                      { return _next; }
   171   CompileTask* next() const                      { return _next; }
   169   void         set_next(CompileTask* next)       { _next = next; }
   172   void         set_next(CompileTask* next)       { _next = next; }
   170   CompileTask* prev() const                      { return _prev; }
   173   CompileTask* prev() const                      { return _prev; }
   171   void         set_prev(CompileTask* prev)       { _prev = prev; }
   174   void         set_prev(CompileTask* prev)       { _prev = prev; }
   172   bool         is_free() const                   { return _is_free; }
   175   bool         is_free() const                   { return _is_free; }
   173   void         set_is_free(bool val)             { _is_free = val; }
   176   void         set_is_free(bool val)             { _is_free = val; }
       
   177   bool         is_unloaded() const;
   174 
   178 
   175   // RedefineClasses support
   179   // RedefineClasses support
   176   void         metadata_do(void f(Metadata*));
   180   void         metadata_do(void f(Metadata*));
   177   void         mark_on_stack();
   181   void         mark_on_stack();
   178 
   182 
   179 private:
   183 private:
   180   static void  print_impl(outputStream* st, Method* method, int compile_id, int comp_level,
   184   static void  print_impl(outputStream* st, Method* method, int compile_id, int comp_level,
   181                                       bool is_osr_method = false, int osr_bci = -1, bool is_blocking = false,
   185                                       bool is_osr_method = false, int osr_bci = -1, bool is_blocking = false,
   182                                       const char* msg = NULL, bool short_form = false, bool cr = true);
   186                                       const char* msg = NULL, bool short_form = false, bool cr = true,
       
   187                                       jlong time_queued = 0, jlong time_started = 0);
   183 
   188 
   184 public:
   189 public:
   185   void         print(outputStream* st = tty, const char* msg = NULL, bool short_form = false, bool cr = true);
   190   void         print(outputStream* st = tty, const char* msg = NULL, bool short_form = false, bool cr = true);
   186   void         print_ul(const char* msg = NULL);
   191   void         print_ul(const char* msg = NULL);
   187   static void  print(outputStream* st, const nmethod* nm, const char* msg = NULL, bool short_form = false, bool cr = true) {
   192   static void  print(outputStream* st, const nmethod* nm, const char* msg = NULL, bool short_form = false, bool cr = true) {