The only transitions covered by the generic transition() public method are transitions from vm to either java or native. Other ones are already covered by methods transition_from_java and transition_from_native or are invalid transitions. Defining a specific transition_from_vm method and removing the generic transition will allow for the following:
- Make it more clear which actions we need to perform when transitioning from one state to another.
- Allow factoring out common code for some transitions like from vm to a safe state(native, blocked) or from native and from vm to java which both need to call process_if_requested_with_exit_check.
- Make the public API of ThreadStateTransition more consistent providing the 3 methods that we will ever need when making transitions: transition_from_java, transition_from_native and transition_from_vm. The transition from new is a special case only executed once for which we don't need a special transition method. Transitions from thread_blocked should only be done in ThreadBlockInVMPreprocess/ThreadBlockInVM, since we should avoid manual transitions to thread_blocked except in special places like safepoint and handshake code.