550 // If there is an old version we're done with it
551 CompiledMethod* old = method->code();
552 if (TraceMethodReplacement && old != NULL) {
553 ResourceMark rm;
554 char *method_name = method->name_and_sig_as_C_string();
555 tty->print_cr("Replacing method %s", method_name);
556 }
557 if (old != NULL ) {
558 old->make_not_entrant();
559 }
560 }
561 if (TraceNMethodInstalls) {
562 ResourceMark rm;
563 char *method_name = method->name_and_sig_as_C_string();
564 ttyLocker ttyl;
565 tty->print_cr("Installing method (%d) %s [entry point: %p]",
566 comp_level,
567 method_name, nm->entry_point());
568 }
569 // Allow the code to be executed
570 method->set_code(method, nm);
571 } else {
572 if (TraceNMethodInstalls ) {
573 ResourceMark rm;
574 char *method_name = method->name_and_sig_as_C_string();
575 ttyLocker ttyl;
576 tty->print_cr("Installing osr method (%d) %s @ %d",
577 comp_level,
578 method_name,
579 entry_bci);
580 }
581 InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm);
582 }
583 }
584 }
585 result = nm != NULL ? JVMCIEnv::ok :JVMCIEnv::cache_full;
586 }
587 }
588
589 // String creation must be done outside lock
|
550 // If there is an old version we're done with it
551 CompiledMethod* old = method->code();
552 if (TraceMethodReplacement && old != NULL) {
553 ResourceMark rm;
554 char *method_name = method->name_and_sig_as_C_string();
555 tty->print_cr("Replacing method %s", method_name);
556 }
557 if (old != NULL ) {
558 old->make_not_entrant();
559 }
560 }
561 if (TraceNMethodInstalls) {
562 ResourceMark rm;
563 char *method_name = method->name_and_sig_as_C_string();
564 ttyLocker ttyl;
565 tty->print_cr("Installing method (%d) %s [entry point: %p]",
566 comp_level,
567 method_name, nm->entry_point());
568 }
569 // Allow the code to be executed
570 MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
571 method->set_code(method, nm);
572 } else {
573 if (TraceNMethodInstalls ) {
574 ResourceMark rm;
575 char *method_name = method->name_and_sig_as_C_string();
576 ttyLocker ttyl;
577 tty->print_cr("Installing osr method (%d) %s @ %d",
578 comp_level,
579 method_name,
580 entry_bci);
581 }
582 InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm);
583 }
584 }
585 }
586 result = nm != NULL ? JVMCIEnv::ok :JVMCIEnv::cache_full;
587 }
588 }
589
590 // String creation must be done outside lock
|