Stack and local variables in bytecode tracing

Peng Du imdupeng at
Mon Feb 23 18:06:49 PST 2009

Hello, everyone

I know there is a BytecodeTracer class which is only enabled in DEBUG build,
which is used to spit out bytecodes when the TraceBytecodes option is turned
on. What I am interested in are the addresses to java heap being accessed
(read/write) when the opcodes, e.g. aload, astore, putfield, etc, are

However, by default this method does not print out  those kind of
information even in verbose mode AFAIK. So, I want to modify the class by
adding a new method whose solely purpose is when a memory access code is in
execution, extract the memory addresses, either from the expression stack
(for xxstore), or from the local variable pool (for xxload).

I know tos, tos2 are passed directly to the BytecodeTracer::trace() method.
But for array opcodes, e.g. aastore, there are three elements on stack, i.e*.
*arrayref, index, value*. *If "value" is tos, how can I get arrayref?

Furthermore, what are the correct ways to peek on the expression stack and
in local variable pool?

My another question is: in bytecodes.hpp, there are two groups of bytecodes,
ie. Java bytecodes and JVM bytecodes. I understand what Java bytecodes are.
But what are JVM bytecodes (_fast_XX)?

Thanks in advance.

Peng Du
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the hotspot-dev mailing list