Re: Register windows and OOP... (David Keppel)
Mon, 3 Apr 1995 20:25:32 GMT

          From comp.compilers

Related articles
Register windows and OOP... (1995-03-23)
Re: Register windows and OOP... (1995-04-03)
| List of all articles for this month |

Newsgroups: comp.compilers
From: (David Keppel)
Keywords: sparc, registers
Organization: Computer Science & Engineering, U. of Washington, Seattle
References: 95-03-135
Date: Mon, 3 Apr 1995 20:25:32 GMT (Ravindra Divekar) writes:
>[Why would register windows be better for ``object-oriented'' languaegs?]

Procedure calls are (I believe) more frequent in O-O languages than
e.g. C/FORTRAN; and although the methods (procedures) are often smaller,
many of the calls are harder to inline. As a result, calls (and
returns) appear more frequently in the executable code, and register
spills and restores are correspondingly more frequent.

Register windows are designed to make spills and restores fast -- a
single cycle in the common case. In much C/FORTRAN code, spills and
restores are rare enough that making them faster won't make the overall
program any faster. In code generated from O-O source, they are
arguably common enough that making them faster does improve overall

One caveat is that register windows may be slower than normal saves and
restores if there are many nested calls before returns. Thus, A calls
X then Y then Z is more likely to benefit from register windows than A
calls X, X calls Y, Y calls Z. I've heard that some LISP systems avoid
register windows (for some implementations) because the call pattern is
typically ``deep'', though more register sets in hardware eases the

Another caveat is that more sophisticated optimizers can do a better
job of inlining O-O calls. See, among others, the Cecil
and Self ( projects and ongoing work by Dirk
Grunwald (`').

>[I know that register windows help context switching...]

Because register windows increase the size of the processor state they
often hurt context switching, even when used as one set/thread
( The
general idea is to make straight-line code fast enough to more than pay
for slightly slower context switches.

;-D on ( My windows are registered ) Pardo

Post a followup to this message

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