Related articles |
---|
[4 earlier articles] |
Re: What is byte-code ? nmm1@cus.cam.ac.uk (2005-03-08) |
Re: What is byte-code ? joe@burgershack.com (Randy) (2005-03-08) |
Re: What is byte-code ? Brian.Inglis@SystematicSW.ab.ca (Brian Inglis) (2005-03-08) |
Re: What is byte-code ? torbenm@diku.dk (2005-03-08) |
Re: What is byte-code ? torbenm@diku.dk (2005-03-08) |
Re: What is byte-code ? cdc@maxnet.co.nz (Carl Cerecke) (2005-03-08) |
Re: What is byte-code ? torbenm@diku.dk (2005-03-15) |
Re: What is byte-code ? kers@hpl.hp.com (Chris Dollin) (2005-03-15) |
Re: What is byte-code ? xous@xouslab.com (Xous - Jose R. Negreira) (2005-03-18) |
Re: What is byte-code ? nathan.moore@sdc.cox.net (Nathan Moore) (2005-03-24) |
Re: What is byte-code ? anton@mips.complang.tuwien.ac.at (2005-03-31) |
Re: What is byte-code ? anton@mips.complang.tuwien.ac.at (2005-03-31) |
Re: What is byte-code ? kers@hpl.hp.com (Chris Dollin) (2005-03-31) |
[8 later articles] |
From: | torbenm@diku.dk (=?iso-8859-1?q?Torben_=C6gidius_Mogensen?=) |
Newsgroups: | comp.compilers |
Date: | 15 Mar 2005 01:40:25 -0500 |
Organization: | Department of Computer Science, University of Copenhagen |
References: | 05-03-015 05-03-037 05-03-043 05-03-047 |
Keywords: | interpreter, VM |
Posted-Date: | 15 Mar 2005 01:40:25 EST |
Carl Cerecke <cdc@maxnet.co.nz> writes:
> Torben Ęgidius Mogensen wrote:
>
> > bytecodes have traditionally been interpreted rather than translated,
> > it is only in the last couple of decades that bytecodes designed for
> > compilation or JIT's have emerged.
>
> What is the difference between bytecodes designed for (JIT) compilation
> and bytecodes designed for interpreting? Your comment sounds like there
> are specific design decisions regarding bytecode structure that
> facilitate compilation. Or, rather, that some design decisions can make
> compilation more difficult/inefficient.
>
> Would you shed some light on what aspects of bytecodes facilitate/hinder
> compilation (JIT or otherwise)? (I'm not trying to start an argument, I
> just don't know enough about bytecodes to answer my question)
>
> Cheers,
> Carl.
> [I'd want my JIT code to have stronger typeing so I could figure out at
> code generation time what the datatypes of the operands all were. -John]
I agree with John on types. But there are other considerations:
- Bytecodes designed for interpretation needs low decoding overhead,
so you would tend to have a lot of "work" done per instruction.
With compiling, the decoding overhead is only paid once, so you can
have relatively higher decode cost and, hence, less work per
instruction. The compiler can then combine several small
instructions into single machine-code instructions.
- Bytecodes designed for compilation would tend to use registers
rather than a stack. An interpreter would have difficulty using
registers for all but a few user variables, as it can't indirectly
address registers. Hence, you often see stack-based bytecode for
interpretation. A compiler has no such problem, as it can compile
into direct register accesses.
- Bytecodes for interpretation often have specialized parameter-less
instructions for common cases, such as adding 1 to a variable or
setting it to 0, in order to reduce decoding overhead. With
compilation, the saving in decode matters little, so there is no
incentive to have such specialised instruction.
Torben
Return to the
comp.compilers page.
Search the
comp.compilers archives again.