Re: Optimizing stack access for a stack based VM

Hans-Peter Diettrich <DrDiettrich1@aol.com>
Thu, 13 Sep 2007 22:31:31 +0200

          From comp.compilers

Related articles
Optimizing stack access for a stack based VM jirik.svoboda@seznam.cz (Jiri Svoboda) (2007-09-11)
Re: Optimizing stack access for a stack based VM DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-09-13)
Re: Optimizing stack access for a stack based VM blog@rivadpm.com (Alex McDonald) (2007-09-13)
Re: Optimizing stack access for a stack based VM lkrupp@pssw.com (Louis Krupp) (2007-09-13)
Re: Optimizing stack access for a stack based VM DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-09-13)
Re: Optimizing stack access for a stack based VM DrDiettrich1@aol.com (Hans-Peter Diettrich) (2007-09-13)
Re: Optimizing stack access for a stack based VM jvorbrueggen@not-mediasec.de (=?ISO-8859-1?Q?Jan_Vorbr=FCggen?=) (2007-09-14)
Re: Optimizing stack access for a stack based VM blog@rivadpm.com (Alex McDonald) (2007-09-14)
Re: Optimizing stack access for a stack based VM kenney@cix.compulink.co.uk (2007-09-14)
Re: Optimizing stack access for a stack based VM jeffrey.kenton@comcast.net (Jeff Kenton) (2007-09-16)
Re: Optimizing stack access for a stack based VM dot@dotat.at (Tony Finch) (2007-09-16)
[1 later articles]
| List of all articles for this month |

From: Hans-Peter Diettrich <DrDiettrich1@aol.com>
Newsgroups: comp.compilers
Date: Thu, 13 Sep 2007 22:31:31 +0200
Organization: Compilers Central
References: 07-09-030 07-09-042
Keywords: storage, optimize
Posted-Date: 13 Sep 2007 22:53:40 EDT

Alex McDonald wrote:


>>There are separate address space for (1) code, (2) data, (3) stack.
>
> The separation between code and data isn't required in Forth (although
> there may be advantages in certain architectures that treat each space
> differently, or don't like mixing of code and data).


IMO Forth is not a direct solution for the OP, since...


> "Variables" in Forth are words that push their addresses on the stack,
> as in the @ and ! example given above. Forth also has a value, or a
> self fetching variable.


Forth has no local variables (for recursive calls), the implementation
of e.g. loop counters requires two separate stacks, for data and
return addresses. Calling subroutines (Forth: compiled words) for the
retrieval of references to variables IMO also is overkill, in a VM
other than the Forth machine itself.


Nonetheless Forth is a source of inspiration, for everybody who wants
to learn more about really uncommon virtual machines :-)


DoDi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.