[10] RFR(L): 8132547: [AOT] support invokedynamic instructions

Remi Forax forax at univ-mlv.fr
Tue Sep 12 06:54:29 UTC 2017


Hi Dean,
Java currently uses invokedynamic in two places, one is for lambda creation, the other is for string concatenation.
Do you have tested string concatenation ? This patch should help right now because the StringConcatFactory do not uses any anonymous class.

and Java (the language) is not the only one to use invokedynamic, how thing works if the boostrap method requires data that are only available at runtime, data that comes from a dynamic language runtime by example ?

cheers,
Rémi

----- Mail original -----
> De: "Dean Long" <dean.long at oracle.com>
> À: "hotspot compiler" <hotspot-compiler-dev at openjdk.java.net>
> Envoyé: Mardi 12 Septembre 2017 04:21:36
> Objet: [10] RFR(L): 8132547: [AOT] support invokedynamic instructions

> https://bugs.openjdk.java.net/browse/JDK-8132547
> 
> http://cr.openjdk.java.net/~dlong/8132547/
> 
> This enhancement is a first step in supporting invokedynamic
> instructions in AOT.  Previously, when we saw an invokedynamic
> instruction, or any anonymous class, we would generate code to bail out
> and deoptimize.  With this changeset we go a little further and call
> into the runtime to resolve the dynamic constant pool entry, running the
> bootstrap method, and returning the adapter method and appendix object.
> Like class initialization in AOT, we only do this the first time
> through.  Because AOT double-checks classes using fingerprints and
> symbolic names, special care was required to handle anonymous class
> names.  The solution I chose was to name anonymous types with aliases
> based on their constant pool location ("adapter<classid:cpi>" and
> appendix<classid:cpi>").
> 
> Future work is needed to AOT-compile the anonymous classes and/or inline
> through them, so this change is not expected to affect AOT performance.
> In my tests I was not able to measure any difference.
> 
> Upstream Graal changes have already been pushed.  I broke the JVMCI and
> hotspot changes into separate webrevs.
> 
> dl


More information about the hotspot-compiler-dev mailing list