Integrated: Harmonize actual and expected signature of Continuation.doYield

Aleksey Shipilev shade at openjdk.java.net
Fri Oct 15 16:32:05 UTC 2021


On Thu, 14 Oct 2021 15:23:17 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> Found this inconsistency when reading the Loom code during x86_32 porting. `Continuation.doYield` has an `int` argument, yet C2's `OptoRuntime::continuation_doYield_Type` does not declare it. I think this is basically asking for trouble in C2, as the optimizations may ask the function type, discover there is an input of type `int`, but no such input is actually present. Runtime stubs seem to be also oblivious there is an argument, and calling conventions probably put it in the register on x86_64 and AArch64. On other arches, that might not be true.
> 
> I don't believe it breaks anything now, but let's fix it, while we are at it. It looks to me that `Continuation.doYield` is ever called with `0`, so we might just drop its `int` argument? Not sure if `scopes` is something Java code plans to use.
> 
> Additional testing:
>  - [x] Linux x86_64 fastdebug, `jdk_loom hotspot_loom`

This pull request has now been integrated.

Changeset: 0ca7be1c
Author:    Aleksey Shipilev <shade at openjdk.org>
Committer: Ron Pressler <rpressler at openjdk.org>
URL:       https://git.openjdk.java.net/loom/commit/0ca7be1c4434170bf96d65b1e67ddc07298fd357
Stats:     12 lines in 5 files changed: 2 ins; 4 del; 6 mod

Harmonize actual and expected signature of Continuation.doYield

Reviewed-by: rpressler

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

PR: https://git.openjdk.java.net/loom/pull/78


More information about the loom-dev mailing list