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.
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.
Attachments
Issue Links
- relates to
-
JDK-8260376 Cleanup Thread state transitions
-
- Open
-