On Wed, 15 Feb 2023 21:39:52 GMT, Jorn Vernee <jver...@openjdk.org> wrote:

> The entry generated by generate_method_handle_interpreter_entry is 
> essentially the from_interpreted_entry, AFAIU.

But it is also stored in `Method::_i2i_entry` which is [used by c2i 
adapters](https://github.com/openjdk/jdk/blob/3ba156082b73c4a8e9d890a57a42fb68df2bf98f/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp#L748-L750).

(Maybe too) long version:

The interpreter has entries depending on the `MethodKind`. See 
`AbstractInterpreter::entry_for_kind()`. The entries are stored in 
`AbstractInterpreter::_entry_table`. In 
`MethodHandlesAdapterGenerator::generate()` the interpreter entries for method 
handle intrinsics MethodKinds are generated using the generator 
`MethodHandles::generate_method_handle_interpreter_entry()`.

In `Method::link_method()` the entry points are set depending on the 
`MethodKind`. The interpreter entry (see above) for the method's `MethodKind` 
is looked up and stored in `Method::_i2i_entry` which is also [used by c2i 
adapters](https://github.com/openjdk/jdk/blob/3ba156082b73c4a8e9d890a57a42fb68df2bf98f/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp#L748-L750).

So to me it looks as if the entry generated by 
`generate_method_handle_interpreter_entry()` can be reached coming from a 
compiled caller. The generator for ordinary methods is 
`TemplateInterpreterGenerator::generate_normal_entry()`. The entries it 
generates are surely reached by compiled callers. I might be missing something 
in the case of MH intrinsics but right now it looks to me as if the caller can 
be compiled too.

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

PR: https://git.openjdk.org/jdk/pull/12535

Reply via email to