Tiered compilation leads to "unloaded signature class" inlining failures in JRuby

forax at univ-mlv.fr forax at univ-mlv.fr
Fri Sep 4 09:03:06 UTC 2020


----- Mail original -----
> De: "Charles Oliver Nutter" <headius at headius.com>
> À: "Remi Forax" <forax at univ-mlv.fr>
> Cc: "Vladimir Ivanov" <vladimir.x.ivanov at oracle.com>, "hotspot compiler" <hotspot-compiler-dev at openjdk.java.net>
> Envoyé: Jeudi 3 Septembre 2020 21:48:10
> Objet: Re: Tiered compilation leads to "unloaded signature class" inlining failures in JRuby

> On Thu, Sep 3, 2020 at 2:42 PM Remi Forax <forax at univ-mlv.fr> wrote:
>> I will say something that doesn't help you,
>> i tries to not use one classloader per method and instead use a combination of
>> ahead of time compilation + lookup.defineClass + defineAnonymousClass.
>> I can do that because my base version is Java 11 not Java 8.
>> I plan to use Hidden classes soon, i've already a prototype but i still need to
>> study where to use weak or strong hidden classes.
> 
> I'm willing to do any or all of those things! defineAnonymousClass is
> still not a publicly-accessible API, though, which is why I have not
> used it up to now.

yep, i should not have mention it, i use it in a very special case for doing loop customisation where i want to have access to annotations like @ForceInline

I should have say that instead of using a new classloader, you can directly inject the class in an existing classloader by calling defineClass by reflection in 8 and using lookup.defineClass() in 11.
It's far less resources hungry because each classloader has its own metaspace but you are loosing the ability to unload classes.

> 
> We don't have any plans to baseline on 11 yet, but could possibly be convinced.

As i said above, you can call ClassLoader.defineClass by reflection in 8.

> 
> I think you understand my use case pretty well... maybe you can point
> me at an example of what you think would be the "best" way, assuming
> we moved our baseline to 11?

We moved to 11 for another reason, being able to use Shenandoah (and maybe in the future ZGC).

> 
> - Charlie

Rémi


More information about the hotspot-compiler-dev mailing list