[foreign] RFR 8216484: jextract LayoutUtils has to be modified for Windows

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Jan 14 15:59:36 UTC 2019


Looks good to me

Maurizio

On 14/01/2019 15:19, Jorn Vernee wrote:
> I think this sounds good. It's probably a premature optimization to 
> cache the Layouts since they are not expensive to create in this case. 
> (plus no-cache is much simpler to implement)
>
> updated webrev: 
> http://cr.openjdk.java.net/~jvernee/panama/webrevs/windows_jextract/webrev.02/
>
> Jorn
>
> Maurizio Cimadamore schreef op 2019-01-14 15:33:
>> Or, remove the cache entirely (we can add it back later if performance
>> really becomes a concern)
>>
>> Maurizio
>>
>> On 14/01/2019 06:31, Sundararajan Athijegannathan wrote:
>>> jextract supports ToolProvider interface. It is possible to create 
>>> multiple instances of jextract in the same process. LayoutUtils has  
>>> a static cache which is initialized using sizes obtained from clang 
>>> library. In theory it is possible that we may get different sizes 
>>> for types depending on preprocessor settings, 32/64 bit app etc. I 
>>> think it is better if we associate this cache with the current 
>>> Context instance.
>>>
>>> -Sundar
>>>
>>> On 12/01/19, 6:58 PM, Jorn Vernee wrote:
>>>> Hi,
>>>>
>>>> Continuing from [1, 2]
>>>>
>>>> I have polished the previous patch a little.
>>>>
>>>> Instead of doing the minimum needed for Windows support I've 
>>>> replaced all the LayoutUtils.Types constants, and instead am 
>>>> querying the type size from libclang and then caching the result, 
>>>> since libclang seems to know the right size to use for the platform.
>>>>
>>>> I have been looking at the libclang API and there doesn't seem to 
>>>> be a way to specify the target platform. I think it always uses the 
>>>> ABI of the platform it was built for.
>>>>
>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8216484
>>>> Updated Webrev: 
>>>> http://cr.openjdk.java.net/~jvernee/panama/webrevs/windows_jextract/webrev.01/
>>>>
>>>> Cheers,
>>>> Jorn
>>>>
>>>> [1] : 
>>>> https://mail.openjdk.java.net/pipermail/panama-dev/2019-January/003680.html
>>>> [2] : 
>>>> https://mail.openjdk.java.net/pipermail/panama-dev/2019-January/003683.html


More information about the panama-dev mailing list