x86 interpreters in hotspot
Coleen Phillimore
coleen.phillimore at oracle.com
Tue May 8 05:53:36 PDT 2012
There's a PrintBytecodeHistogram which will tell you how many times each
bytecode is called.
There's PrintInterpreter which will tell you the size of the template
for each bytecode.
There's only one tos (top of stack) element, we print two tos elements
because if the tos is a double or long, it takes two slots.
I'm not sure exactly what you want to do with this information, but
hopefully this helps.
Coleen
On 5/8/2012 2:34 AM, Krystal Mok wrote:
> On Tue, May 8, 2012 at 11:17 AM, Xin Tong <xerox.time.tech at gmail.com
> <mailto:xerox.time.tech at gmail.com>> wrote:
>
> For example, for bipush interpreter code, it is like this in x86_64
>
> void TemplateTable::bipush() {
> transition(vtos, itos);
> __ load_signed_byte(rax, at_bcp(1));
> }
>
>
> I would like to know the size of the generated assembly by the
> TemplateTable::bipush in given a bcp.
>
>
> Not sure why you would want that, but here's what you could do:
>
> // Bytecodes::Code code = (Bytecodes::Code) i;
> address ep = Interpreter::dispatch_table()[i]; // or normal_table()
> InterpreterCodelet* codelet = Interpreter::codelet_containing(ep);
> int size = codelet->size(); // or code_size() or code_size_to_size()
>
> Code varies in detail depending on what you really want.
>
>
> Also, btw, i traced down the trace_bytecode. it calls overloaded
> traces. 1 with 1 tos and 1 with 2 toses. does that mean java opcodes
> can take up to 2 tos elements ?
>
>
> Short answer: no.
> tos and tos2 are there because on some architectures (e.g. 32-bit x86)
> the top-of-stack value may be stored in two registers (e.g. LTOS on
> x86_32 stores the long value in eax:edx).
> On 64-bit architectures, tos2 tends to do nothing, since tos is
> 64-bit, wide enough to hold any TOS value.
>
> - Kris
>
>
> Xin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20120508/f5a1d403/attachment.html
More information about the hotspot-runtime-dev
mailing list