RFR: 8272526: Cleanup ThreadStateTransition class

Patricio Chilano Mateo pchilanomate at openjdk.java.net
Mon Aug 16 21:33:44 UTC 2021


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.

Thanks,
Patricio

-------------

Commit messages:
 - v1

Changes: https://git.openjdk.java.net/jdk/pull/5128/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5128&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8272526
  Stats: 135 lines in 8 files changed: 25 ins; 76 del; 34 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5128.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5128/head:pull/5128

PR: https://git.openjdk.java.net/jdk/pull/5128


More information about the hotspot-runtime-dev mailing list