RFR: 8271911: replay compilations of methods which use JSR292 (easy cases) [v2]

Dean Long dlong at openjdk.java.net
Thu Sep 2 22:49:27 UTC 2021


On Thu, 2 Sep 2021 22:40:04 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Also, one more question: why do you dump MethodHandle CP constants and invokehandle call sites? Is it to record the connection between MethodHandle instances and hidden classes behind LambdaForms they are implemented with?
>
>> I still miss the connection between `ciInstanceKlass::dump_replay_data()` and `ciEnv::find_dynamic_call_sites()` cases.
>> 
>> `ciEnv::find_dynamic_call_sites()` dumps all invokedynamic and invokehandle (MH.invoke*()) call sites and MethodHandle CP Constants across the class hierarchy. Any particular benefit compared to just dumping that info on per ciInstanceKlass granularity?
> 
> Actually, find_dynamic_call_sites doesn't do the dumping, it just builds a map, so we only dump call sites that for hidden classes that are referenced in the replay data, preserving existing behavior.  The dumping of subclasses in ciInstanceKlass::dump_replay_data confused me too, so I asked Tom Rodriguez about it.  It's a substitute for CHA info in the reply file.  If we load sublcasses of all the ciInstanceKlass's, then hopefully CHA queries will give the same answer at replay time.  Note that not all subclasses have a ciInstanceKlass in the metadata.  Subclasses of java.lang.Object include lots of hidden classes not referenced directly in the ci metadata.

> Also, one more question: why do you dump MethodHandle CP constants and invokehandle call sites? Is it to record the connection between MethodHandle instances and hidden classes behind LambdaForms they are implemented with?

Yes, if I understand your question correctly.  When inlining through an invokedynamic to the target, there's often an invokehandle at the end, and the hidden class isn't always found as the adapter or appendix.  There are other locations like BSM arguments, but these are loaded from the constant pool and I found that looking at MethodHandle CP constants handled that case.  Note again that I don't dump all MethodHandle CP constants, just the ones needed for a hidden class referenced in the reply data.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5270


More information about the hotspot-compiler-dev mailing list