Re: Register windows and OOP...

pardo@cs.washington.edu (David Keppel)
Mon, 3 Apr 1995 20:25:32 GMT

          From comp.compilers

Related articles
Register windows and OOP... ravindra@hal.com (1995-03-23)
Re: Register windows and OOP... pardo@cs.washington.edu (1995-04-03)
| List of all articles for this month |

Newsgroups: comp.compilers
From: pardo@cs.washington.edu (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@hal.com (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
performance.


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
problem.


Another caveat is that more sophisticated optimizers can do a better
job of inlining O-O calls. See, among others, the Cecil
(http://www.cs.washington.edu/research/projects/cecil/cecil/www/cecil-home.html)
and Self (http://self.stanford.edu) projects and ongoing work by Dirk
Grunwald (`grunwald@foobar.cs.colorado.edu').


>[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
(http://www.cs.washington.edu/homes/pardo/papers.d/regwin.html). 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.