[foreign] RFR: consolidate native vs. carrier conversions

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri May 18 16:14:00 UTC 2018


Thanks for testing - pushed

Maurizio


On 18/05/18 15:49, Sundararajan Athijegannathan wrote:
> Looks good
>
> PS. Verified that all tests run fine on Mac
>
> -Sundar
>
> On 18/05/18, 7:25 PM, Maurizio Cimadamore wrote:
>> Hi,
>> as noted yesterday, we have several paths which perform native 2 java 
>> conversion. The goal of this patch is to reduce the number of such 
>> paths, and use LayoutType wherever possible. This resulted in removal 
>> of a lot of duplicated code, in both UpcallHandler and NativeInvoker, 
>> which I think is good.
>>
>> Given to the way we handle structs in native calls - that is spread 
>> struct fields into registers, using LayoutType here is not possible 
>> as structs have to be marshalled/unmarshalled bit by bit, according 
>> to the ABI.
>>
>> In the process I realized that the binder was implicitly performing a 
>> conversion between Java null and Pointer.nullPointer(). I removed 
>> that for now, as I prefer things to err on the explicit-side of things.
>>
>> Webrev:
>>
>> http://cr.openjdk.java.net/~mcimadamore/panama/consolidate-load-store/
>>
>> P.S.
>>
>> This could probably use some testing in MacOS as well, since it 
>> touches core parts of the binder, close to the system ABI.
>>
>> Cheers
>> Maurizio
>>
>>



More information about the panama-dev mailing list