Skip to content

Commit

Permalink
8285739: disable EscapeBarrier deopt for virtual threads
Browse files Browse the repository at this point in the history
Reviewed-by: kvn, rrich, sspitsyn
  • Loading branch information
lmesnik committed May 23, 2022
1 parent 110d906 commit 940e94f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/hotspot/share/prims/jvmtiTagMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
eb.deoptimize_objects_all_threads();
MutexLocker ml(Heap_lock);
IterateThroughHeapObjectClosure blk(this,
Expand Down
5 changes: 5 additions & 0 deletions src/hotspot/share/runtime/escapeBarrier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,11 @@ bool EscapeBarrier::deoptimize_objects_all_threads() {
if (!barrier_active()) return true;
ResourceMark rm(calling_thread());
for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) {
oop vt_oop = jt->jvmti_vthread();
// Skip virtual threads
if (vt_oop != NULL && java_lang_VirtualThread::is_instance(vt_oop)) {
continue;
}
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.
Expand Down

1 comment on commit 940e94f

@openjdk-notifier
Copy link

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.