[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: VM optimization (was Re: Re: Still cryptic OOP syntax)
- From: Mark Hamburg <mhamburg@...>
- Date: Mon, 31 Jan 2005 16:19:20 -0800
on 1/31/05 10:15 AM, David Olofson at firstname.lastname@example.org wrote:
> On Monday 31 January 2005 17.15, Mark Hamburg wrote:
>> 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.
> That means operations and operands are inherently lists, rather than
> trees? That's obviously very handy, but isn't that pretty close to
> what you get if you optimize somewhere close to, or on the generated
> code for any normal CPU or VM? Peephole optimization, that is. Works
> whether you want shorter/faster sequences or complex instructions.
Forth is particularly amenable to this sort of peephole optimization because
of its execution model. It also effectively has a very large instruction
>> More in keeping with the conventional byte-code model is to use
>> bottom-up tree-rewriting to use complex instructions. lcc does this.
> Do you have any links related to this?