comparison src/share/vm/runtime/compilationPolicy.cpp @ 10640:88672775a26c

Compilation policy fixes and changed default compilation policy.
author Christian Haeubl <haeubl@ssw.jku.at>
date Mon, 08 Jul 2013 16:55:28 +0200
parents 36bcc10e01c0
children a9b76e1e5ab3
comparison
equal deleted inserted replaced
10639:08e06d4a9e73 10640:88672775a26c
452 reset_counter_for_invocation_event(m); 452 reset_counter_for_invocation_event(m);
453 const char* comment = "count"; 453 const char* comment = "count";
454 454
455 if (is_compilation_enabled() && can_be_compiled(m, comp_level)) { 455 if (is_compilation_enabled() && can_be_compiled(m, comp_level)) {
456 nmethod* nm = m->code(); 456 nmethod* nm = m->code();
457 #ifdef GRAALVM
458 if (m->queued_for_compilation()) {
459 delay_compilation(m());
460 } else
461 #endif
462 if (nm == NULL ) { 457 if (nm == NULL ) {
463 CompileBroker::compile_method(m, InvocationEntryBci, comp_level, m, hot_count, comment, thread); 458 CompileBroker::compile_method(m, InvocationEntryBci, comp_level, m, hot_count, comment, thread);
464 } 459 }
465 } 460 }
466 } 461 }
467 462
468 void SimpleCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) { 463 void SimpleCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) {
469 const int comp_level = CompLevel_highest_tier; 464 const int comp_level = CompLevel_highest_tier;
470 const int hot_count = m->backedge_count(); 465 const int hot_count = m->backedge_count();
471 const char* comment = "backedge_count"; 466 const char* comment = "backedge_count";
467 #ifdef GRAALVM
468 reset_counter_for_back_branch_event(m);
469 #endif
472 470
473 if (is_compilation_enabled() && !m->is_not_osr_compilable(comp_level) && can_be_compiled(m, comp_level)) { 471 if (is_compilation_enabled() && !m->is_not_osr_compilable(comp_level) && can_be_compiled(m, comp_level)) {
474 CompileBroker::compile_method(m, bci, comp_level, m, hot_count, comment, thread); 472 CompileBroker::compile_method(m, bci, comp_level, m, hot_count, comment, thread);
475 NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(bci, comp_level, true));) 473 NOT_PRODUCT(trace_osr_completion(m->lookup_osr_nmethod_for(bci, comp_level, true));)
476 } 474 }
511 if (time_per_call < mcs->graal_priority()) { 509 if (time_per_call < mcs->graal_priority()) {
512 mcs->set_graal_priority(time_per_call); 510 mcs->set_graal_priority(time_per_call);
513 } 511 }
514 } 512 }
515 } 513 }
516 514
517 if (!m->queued_for_compilation()) { 515 if (!m->queued_for_compilation()) {
518 if (TraceCompilationPolicy) { 516 if (TraceCompilationPolicy) {
519 tty->print("method invocation trigger: "); 517 tty->print("method invocation trigger: ");
520 m->print_short_name(tty); 518 m->print_short_name(tty);
521 tty->print_cr(" ( interpreted " INTPTR_FORMAT ", size=%d, hotCount=%d, hotTime=" UINT64_FORMAT " ) ", (address)m(), m->code_size(), hot_count, hot_time); 519 tty->print_cr(" ( interpreted " INTPTR_FORMAT ", size=%d, hotCount=%d, hotTime=" UINT64_FORMAT " ) ", (address)m(), m->code_size(), hot_count, hot_time);
529 } 527 }
530 528
531 void GraalCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) { 529 void GraalCompPolicy::method_back_branch_event(methodHandle m, int bci, JavaThread* thread) {
532 int hot_count = m->backedge_count(); 530 int hot_count = m->backedge_count();
533 const char* comment = "backedge_count"; 531 const char* comment = "backedge_count";
532 reset_counter_for_back_branch_event(m);
534 533
535 if (is_compilation_enabled() && !m->is_not_osr_compilable() && can_be_compiled(m) && !m->queued_for_compilation() && m->code() == NULL) { 534 if (is_compilation_enabled() && !m->is_not_osr_compilable() && can_be_compiled(m) && !m->queued_for_compilation() && m->code() == NULL) {
536 if (TraceCompilationPolicy) { 535 if (TraceCompilationPolicy) {
537 tty->print("backedge invocation trigger: "); 536 tty->print("backedge invocation trigger: ");
538 m->print_short_name(tty); 537 m->print_short_name(tty);