https://mail.openjdk.java.net/pipermail/serviceability-dev/2020-August/032773.html
src/hotspot/share/prims/jvmtiEnvThreadState.cpp
194 #ifdef ASSERT
195 Thread *current = Thread::current();
196 #endif
197 assert(get_thread() == current || current ==
get_thread()->active_handshaker(),
198 "frame pop data only accessible from same thread or
direct handshake");
Can you factor this out into a separate function so that it is not
repeated so often. Seems to me that there should be a global function on
Thread: assert_current_thread_or_handshaker() [yes unpleasant name but
...] that will allow us to stop repeating this code fragment across
numerous files. A follow up RFE for that would be okay too (I see some
guarantees that should probably just be asserts so they need a bit more
checking).