< prev index next >

src/share/vm/compiler/compileTask.hpp

Print this page


   1 /*
   2  * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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  *


 113   void initialize(int compile_id, const methodHandle& method, int osr_bci, int comp_level,
 114                   const methodHandle& hot_method, int hot_count,
 115                   CompileTask::CompileReason compile_reason, bool is_blocking);
 116 
 117   static CompileTask* allocate();
 118   static void         free(CompileTask* task);
 119 
 120   int          compile_id() const                { return _compile_id; }
 121   Method*      method() const                    { return _method; }
 122   Method*      hot_method() const                { return _hot_method; }
 123   int          osr_bci() const                   { return _osr_bci; }
 124   bool         is_complete() const               { return _is_complete; }
 125   bool         is_blocking() const               { return _is_blocking; }
 126   bool         is_success() const                { return _is_success; }
 127   bool         can_become_stale() const          {
 128     switch (_compile_reason) {
 129       case Reason_BackedgeCount:
 130       case Reason_InvocationCount:
 131       case Reason_Tiered:
 132         return !_is_blocking;
 133     }
 134     return false;
 135   }

 136 #if INCLUDE_JVMCI
 137   bool         has_waiter() const                { return _has_waiter; }
 138   void         clear_waiter()                    { _has_waiter = false; }
 139   CompilerThread* jvmci_compiler_thread() const  { return _jvmci_compiler_thread; }
 140   void         set_jvmci_compiler_thread(CompilerThread* t) {
 141     assert(is_blocking(), "must be");
 142     assert((t == NULL) != (_jvmci_compiler_thread == NULL), "must be");
 143     _jvmci_compiler_thread = t;
 144   }
 145 #endif
 146 
 147   nmethodLocker* code_handle() const             { return _code_handle; }
 148   void         set_code_handle(nmethodLocker* l) { _code_handle = l; }
 149   nmethod*     code() const;                     // _code_handle->code()
 150   void         set_code(nmethod* nm);            // _code_handle->set_code(nm)
 151 
 152   Monitor*     lock() const                      { return _lock; }
 153 
 154   void         mark_complete()                   { _is_complete = true; }
 155   void         mark_success()                    { _is_success = true; }


   1 /*
   2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  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  *


 113   void initialize(int compile_id, const methodHandle& method, int osr_bci, int comp_level,
 114                   const methodHandle& hot_method, int hot_count,
 115                   CompileTask::CompileReason compile_reason, bool is_blocking);
 116 
 117   static CompileTask* allocate();
 118   static void         free(CompileTask* task);
 119 
 120   int          compile_id() const                { return _compile_id; }
 121   Method*      method() const                    { return _method; }
 122   Method*      hot_method() const                { return _hot_method; }
 123   int          osr_bci() const                   { return _osr_bci; }
 124   bool         is_complete() const               { return _is_complete; }
 125   bool         is_blocking() const               { return _is_blocking; }
 126   bool         is_success() const                { return _is_success; }
 127   bool         can_become_stale() const          {
 128     switch (_compile_reason) {
 129       case Reason_BackedgeCount:
 130       case Reason_InvocationCount:
 131       case Reason_Tiered:
 132         return !_is_blocking;
 133       default:
 134         return false;
 135     }
 136   }
 137 #if INCLUDE_JVMCI
 138   bool         has_waiter() const                { return _has_waiter; }
 139   void         clear_waiter()                    { _has_waiter = false; }
 140   CompilerThread* jvmci_compiler_thread() const  { return _jvmci_compiler_thread; }
 141   void         set_jvmci_compiler_thread(CompilerThread* t) {
 142     assert(is_blocking(), "must be");
 143     assert((t == NULL) != (_jvmci_compiler_thread == NULL), "must be");
 144     _jvmci_compiler_thread = t;
 145   }
 146 #endif
 147 
 148   nmethodLocker* code_handle() const             { return _code_handle; }
 149   void         set_code_handle(nmethodLocker* l) { _code_handle = l; }
 150   nmethod*     code() const;                     // _code_handle->code()
 151   void         set_code(nmethod* nm);            // _code_handle->set_code(nm)
 152 
 153   Monitor*     lock() const                      { return _lock; }
 154 
 155   void         mark_complete()                   { _is_complete = true; }
 156   void         mark_success()                    { _is_success = true; }


< prev index next >