1518 char *method_name = method->name_and_sig_as_C_string(); |
1518 char *method_name = method->name_and_sig_as_C_string(); |
1519 lt.print("Installing method (%d) %s [entry point: %p]", |
1519 lt.print("Installing method (%d) %s [entry point: %p]", |
1520 comp_level, method_name, nm->entry_point()); |
1520 comp_level, method_name, nm->entry_point()); |
1521 } |
1521 } |
1522 // Allow the code to be executed |
1522 // Allow the code to be executed |
1523 method->set_code(method, nm); |
1523 MutexLocker ml(CompiledMethod_lock, Mutex::_no_safepoint_check_flag); |
|
1524 if (nm->make_in_use()) { |
|
1525 method->set_code(method, nm); |
|
1526 } |
1524 } else { |
1527 } else { |
1525 LogTarget(Info, nmethod, install) lt; |
1528 LogTarget(Info, nmethod, install) lt; |
1526 if (lt.is_enabled()) { |
1529 if (lt.is_enabled()) { |
1527 ResourceMark rm; |
1530 ResourceMark rm; |
1528 char *method_name = method->name_and_sig_as_C_string(); |
1531 char *method_name = method->name_and_sig_as_C_string(); |
1529 lt.print("Installing osr method (%d) %s @ %d", |
1532 lt.print("Installing osr method (%d) %s @ %d", |
1530 comp_level, method_name, entry_bci); |
1533 comp_level, method_name, entry_bci); |
1531 } |
1534 } |
1532 InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm); |
1535 MutexLocker ml(CompiledMethod_lock, Mutex::_no_safepoint_check_flag); |
|
1536 if (nm->make_in_use()) { |
|
1537 InstanceKlass::cast(method->method_holder())->add_osr_nmethod(nm); |
|
1538 } |
1533 } |
1539 } |
1534 } else { |
1540 } else { |
1535 assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm, /* phantom_ref */ false) == HotSpotJVMCI::resolve(nmethod_mirror), "must be"); |
1541 assert(!nmethod_mirror.is_hotspot() || data->get_nmethod_mirror(nm, /* phantom_ref */ false) == HotSpotJVMCI::resolve(nmethod_mirror), "must be"); |
1536 } |
1542 } |
1537 nm->make_in_use(); |
|
1538 } |
1543 } |
1539 result = nm != NULL ? JVMCI::ok :JVMCI::cache_full; |
1544 result = nm != NULL ? JVMCI::ok :JVMCI::cache_full; |
1540 } |
1545 } |
1541 } |
1546 } |
1542 |
1547 |