RFR: 8254263: Remove special_runtime_exit_condition() check from ~ThreadInVMForHandshake()

Patricio Chilano Mateo pchilanomate at openjdk.java.net
Mon Oct 12 18:35:16 UTC 2020


On Mon, 12 Oct 2020 17:20:12 GMT, Richard Reingruber <rrich at openjdk.org> wrote:

> I meant the block could be removed if we put
> ThreadInVMfromJava/ThreadInVMfromJava (TIVFJ) into
> handle_polling_page_exception(). In that case the thread would notice and honor
> the suspend when leaving the TIVFJ block. This would not be too late, would it?

Yes, it will honor the first suspend in the TIVFJ destructor by calling handle_special_runtime_exit_condition(), but
even in that case, we would still need the check in SS:block() because of the last call to
SafepointMechanism::process_if_requested(thread()) in java_suspend_self_with_safepoint_check(). That could be a new
VM_ThreadSuspend() operation to suspend the thread again. So that check in SS:block() is actually needed for all the
transitions to java not only the one in handle_polling_page_exception(). But I think we can remove that recursion if we
move that call to SafepointMechanism::process_if_requested(thread()) inside the do-while().

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

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


More information about the hotspot-runtime-dev mailing list