I don't understand the wording here.

Remi Forax forax at univ-mlv.fr
Sun Aug 27 20:24:00 UTC 2023


> From: "David Alayachew" <davidalayachew at gmail.com>
> To: "leyden-dev" <leyden-dev at openjdk.org>
> Sent: Sunday, August 27, 2023 8:34:22 PM
> Subject: I don't understand the wording here.

> Hello Leyden Dev Team,

Hello David, 

> I was reading the Leyden doc Brian Goetz put out this month called "Condensing
> Indy Bootstraps".

> [ https://openjdk.org/projects/leyden/notes/04-condensing-bootstraps |
> https://openjdk.org/projects/leyden/notes/04-condensing-bootstraps ]

> Here is a quote from the last sentence of the first paragraph.

>> However, the bootstraps used by javac generally avoid runtime dependencies the
>> most dynamic features of method handles, and therefore are likely candidates
> > for such re-shifting.

> I don't understand the wording here. Mistype?

I will explain what it means. Invokedynamic calls a bootstrap method that returns a CallSite. There are two kind of callsites, ConstantCallSite and MutableCallSite, a constant callsite means that the callsite can be optimized now while a mutable callsite means the callsite can be optimized later, once the target is stable enough. Currently, javac generates invokedynamic that only uses constant callsites. 

Since this doc was created, we now know that the distiller phase [1] is more prowerful than previously thought so we may not need to condense indy bootstrap methods but just annotate them to say if the result needed to be replayed or not. So the same mechanism can be used for both static fields and bootstrap methods. 

If you play with the premain prototype of Leyden [2], there is a global option -XX:+ArchiveInvokeDynamic that stores all the callsite targets of the first run (training run) inside the CDS archive. 
Here is an example of how to use the prototype to run maven [3], the first run of maven keep the dynamic information into a CDS archive and a code archive so the next runs re-use those informations to get a faster warmup time. 

> Thank you for your time and help!
> David Alayachew

[1] [ https://openjdk.org/projects/leyden/notes/03-toward-condensers | https://openjdk.org/projects/leyden/notes/03-toward-condensers ] 
[2] [ https://github.com/openjdk/leyden/tree/premain | https://github.com/openjdk/leyden/tree/premain ] 
[3] [ https://github.com/forax/computed-constant/blob/master/mvn-leyden.bash | https://github.com/forax/computed-constant/blob/master/mvn-leyden.bash ] 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/leyden-dev/attachments/20230827/17909433/attachment.htm>


More information about the leyden-dev mailing list