RFR: 8272526: Cleanup ThreadStateTransition class [v2]
rehn at openjdk.java.net
Tue Aug 17 17:44:27 UTC 2021
On Tue, 17 Aug 2021 16:50:50 GMT, Patricio Chilano Mateo <pchilanomate at openjdk.org> wrote:
>> Hi all,
>> Please review the following cleanup of class ThreadStateTransition. I added method transition_from_vm and removed the generic transition method which was covering those transitions. This not only makes the public API more consistent given that we already have transition_from_java and transition_from_native but it also allows for some common code refactoring and it also makes more clear which transitions we exactly need to deal with and what actions need to be executed.
>> I adjusted the expected error message in test InternalErrorTest.java to match the _thread_in_vm case in check_and_handle_async_exceptions() because with this patch we transition to Java only after having checked the exit conditions, rather than today where we process safepoint/handshakes, set state to _thread_in_Java and then process the exit conditions. Ideally I would remove the _thread_in_Java case from the switch statement but we still have the handle_polling_page_exception() case which does everything in Java and never transitions (I will address that in another RFE), so I only adjusted the error message there in case we hit that path in this test.
>> Tested in mach5 tiers 1-7.
> Patricio Chilano Mateo has updated the pull request incrementally with one additional commit since the last revision:
> restore assert in transition_from_native()
I was a bit worried about the clear pending exception which we had some problems with before.
So I ran my stress tests, it passed, looks good thanks!
Marked as reviewed by rehn (Reviewer).
More information about the hotspot-runtime-dev