Integrated: 8272526: Cleanup ThreadStateTransition class
Patricio Chilano Mateo
pchilanomate at openjdk.java.net
Tue Aug 24 14:14:35 UTC 2021
On Mon, 16 Aug 2021 19:04:09 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.
This pull request has now been integrated.
Author: Patricio Chilano Mateo <pchilanomate at openjdk.org>
Stats: 135 lines in 8 files changed: 25 ins; 75 del; 35 mod
8272526: Cleanup ThreadStateTransition class
Reviewed-by: dholmes, rehn, coleenp
More information about the hotspot-runtime-dev