Entry function for Template Interpreter

Andrew Haley aph at redhat.com
Tue Jul 11 12:38:32 UTC 2017

On 11/07/17 11:18, Abhinav Jangda wrote:

> I am working on a project in Java HotSpot 9, where I need to do something
> when the interpreter starts interpreting a method (in template
> interpreter). I guess there would be an entry function taking a method as
> an argument in template interpreter, like "*ByteCodeInterpreter::run*"
> function in bytecode interpreter. Unfortunately, I am not able to find such
> a function.

So, you want something of your own to be called at every method entry in
the interpreter?

Here in TemplateInterpreterGenerator::generate_normal_entry:

  // jvmti support
  __ notify_method_entry();

...there is a call out to InterpreterMacroAssembler::notify_method_entry().
I would add a call to my own code at that point, just after the call to
notify_method_entry().  You'll have to observe the JVM conventions with
saving/restoring registers etc.

Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671

More information about the hotspot-compiler-dev mailing list