RFR: 8175917: [JVMCI] Avoid long JNI handle chains

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RFR: 8175917: [JVMCI] Avoid long JNI handle chains

Christian Haeubl

Hi,

Please review the following patch for https://bugs.openjdk.java.net/browse/JDK-8175917:
http://cr.openjdk.java.net/~never/8175917/webrev.001/

Bug description:
When Truffle uses JMVCI and Graal for compiling a guest language (e.g. JavaScript), Graal heavily uses partial escape analysis. In such cases, the JVMCI method "installCode" uses lots of local JNI references when generating the corresponding debug information so that the thread's top-level JNI handle buffer will have a large size. This unnecessarily increases the footprint and significantly decreases the performance (as long as https://bugs.openjdk.java.net/browse/JDK-8175318 is not fixed).

Fix:
Around the JVMCI method "installCode", we do something similar to JNI's PushLocalFrame/PopLocalFrame. So, the large JNI handle buffer is released when the method exits and the thread's top-level JNI handle buffer is not getting enlarged.

Tests:
The changes were tested locally by executing JVMCI bootstrapping and parts of Graal / Truffle.

Thanks,
Christian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Fwd: RFR: 8175917: [JVMCI] Avoid long JNI handle chains

Christian Haeubl
Hi,

Please review the following patch for https://bugs.openjdk.java.net/browse/JDK-8175917:
http://cr.openjdk.java.net/~never/8175917/webrev.001/

Bug description:
When Truffle uses JMVCI and Graal for compiling a guest language (e.g. JavaScript), Graal heavily uses partial escape analysis. In such cases, the JVMCI method "installCode" uses lots of local JNI references when generating the corresponding debug information so that the thread's top-level JNI handle buffer will have a large size. This unnecessarily increases the footprint and significantly decreases the performance (as long as https://bugs.openjdk.java.net/browse/JDK-8175318 is not fixed).

Fix:
Around the JVMCI method "installCode", we do something similar to JNI's PushLocalFrame/PopLocalFrame. So, the large JNI handle buffer is released when the method exits and the thread's top-level JNI handle buffer is not getting enlarged.

Tests:
The changes were tested locally by executing JVMCI bootstrapping and parts of Graal / Truffle.

Thanks,
Christian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: RFR: 8175917: [JVMCI] Avoid long JNI handle chains

Vladimir Kozlov
Looks good. Who with OpenJDK id reviewed it in Labs? I need to list them
in changeset.

Thanks,
Vladimir

On 3/2/17 7:47 AM, Christian Haeubl wrote:

> Hi,
>
> Please review the following patch for
> https://bugs.openjdk.java.net/browse/JDK-8175917:
> http://cr.openjdk.java.net/~never/8175917/webrev.001/
>
> Bug description:
> When Truffle uses JMVCI and Graal for compiling a guest language (e.g.
> JavaScript), Graal heavily uses partial escape analysis. In such cases,
> the JVMCI method "installCode" uses lots of local JNI references when
> generating the corresponding debug information so that the thread's
> top-level JNI handle buffer will have a large size. This unnecessarily
> increases the footprint and significantly decreases the performance (as
> long as https://bugs.openjdk.java.net/browse/JDK-8175318 is not fixed).
>
> Fix:
> Around the JVMCI method "installCode", we do something similar to JNI's
> PushLocalFrame/PopLocalFrame. So, the large JNI handle buffer is
> released when the method exits and the thread's top-level JNI handle
> buffer is not getting enlarged.
>
> Tests:
> The changes were tested locally by executing JVMCI bootstrapping and
> parts of Graal / Truffle.
>
> Thanks,
> Christian
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Fwd: RFR: 8175917: [JVMCI] Avoid long JNI handle chains

Christian Haeubl
Only Tom Rodriguez (never)

- Christian


Am 02.03.2017 um 17:06 schrieb Vladimir Kozlov:

> Looks good. Who with OpenJDK id reviewed it in Labs? I need to list
> them in changeset.
>
> Thanks,
> Vladimir
>
> On 3/2/17 7:47 AM, Christian Haeubl wrote:
>> Hi,
>>
>> Please review the following patch for
>> https://bugs.openjdk.java.net/browse/JDK-8175917:
>> http://cr.openjdk.java.net/~never/8175917/webrev.001/
>>
>> Bug description:
>> When Truffle uses JMVCI and Graal for compiling a guest language (e.g.
>> JavaScript), Graal heavily uses partial escape analysis. In such cases,
>> the JVMCI method "installCode" uses lots of local JNI references when
>> generating the corresponding debug information so that the thread's
>> top-level JNI handle buffer will have a large size. This unnecessarily
>> increases the footprint and significantly decreases the performance (as
>> long as https://bugs.openjdk.java.net/browse/JDK-8175318 is not fixed).
>>
>> Fix:
>> Around the JVMCI method "installCode", we do something similar to JNI's
>> PushLocalFrame/PopLocalFrame. So, the large JNI handle buffer is
>> released when the method exits and the thread's top-level JNI handle
>> buffer is not getting enlarged.
>>
>> Tests:
>> The changes were tested locally by executing JVMCI bootstrapping and
>> parts of Graal / Truffle.
>>
>> Thanks,
>> Christian

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: RFR: 8175917: [JVMCI] Avoid long JNI handle chains

Christian Haeubl
In reply to this post by Christian Haeubl

Hi,

The message below is just a duplicated message that was stuck in moderation. It can be ignored as the issue is already fixed.

- Christian


Am 01.03.2017 um 13:19 schrieb Christian Haeubl:

Hi,

Please review the following patch for https://bugs.openjdk.java.net/browse/JDK-8175917:
http://cr.openjdk.java.net/~never/8175917/webrev.001/

Bug description:
When Truffle uses JMVCI and Graal for compiling a guest language (e.g. JavaScript), Graal heavily uses partial escape analysis. In such cases, the JVMCI method "installCode" uses lots of local JNI references when generating the corresponding debug information so that the thread's top-level JNI handle buffer will have a large size. This unnecessarily increases the footprint and significantly decreases the performance (as long as https://bugs.openjdk.java.net/browse/JDK-8175318 is not fixed).

Fix:
Around the JVMCI method "installCode", we do something similar to JNI's PushLocalFrame/PopLocalFrame. So, the large JNI handle buffer is released when the method exits and the thread's top-level JNI handle buffer is not getting enlarged.

Tests:
The changes were tested locally by executing JVMCI bootstrapping and parts of Graal / Truffle.

Thanks,
Christian

Loading...