x86 interpreters in hotspot

Xin Tong xerox.time.tech at gmail.com
Mon May 7 19:54:13 PDT 2012


On Mon, May 7, 2012 at 10:49 PM, Krystal Mok <rednaxelafx at gmail.com> wrote:
> 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
>
>
I think the trace_bytecode() is the function i want to extend. I want
to get a list of all the executed and unique java bytecode PC.  i.e.
if iconst_1 at bytecode index 1 in method foo() is executed many
times, it will only count as one.

Also, what is an easy way to get the size of the interpreter code
given a Java bytecode.

Xin


More information about the hotspot-runtime-dev mailing list