src/share/vm/compiler/compileBroker.hpp

Print this page




   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  *
  23  */
  24 







  25 class nmethod;
  26 class nmethodLocker;
  27 
  28 // CompileTask
  29 //
  30 // An entry in the compile queue.  It represents a pending or current
  31 // compilation.
  32 class CompileTask : public CHeapObj {
  33  private:
  34   Monitor*     _lock;
  35   uint         _compile_id;
  36   jobject      _method;
  37   int          _osr_bci;
  38   bool         _is_complete;
  39   bool         _is_success;
  40   bool         _is_blocking;
  41   int          _comp_level;
  42   int          _num_inlined_bytecodes;
  43   nmethodLocker* _code_handle;  // holder of eventual result
  44   CompileTask* _next, *_prev;


 363   static bool set_should_compile_new_jobs(jint new_state) {
 364     // Return success if the current caller set it
 365     jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state);
 366     return (old == (1-new_state));
 367   }
 368   static void handle_full_code_cache();
 369 
 370   // Return total compilation ticks
 371   static jlong total_compilation_ticks() {
 372     return _perf_total_compilation != NULL ? _perf_total_compilation->get_value() : 0;
 373   }
 374 
 375   // Print a detailed accounting of compilation time
 376   static void print_times();
 377 
 378   // Debugging output for failure
 379   static void print_last_compile();
 380 
 381   static void print_compiler_threads_on(outputStream* st);
 382 };




   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  *
  23  */
  24 
  25 #ifndef SHARE_VM_COMPILER_COMPILEBROKER_HPP
  26 #define SHARE_VM_COMPILER_COMPILEBROKER_HPP
  27 
  28 #include "ci/compilerInterface.hpp"
  29 #include "compiler/abstractCompiler.hpp"
  30 #include "runtime/perfData.hpp"
  31 
  32 class nmethod;
  33 class nmethodLocker;
  34 
  35 // CompileTask
  36 //
  37 // An entry in the compile queue.  It represents a pending or current
  38 // compilation.
  39 class CompileTask : public CHeapObj {
  40  private:
  41   Monitor*     _lock;
  42   uint         _compile_id;
  43   jobject      _method;
  44   int          _osr_bci;
  45   bool         _is_complete;
  46   bool         _is_success;
  47   bool         _is_blocking;
  48   int          _comp_level;
  49   int          _num_inlined_bytecodes;
  50   nmethodLocker* _code_handle;  // holder of eventual result
  51   CompileTask* _next, *_prev;


 370   static bool set_should_compile_new_jobs(jint new_state) {
 371     // Return success if the current caller set it
 372     jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state);
 373     return (old == (1-new_state));
 374   }
 375   static void handle_full_code_cache();
 376 
 377   // Return total compilation ticks
 378   static jlong total_compilation_ticks() {
 379     return _perf_total_compilation != NULL ? _perf_total_compilation->get_value() : 0;
 380   }
 381 
 382   // Print a detailed accounting of compilation time
 383   static void print_times();
 384 
 385   // Debugging output for failure
 386   static void print_last_compile();
 387 
 388   static void print_compiler_threads_on(outputStream* st);
 389 };
 390 
 391 #endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP