lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Not applicable to Lua without whacking pretty much everything, but Forth is
very interesting in this regard by virtue of having separate operand stacks
and return address stacks. Since every Forth word (subroutine) is either a
primitive or a sequence of other Forth words, it becomes straightforward to
recognize common subsequences of Forth words and first define them as words
in their own right (code compression) and re-implement them as native code
(optimization) if appropriate.

Unfortunately, modern processors aren't quite as friendly toward Forth as
they might be.

More in keeping with the conventional byte-code model is to use bottom-up
tree-rewriting to use complex instructions. lcc does this.


on 1/31/05 1:06 AM, David Olofson at wrote:

> One way to lessen the impact of instruction decoding is to go "extreme
> CISC", reducing VM overhead by allowing more work to be done with
> fewer instructions. SIMD isone way to go, but that tends to make life
> hard on the compiler. Creating "combo" instructions for commonly used
> macro operations is probably the first step.