|
Boost : |
From: Greg Colvin (greg_at_[hidden])
Date: 2001-08-10 10:47:05
From: <k.hagan_at_[hidden]>
> "Greg Colvin" <greg_at_[hidden]> wrote...
> >
> > It seems a compiler for a "fast local stack" machine can simply
> > note which local variables have their address used and not keep
> > them on the fast stack. Doesn't seem all that different from
> > using registers for locals on a machine with register windows.
>
> The big difference is that registers are likely to be restricted
> to the built-in types, and those are the types for which the
> compiler can see "taking their address" most easily.
>
> If I create an object on the stack and call a member function, a
> compiler would normally be unable to prove that the operation didn't
> pass an address to another thread. In practice, then, nearly all
> objects would have to be placed on the slow stack, which is nearly
> always unnecessarily pessimistic.
Compilers these days can prove the damnedest things.
> (Do machines with fast local stacks also have fast local heaps?)
I don't know, as no one on this thread has mentioned any
real machines. It would help if they did, as otherwise
this may be a purely theoretical diversion.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk