x86 interpreters in hotspot
Krystal Mok
rednaxelafx at gmail.com
Mon May 7 23:34:31 PDT 2012
On Tue, May 8, 2012 at 11:17 AM, Xin Tong <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/addb29dd/attachment.html
More information about the hotspot-runtime-dev
mailing list