8144223: Move j.l.invoke.{ForceInline, DontInline, Stable} to jdk.internal.vm.annotation package

Christian Thalinger christian.thalinger at oracle.com
Mon Nov 30 19:26:57 UTC 2015


> On Nov 30, 2015, at 7:40 AM, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:
> 
> Hi,
> 
> Please review:
> 
>  http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8144223-move-stable-force-dont-inline-jdk/webrev/
>  http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8144223-move-stable-force-dont-inline-hotspot/webrev/
> 
> This moves the package private annotations j.l.invoke.{ForceInline, DontInline, Stable} to public annotations of the same name in the non-exported (at least for unqualified exports) package jdk.internal.vm.annotation where @Contended lives (in hs-rt not currently hs-comp) and where HotSpotIntrinsicCandidate will move to.
> 
> The intent is these annotations can be used sparingly in classes in java.base packages other than java.lang.invoke. From the issue description:
> 
> https://bugs.openjdk.java.net/browse/JDK-8144223
> 
>> The annotations j.l.invoke.{ForceInline, DontInline, Stable} are currently package private but could have use outside that package if used carefully and sparingly. For example:
>> 
>> 1) Methods on Atomic*FieldUpdater classes may benefit from @ForceInline, as would array support methods of JDK-8136924 to preserve existing inlining characteristics.
>> 2) Reference.reachabilityFence (JDK-8133348) could be annotated with @DontInline rather than explicitly making the method signature known to the VM.
>> 3) The alias jdk.vm.ci.hotspot.Stable could potentially be removed.
> 
> I am especially interested if 3) is possible, it seems so from my limited knowledge.

Yes, it is possible.  It just needs an import change in:

hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java

and then you can remove the additional code in classFileParser.cpp.

> 
> 
> This patch is based off hs-comp because there is a test in hs-comp using @Stable that was added 2 weeks ago and it is not yet in hs-rt (AFAIK hs-rt is a sub-set of hs-comp in this respect):
> 
> $ hg log test/compiler/stable/TestStableMemoryBarrier.java
> changeset:   9489:1a552f9b912e
> tag:         JDK-8144223-move-stable-force-dont-inline-hotspot
> tag:         qtip
> tag:         tip
> user:        psandoz
> date:        Mon Nov 30 18:24:44 2015 +0100
> summary:     8144223: Move j.l.invoke.{ForceInline, DontInline, Stable} to jdk.internal.vm.annotation package
> 
> changeset:   9270:9348fbca9f67
> parent:      9268:ee63c0026315
> user:        hshi
> date:        Mon Nov 16 16:14:15 2015 +0100
> summary:     8139758: [REDO] Elide more final field's write memory barrier with escape analysis result
> 
> Paul.



More information about the hotspot-compiler-dev mailing list