JDK-8265327 : Remove check_safepoint_and_suspend_for_native_trans()
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-04-16
  • Updated: 2021-04-29
  • Resolved: 2021-04-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 17
17 b20Fixed
Related Reports
Relates :  
Description
This method can just be removed and the code moved directly to  check_special_condition_for_native_trans() since it doesn't add any value.
The other caller, transition_from_native(), can be simplified and can just call SafepointMechanism::process_if_requested_with_exit_check() after transitioning to _thread_in_native_trans. Then we can only add the assert() about not having a last java frame or being walkable since we should have added that in transition_from_native() regardless.

Also has_special_runtime_exit_condition() should be changed so that only one comparison is made against the _suspend_flags, like we do in is_suspend_after_native(), instead of letting the compiler generate code for three different checks (external suspend, jfr suspend, object deoptimization). Since transition_from_native() will call process_if_requested_with_exit_check() which in turns calls has_special_runtime_exit_condition(), making the generated code for the latter as small as possible makes more likely that ThreadInVMfromNative constructor is inlined and the fast case (no need to process anything) avoids making any calls to other methods.

Comments
Changeset: 8e312297 Author: Patricio Chilano Mateo <pchilanomate@openjdk.org> Date: 2021-04-23 14:23:43 +0000 URL: https://git.openjdk.java.net/jdk/commit/8e312297
23-04-2021