JDK-8252479 : Introduce new assertion for checking current thread or handshaker
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 16
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • Submitted: 2020-08-28
  • Updated: 2021-07-23
  • Resolved: 2021-07-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 18
18Resolved
Related Reports
Duplicate :  
Relates :  
Description
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).
Comments
The asynchronous handshake work (JDK-8238761) already replaced this with is_handshake_safe_for(thread).
23-07-2021