[jdk11u-dev] RFR: 8263776: [JVMCI] add helper to perform Java upcalls [v2]
Aleksey Shipilev
shade at openjdk.java.net
Tue Aug 24 10:30:25 UTC 2021
On Mon, 23 Aug 2021 16:28:07 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> src/hotspot/share/jvmci/jvmciRuntime.cpp line 513:
>>
>>> 511: return value->f;
>>> 512: case T_DOUBLE:
>>> 513: return value->d;
>>
>> The original commit uses `value->i` and `value->j` here. Of course, `value->f` and `value->d` look more correct, but do you understand why this difference?
>
> The original change handles `T_INT` and `T_FLOAT` (same bit width) with a single case statement. Same for `T_DOUBLE` and `T_LONG`. Therefore returning the more generic union types `value->i` and `value->j` respectively. I'm not sure this actually makes any difference. This seems the cleaner way to handle it.
Yeah, I don't see the difference, but I think this is how we do conversions: put the `jdouble` to `value->d`, read `jlong` from `value->j`. Since this method returns `jlong`, I would expect `value->j` here. See e.g. `next_double()` in this patch.
Note that if we do `->f`, `->d` for `T_FLOAT` and `T_DOUBLE`, then it is reasonable to expect `T_BOOLEAN` and friends also replaced by their own type-specific union fields.
I would personally like to match mainline here, and then maybe clean up mainline, then backport the cleanup as the follow-up.
-------------
PR: https://git.openjdk.java.net/jdk11u-dev/pull/279
More information about the jdk-updates-dev
mailing list