mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-20 11:04:34 +02:00
8028306: nsk stress tests, CodeCache fills, then safepoint asserts
Move handle_full_code_cache() out of block that forbids safepoints Reviewed-by: kvn, iveresov
This commit is contained in:
parent
26d3366a82
commit
901b435bc1
2 changed files with 15 additions and 16 deletions
|
@ -1003,21 +1003,15 @@ void ciEnv::register_method(ciMethod* target,
|
||||||
// Free codeBlobs
|
// Free codeBlobs
|
||||||
code_buffer->free_blob();
|
code_buffer->free_blob();
|
||||||
|
|
||||||
if (nm == NULL) {
|
if (nm != NULL) {
|
||||||
// The CodeCache is full. Print out warning and disable compilation.
|
|
||||||
record_failure("code cache is full");
|
|
||||||
{
|
|
||||||
MutexUnlocker ml(Compile_lock);
|
|
||||||
MutexUnlocker locker(MethodCompileQueue_lock);
|
|
||||||
CompileBroker::handle_full_code_cache();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
nm->set_has_unsafe_access(has_unsafe_access);
|
nm->set_has_unsafe_access(has_unsafe_access);
|
||||||
nm->set_has_wide_vectors(has_wide_vectors);
|
nm->set_has_wide_vectors(has_wide_vectors);
|
||||||
|
|
||||||
// Record successful registration.
|
// Record successful registration.
|
||||||
// (Put nm into the task handle *before* publishing to the Java heap.)
|
// (Put nm into the task handle *before* publishing to the Java heap.)
|
||||||
if (task() != NULL) task()->set_code(nm);
|
if (task() != NULL) {
|
||||||
|
task()->set_code(nm);
|
||||||
|
}
|
||||||
|
|
||||||
if (entry_bci == InvocationEntryBci) {
|
if (entry_bci == InvocationEntryBci) {
|
||||||
if (TieredCompilation) {
|
if (TieredCompilation) {
|
||||||
|
@ -1055,12 +1049,16 @@ void ciEnv::register_method(ciMethod* target,
|
||||||
method->method_holder()->add_osr_nmethod(nm);
|
method->method_holder()->add_osr_nmethod(nm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} // safepoints are allowed again
|
||||||
// JVMTI -- compiled method notification (must be done outside lock)
|
|
||||||
if (nm != NULL) {
|
|
||||||
nm->post_compiled_method_load_event();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if (nm != NULL) {
|
||||||
|
// JVMTI -- compiled method notification (must be done outside lock)
|
||||||
|
nm->post_compiled_method_load_event();
|
||||||
|
} else {
|
||||||
|
// The CodeCache is full. Print out warning and disable compilation.
|
||||||
|
record_failure("code cache is full");
|
||||||
|
CompileBroker::handle_full_code_cache();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -231,7 +231,8 @@ void NMethodSweeper::mark_active_nmethods() {
|
||||||
*/
|
*/
|
||||||
void NMethodSweeper::possibly_sweep() {
|
void NMethodSweeper::possibly_sweep() {
|
||||||
assert(JavaThread::current()->thread_state() == _thread_in_vm, "must run in vm mode");
|
assert(JavaThread::current()->thread_state() == _thread_in_vm, "must run in vm mode");
|
||||||
if (!MethodFlushing || !sweep_in_progress()) {
|
// Only compiler threads are allowed to sweep
|
||||||
|
if (!MethodFlushing || !sweep_in_progress() || !Thread::current()->is_Compiler_thread()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue