298 static PerfVariable* _perf_last_failed_type;
299 static PerfVariable* _perf_last_invalidated_type;
300
301 // Timers and counters for generating statistics
302 static elapsedTimer _t_total_compilation;
303 static elapsedTimer _t_osr_compilation;
304 static elapsedTimer _t_standard_compilation;
305
306 static int _total_compile_count;
307 static int _total_bailout_count;
308 static int _total_invalidated_count;
309 static int _total_native_compile_count;
310 static int _total_osr_compile_count;
311 static int _total_standard_compile_count;
312 static int _sum_osr_bytes_compiled;
313 static int _sum_standard_bytes_compiled;
314 static int _sum_nmethod_size;
315 static int _sum_nmethod_code_size;
316 static long _peak_compilation_time;
317
318 static CompilerThread* make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, AbstractCompiler* comp, TRAPS);
319 static void init_compiler_threads(int c1_compiler_count, int c2_compiler_count);
320 static bool compilation_is_complete (methodHandle method, int osr_bci, int comp_level);
321 static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level);
322 static uint assign_compile_id (methodHandle method, int osr_bci);
323 static bool is_compile_blocking (methodHandle method, int osr_bci);
324 static void preload_classes (methodHandle method, TRAPS);
325
326 static CompileTask* create_compile_task(CompileQueue* queue,
327 int compile_id,
328 methodHandle method,
329 int osr_bci,
330 int comp_level,
331 methodHandle hot_method,
332 int hot_count,
333 const char* comment,
334 bool blocking);
335 static CompileTask* allocate_task();
336 static void free_task(CompileTask* task);
337 static void wait_for_completion(CompileTask* task);
401 shutdown_compilaton = 2
402 };
403
404 static bool should_compile_new_jobs() { return UseCompiler && (_should_compile_new_jobs == run_compilation); }
405 static bool set_should_compile_new_jobs(jint new_state) {
406 // Return success if the current caller set it
407 jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state);
408 return (old == (1-new_state));
409 }
410
411 static void disable_compilation_forever() {
412 UseCompiler = false;
413 AlwaysCompileLoopMethods = false;
414 Atomic::xchg(shutdown_compilaton, &_should_compile_new_jobs);
415 }
416
417 static bool is_compilation_disabled_forever() {
418 return _should_compile_new_jobs == shutdown_compilaton;
419 }
420 static void handle_full_code_cache();
421
422 // Return total compilation ticks
423 static jlong total_compilation_ticks() {
424 return _perf_total_compilation != NULL ? _perf_total_compilation->get_value() : 0;
425 }
426
427 // Redefine Classes support
428 static void mark_on_stack();
429
430 // Print a detailed accounting of compilation time
431 static void print_times();
432
433 // Debugging output for failure
434 static void print_last_compile();
435
436 static void print_compiler_threads_on(outputStream* st);
437
438 // compiler name for debugging
439 static const char* compiler_name(int comp_level);
440
441 static int get_total_compile_count() { return _total_compile_count; }
|
298 static PerfVariable* _perf_last_failed_type;
299 static PerfVariable* _perf_last_invalidated_type;
300
301 // Timers and counters for generating statistics
302 static elapsedTimer _t_total_compilation;
303 static elapsedTimer _t_osr_compilation;
304 static elapsedTimer _t_standard_compilation;
305
306 static int _total_compile_count;
307 static int _total_bailout_count;
308 static int _total_invalidated_count;
309 static int _total_native_compile_count;
310 static int _total_osr_compile_count;
311 static int _total_standard_compile_count;
312 static int _sum_osr_bytes_compiled;
313 static int _sum_standard_bytes_compiled;
314 static int _sum_nmethod_size;
315 static int _sum_nmethod_code_size;
316 static long _peak_compilation_time;
317
318 static volatile jint _print_compilation_warning;
319
320 static CompilerThread* make_compiler_thread(const char* name, CompileQueue* queue, CompilerCounters* counters, AbstractCompiler* comp, TRAPS);
321 static void init_compiler_threads(int c1_compiler_count, int c2_compiler_count);
322 static bool compilation_is_complete (methodHandle method, int osr_bci, int comp_level);
323 static bool compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level);
324 static uint assign_compile_id (methodHandle method, int osr_bci);
325 static bool is_compile_blocking (methodHandle method, int osr_bci);
326 static void preload_classes (methodHandle method, TRAPS);
327
328 static CompileTask* create_compile_task(CompileQueue* queue,
329 int compile_id,
330 methodHandle method,
331 int osr_bci,
332 int comp_level,
333 methodHandle hot_method,
334 int hot_count,
335 const char* comment,
336 bool blocking);
337 static CompileTask* allocate_task();
338 static void free_task(CompileTask* task);
339 static void wait_for_completion(CompileTask* task);
403 shutdown_compilaton = 2
404 };
405
406 static bool should_compile_new_jobs() { return UseCompiler && (_should_compile_new_jobs == run_compilation); }
407 static bool set_should_compile_new_jobs(jint new_state) {
408 // Return success if the current caller set it
409 jint old = Atomic::cmpxchg(new_state, &_should_compile_new_jobs, 1-new_state);
410 return (old == (1-new_state));
411 }
412
413 static void disable_compilation_forever() {
414 UseCompiler = false;
415 AlwaysCompileLoopMethods = false;
416 Atomic::xchg(shutdown_compilaton, &_should_compile_new_jobs);
417 }
418
419 static bool is_compilation_disabled_forever() {
420 return _should_compile_new_jobs == shutdown_compilaton;
421 }
422 static void handle_full_code_cache();
423 // Ensures that warning is only printed once.
424 static bool should_print_compiler_warning() {
425 jint old = Atomic::cmpxchg(1, &_print_compilation_warning, 0);
426 return old == 0;
427 }
428 // Return total compilation ticks
429 static jlong total_compilation_ticks() {
430 return _perf_total_compilation != NULL ? _perf_total_compilation->get_value() : 0;
431 }
432
433 // Redefine Classes support
434 static void mark_on_stack();
435
436 // Print a detailed accounting of compilation time
437 static void print_times();
438
439 // Debugging output for failure
440 static void print_last_compile();
441
442 static void print_compiler_threads_on(outputStream* st);
443
444 // compiler name for debugging
445 static const char* compiler_name(int comp_level);
446
447 static int get_total_compile_count() { return _total_compile_count; }
|