HotSpotResolvedJavaMethod#setNotInlineable() in JVMCI

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

HotSpotResolvedJavaMethod#setNotInlineable() in JVMCI

Yasumasa Suenaga-4
Hi all,

I've tried to use JVMCI implementation.

HotSpotResolvedJavaMethod#setNotInlineable() is explained that "Manually adds a DontInline annotation to this method" in the comment, however this method seems to disable C1/C2 compile in CompilerToVM [1][2].

Is this behavior correct?
Should we fix the comment or method name (and / or function name) or behavior in jvmciCompilerToVM.cpp ?


I will file it to JBS if it is a bug.


Thanks,

Yasumasa (ysuenaga)

Reply | Threaded
Open this post in threaded view
|

Re: HotSpotResolvedJavaMethod#setNotInlineable() in JVMCI

Christian Thalinger-4

On May 15, 2017, at 8:27 PM, Yasumasa Suenaga <[hidden email]> wrote:

Hi all,

I've tried to use JVMCI implementation.

HotSpotResolvedJavaMethod#setNotInlineable() is explained that "Manually adds a DontInline annotation to this method" in the comment, however this method seems to disable C1/C2 compile in CompilerToVM [1][2].

Is this behavior correct?
Should we fix the comment or method name (and / or function name) or behavior in jvmciCompilerToVM.cpp ?

Yes, that’s a bit confusing.  I think HotSpotResolvedJavaMethodImpl.setNotInlineable should be renamed and the documentation updated.

Reply | Threaded
Open this post in threaded view
|

Re: HotSpotResolvedJavaMethod#setNotInlineable() in JVMCI

Doug Simon @ Oracle

> On 17 May 2017, at 00:50, Christian Thalinger <[hidden email]> wrote:
>
>
>> On May 15, 2017, at 8:27 PM, Yasumasa Suenaga <[hidden email]> wrote:
>>
>> Hi all,
>>
>> I've tried to use JVMCI implementation.
>>
>> HotSpotResolvedJavaMethod#setNotInlineable() is explained that "Manually adds a DontInline annotation to this method" in the comment, however this method seems to disable C1/C2 compile in CompilerToVM [1][2].
>>
>> Is this behavior correct?
>> Should we fix the comment or method name (and / or function name) or behavior in jvmciCompilerToVM.cpp ?
>
> Yes, that’s a bit confusing.  I think HotSpotResolvedJavaMethodImpl.setNotInlineable should be renamed and the documentation updated.

I agree. I've can confirm that the expectation of the single user of this API[1] is for the method to never be inlined or compiled by HotSpot. The method name should be changed to setNotInlineableOrCompileable. As part of this change, the documentation for CompilerToVM.doNotInlineOrCompile[2] should also be fixed to reflect that it is a setter, not a getter.

-Doug

[1] https://github.com/graalvm/graal/blob/ddebb13523f54112c552f38ff87e23c6034ff725/compiler/src/org.graalvm.compiler.truffle.hotspot/src/org/graalvm/compiler/truffle/hotspot/HotSpotTruffleRuntime.java#L228
[2] http://hg.openjdk.java.net/jdk9/dev/hotspot/file/507f8a7678b4/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/CompilerToVM.java#l462