Skip to content
Browse files
8285739: disable EscapeBarrier deopt for virtual threads
Reviewed-by: kvn, rrich, sspitsyn
  • Loading branch information
lmesnik committed May 23, 2022
1 parent 110d906 commit 940e94f194e2abab8006e67dbb82cab5f16e3a17
Showing 2 changed files with 6 additions and 1 deletion.
@@ -1155,7 +1155,7 @@ void JvmtiTagMap::iterate_through_heap(jint heap_filter,
// EA based optimizations on tagged objects are already reverted.
// disabled if vritual threads are enabled with --enable-preview
EscapeBarrier eb(!Continuations::enabled() && !(heap_filter & JVMTI_HEAP_FILTER_UNTAGGED), JavaThread::current());
EscapeBarrier eb(!(heap_filter & JVMTI_HEAP_FILTER_UNTAGGED), JavaThread::current());
MutexLocker ml(Heap_lock);
IterateThroughHeapObjectClosure blk(this,
@@ -119,6 +119,11 @@ bool EscapeBarrier::deoptimize_objects_all_threads() {
if (!barrier_active()) return true;
ResourceMark rm(calling_thread());
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt =; ) {
oop vt_oop = jt->jvmti_vthread();
// Skip virtual threads
if (vt_oop != NULL && java_lang_VirtualThread::is_instance(vt_oop)) {
if (jt->frames_to_pop_failed_realloc() > 0) {
// The deoptee thread jt has frames with reallocation failures on top of its stack.
// These frames are about to be removed. We must not interfere with that and signal failure.

1 comment on commit 940e94f

Copy link

@openjdk-notifier openjdk-notifier bot commented on 940e94f May 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.