src/share/vm/compiler/compileBroker.hpp

Print this page
rev 4773 : 8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
   1 /*
   2  * Copyright (c) 1999, 2012, 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  *


 282   static PerfCounter* _perf_total_standard_compile_count;
 283 
 284   static PerfCounter* _perf_sum_osr_bytes_compiled;
 285   static PerfCounter* _perf_sum_standard_bytes_compiled;
 286   static PerfCounter* _perf_sum_nmethod_size;
 287   static PerfCounter* _perf_sum_nmethod_code_size;
 288 
 289   static PerfStringVariable* _perf_last_method;
 290   static PerfStringVariable* _perf_last_failed_method;
 291   static PerfStringVariable* _perf_last_invalidated_method;
 292   static PerfVariable*       _perf_last_compile_type;
 293   static PerfVariable*       _perf_last_compile_size;
 294   static PerfVariable*       _perf_last_failed_type;
 295   static PerfVariable*       _perf_last_invalidated_type;
 296 
 297   // Timers and counters for generating statistics
 298   static elapsedTimer _t_total_compilation;
 299   static elapsedTimer _t_osr_compilation;
 300   static elapsedTimer _t_standard_compilation;
 301 

 302   static int _total_bailout_count;
 303   static int _total_invalidated_count;
 304   static int _total_compile_count;
 305   static int _total_native_compile_count;
 306   static int _total_osr_compile_count;
 307   static int _total_standard_compile_count;
 308 
 309   static int _sum_osr_bytes_compiled;
 310   static int _sum_standard_bytes_compiled;
 311   static int _sum_nmethod_size;
 312   static int _sum_nmethod_code_size;

 313 
 314   static CompilerThread* make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, TRAPS);
 315   static void init_compiler_threads(int c1_compiler_count, int c2_compiler_count);
 316   static bool compilation_is_complete  (methodHandle method, int osr_bci, int comp_level);
 317   static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level);
 318   static uint assign_compile_id        (methodHandle method, int osr_bci);
 319   static bool is_compile_blocking      (methodHandle method, int osr_bci);
 320   static void preload_classes          (methodHandle method, TRAPS);
 321 
 322   static CompileTask* create_compile_task(CompileQueue* queue,
 323                                           int           compile_id,
 324                                           methodHandle  method,
 325                                           int           osr_bci,
 326                                           int           comp_level,
 327                                           methodHandle  hot_method,
 328                                           int           hot_count,
 329                                           const char*   comment,
 330                                           bool          blocking);
 331   static CompileTask* allocate_task();
 332   static void free_task(CompileTask* task);


 404   static void handle_full_code_cache();
 405 
 406   // Return total compilation ticks
 407   static jlong total_compilation_ticks() {
 408     return _perf_total_compilation != NULL ? _perf_total_compilation->get_value() : 0;
 409   }
 410 
 411   // Redefine Classes support
 412   static void mark_on_stack();
 413 
 414   // Print a detailed accounting of compilation time
 415   static void print_times();
 416 
 417   // Debugging output for failure
 418   static void print_last_compile();
 419 
 420   static void print_compiler_threads_on(outputStream* st);
 421 
 422   // compiler name for debugging
 423   static const char* compiler_name(int comp_level);













 424 };
 425 
 426 #endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP
   1 /*
   2  * Copyright (c) 1999, 2013, 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  *


 282   static PerfCounter* _perf_total_standard_compile_count;
 283 
 284   static PerfCounter* _perf_sum_osr_bytes_compiled;
 285   static PerfCounter* _perf_sum_standard_bytes_compiled;
 286   static PerfCounter* _perf_sum_nmethod_size;
 287   static PerfCounter* _perf_sum_nmethod_code_size;
 288 
 289   static PerfStringVariable* _perf_last_method;
 290   static PerfStringVariable* _perf_last_failed_method;
 291   static PerfStringVariable* _perf_last_invalidated_method;
 292   static PerfVariable*       _perf_last_compile_type;
 293   static PerfVariable*       _perf_last_compile_size;
 294   static PerfVariable*       _perf_last_failed_type;
 295   static PerfVariable*       _perf_last_invalidated_type;
 296 
 297   // Timers and counters for generating statistics
 298   static elapsedTimer _t_total_compilation;
 299   static elapsedTimer _t_osr_compilation;
 300   static elapsedTimer _t_standard_compilation;
 301 
 302   static int _total_compile_count;
 303   static int _total_bailout_count;
 304   static int _total_invalidated_count;

 305   static int _total_native_compile_count;
 306   static int _total_osr_compile_count;
 307   static int _total_standard_compile_count;

 308   static int _sum_osr_bytes_compiled;
 309   static int _sum_standard_bytes_compiled;
 310   static int _sum_nmethod_size;
 311   static int _sum_nmethod_code_size;
 312   static long _peak_compilation_time;
 313 
 314   static CompilerThread* make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, TRAPS);
 315   static void init_compiler_threads(int c1_compiler_count, int c2_compiler_count);
 316   static bool compilation_is_complete  (methodHandle method, int osr_bci, int comp_level);
 317   static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level);
 318   static uint assign_compile_id        (methodHandle method, int osr_bci);
 319   static bool is_compile_blocking      (methodHandle method, int osr_bci);
 320   static void preload_classes          (methodHandle method, TRAPS);
 321 
 322   static CompileTask* create_compile_task(CompileQueue* queue,
 323                                           int           compile_id,
 324                                           methodHandle  method,
 325                                           int           osr_bci,
 326                                           int           comp_level,
 327                                           methodHandle  hot_method,
 328                                           int           hot_count,
 329                                           const char*   comment,
 330                                           bool          blocking);
 331   static CompileTask* allocate_task();
 332   static void free_task(CompileTask* task);


 404   static void handle_full_code_cache();
 405 
 406   // Return total compilation ticks
 407   static jlong total_compilation_ticks() {
 408     return _perf_total_compilation != NULL ? _perf_total_compilation->get_value() : 0;
 409   }
 410 
 411   // Redefine Classes support
 412   static void mark_on_stack();
 413 
 414   // Print a detailed accounting of compilation time
 415   static void print_times();
 416 
 417   // Debugging output for failure
 418   static void print_last_compile();
 419 
 420   static void print_compiler_threads_on(outputStream* st);
 421 
 422   // compiler name for debugging
 423   static const char* compiler_name(int comp_level);
 424 
 425   static int get_total_compile_count() {          return _total_compile_count; }
 426   static int get_total_bailout_count() {          return _total_bailout_count; }
 427   static int get_total_invalidated_count() {      return _total_invalidated_count; }
 428   static int get_total_native_compile_count() {   return _total_native_compile_count; }
 429   static int get_total_osr_compile_count() {      return _total_osr_compile_count; }
 430   static int get_total_standard_compile_count() { return _total_standard_compile_count; }
 431   static int get_sum_osr_bytes_compiled() {       return _sum_osr_bytes_compiled; }
 432   static int get_sum_standard_bytes_compiled() {  return _sum_standard_bytes_compiled; }
 433   static int get_sum_nmethod_size() {             return _sum_nmethod_size;}
 434   static int get_sum_nmethod_code_size() {        return _sum_nmethod_code_size; }
 435   static long get_peak_compilation_time() {       return _peak_compilation_time; }
 436   static long get_total_compilation_time() {      return _t_total_compilation.milliseconds(); }
 437 };
 438 
 439 #endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP