x86 interpreters in hotspot

Krystal Mok rednaxelafx at gmail.com
Mon May 7 19:49:11 PDT 2012


On Tue, May 8, 2012 at 10:36 AM, Xin Tong <xerox.time.tech at gmail.com> wrote:
>
> Thank you. This is very helpful. I want to write something that can
> keep track of all unique the virtual PC ( Java bytecode PC the
> interpreter has executed ). should I do a call-out in every template ?
> can I just generate call to a function of my own sourrounded by a
> sequence of pushes and pops.
>
>
Depends on what you're tracing for. As you might have noticed already,
there's a VM flag called "TraceBytecodes" that traces every bytecode
instruction executed. Search for that in code, and take a look
at TemplateInterpreterGenerator::trace_bytecode(). That should give you an
example of how you'd write your version.

So what are you tracing for anyway? If TraceBytecodes already does what you
want, then just use it and you're done. It's only available in a  fastdebug
/ jvmg build, though.

Reminder: please note that this discussion is interpreter-only. There's no
option to trace bytecodes (yet) in compiled code. You're better off doing
bytecode instrumentation if you're trying to trace both interpreter and
compiled code.

- Kris


> Thanks
>
> Xin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20120508/e7d54cd5/attachment.html 


More information about the hotspot-runtime-dev mailing list