8255243: Reinforce escape barrier interactions with ZGC conc stack processing

Co-authored-by: Richard Reingruber <rrich@openjdk.org>
Reviewed-by: rrich, sspitsyn
This commit is contained in:
Erik Österlund 2020-10-29 14:18:11 +00:00
parent faf23de54d
commit 5b185585e8
15 changed files with 196 additions and 104 deletions

View file

@ -1378,17 +1378,9 @@ JvmtiEnvBase::force_early_return(JavaThread* java_thread, jvalue value, TosState
// Eagerly reallocate scalar replaced objects.
JavaThread* current_thread = JavaThread::current();
EscapeBarrier eb(true, current_thread, java_thread);
if (eb.barrier_active()) {
if (java_thread->frames_to_pop_failed_realloc() > 0) {
// VM is in the process of popping the top frame because it has scalar replaced objects
// which could not be reallocated on the heap.
// Return JVMTI_ERROR_OUT_OF_MEMORY to avoid interfering with the VM.
return JVMTI_ERROR_OUT_OF_MEMORY;
}
if (!eb.deoptimize_objects(0)) {
// Reallocation of scalar replaced objects failed -> return with error
return JVMTI_ERROR_OUT_OF_MEMORY;
}
if (!eb.deoptimize_objects(0)) {
// Reallocation of scalar replaced objects failed -> return with error
return JVMTI_ERROR_OUT_OF_MEMORY;
}
SetForceEarlyReturn op(state, value, tos);