| Related articles |
|---|
| From: | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
| Newsgroups: | comp.compilers |
| Date: | Fri, 02 Mar 2018 09:30:42 GMT |
| Organization: | Institut fuer Computersprachen, Technische Universitaet Wien |
| References: | 18-02-009 18-02-012 18-02-016 18-02-018 18-02-023 18-02-029 18-02-032 18-02-034 18-03-002 |
| Injection-Info: | gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="93948"; mail-complaints-to="abuse@iecc.com" |
| Keywords: | design, code |
| Posted-Date: | 03 Mar 2018 13:16:08 EST |
George Neuner <gneuner2@comcast.net> writes:
>On Sat, 17 Feb 2018 16:39:04 GMT, anton@mips.complang.tuwien.ac.at
>(Anton Ertl) wrote:
>
>>Kaz Kylheku <217-679-0842@kylheku.com> writes:
>>>On 2018-02-15, George Neuner <gneuner2@comcast.net> wrote:
>>>> No worries. IME, displays don't get much respect from modern
>>>> textbooks - they are mentioned mostly in passing.
>>>
>>>This is probably because of
>>
>>This is because displays were found to be more costly for Algol-like
>>languages
>
>More costly than what?
Static link chains.
>> IIRC the additional cost is in updating the display on calls
>>and returns.
>
>Which is no different from the overhead to maintain static links
Wrong. Consider the following nesting of functions:
A
B
C
D
With a display, in C you have built up a display pointing to the
frames of C, B, and A. When performing a call from C to D, you throw
that away and replace it with a display pointing to just the frame of
D. When returning from D, you have to restore the old display.
If you don't maintain a static link chain, you have to save the
complete display of C on the call and restore it on return. Note that
D may itself call functions that need more display, so you don't get
away with just saving and restoring the first slot of the display.
IIRC this was the variant looked at in the paper that concluded that
displays are more costly.
If you maintain a static link chain, you can restore the display of C
from the static link chain, but you now have the cost of maintaining
the static link chain and in addition the cost of maintaining the
display, which is obviously more costly than just the static chain
alone. If you go that way, you can actually produce an intermediate
scheme, where you cache static link accesses that you need, and the
cached accesses are similar to (the needed part of) a display.
>I'd really like to see that paper to find out what they are comparing
>to display [and using what language].
The language was probably Algol or one of it's direct offspring.
Anyway, if I get around to it, I will search for a reference to the
paper in our library, but if someone else can supply the reference,
that would be cool.
>>Static link chains work fine.
>
>Yes, they do work - but they are the lowest performance option for
>non-local accesses.
The first non-local level has the same performance as a display. Are
deeper accesses frequent enough to pay for the increased cost of
maintaining the display? The paper's answer was no, but that may vary
from language to language (and with usage patterns). Relative
hardware costs have also shifted somewhat. Bottom line: Better
reevaluate the options yourself.
- anton
--
M. Anton Ertl
anton@mips.complang.tuwien.ac.at
http://www.complang.tuwien.ac.at/anton/
Return to the
comp.compilers page.
Search the
comp.compilers archives again.