[foreign-memaccess+abi] RFR: 8291873: Implement return value normalization in Java [v2]
Jorn Vernee
jvernee at openjdk.org
Thu Sep 15 12:44:07 UTC 2022
On Thu, 15 Sep 2022 11:19:44 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Non-zero byte test
>
> src/java.base/share/classes/jdk/internal/foreign/abi/Binding.java line 378:
>
>> 376:
>> 377: public Binding.Builder vmStore(VMStorage storage, Class<?> type) {
>> 378: if (isSubIntType(type)) {
>
> So, this is interesting, in the sense that a cast binding is never emitted in isolation, but always in combination with a vm load /store binding. Does it mean that maybe creating a separate binding for this is conceptually wrong, and maybe it's the semantics of vmstore/load that should be updated? It's more of a theoretical question, in the sense that the code is obviously doing the correct thing as is.
I think it makes sense to have cast as a separate binding. Because we don't always do a cast, I think it's nice that it is somehow reflected in the recipe.
I mostly put the code here for the sake of convenience. The alternative would be to add this kind code in each CallArranger implementation, which seemed like unnecessary repetition.
Since this is a builder class, it made sense to me to put it here (as in the class encapsulates some construction logic). Though, maybe now that these methods do more than just a VMStore and VMLoad, they should be renamed as well to something that reflects that. (maybe `erasedVMStore` / `erasedVMLoad`).
-------------
PR: https://git.openjdk.org/panama-foreign/pull/720
More information about the panama-dev
mailing list