Re: Add nested-function support in a language the based on a stack-machine

dror.openu@gmail.com
Mon, 12 Feb 2018 14:16:20 -0800 (PST)

          From comp.compilers

Related articles
| List of all articles for this month |
From: dror.openu@gmail.com
Newsgroups: comp.compilers
Date: Mon, 12 Feb 2018 14:16:20 -0800 (PST)
Organization: Compilers Central
References: 18-02-009
Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="79235"; mail-complaints-to="abuse@iecc.com"
Keywords: code, comment
Posted-Date: 12 Feb 2018 17:29:32 EST

> [This at least used to be a standard topic in compiler texts. You should
> be able to do either in O(1). -John]


I'm not sure how to calculate it in compile time, because the call frame
doesn't have a fixed size, because I'm using the same stack for storing the
call-frames and for the operations evaluation (iadd, isub, etc..). Maybe I
should split it into two stacks, one for the call frames, and the second for
the operation evaluations. I just sharing my thoughts.


[I would think that your compiler should always know how many partial
results are on the stack above the call frame so it should be able to
use a fixed offset to get to the chain pointers at the base of call
frame. -John]


Post a followup to this message

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