On Sat, Nov 30, 2002 at 11:15:28AM +0100, Jerome Quelin wrote:

> When I want to save all the integer registers, I'm using pushi, 
> restoring them later with popi.
> When I'm doing a pushi, the old values of the registers are still 
> present, but I'm wondering wether I can rely on this behavior, or if 
> it's accidental and may be removed with another implementation?

I don't think that any real, er I mean "hardware", CPU scrubs registers when
you push them - it's effectively a copy of the register onto the stack.

I was thinking that maybe the JIT can benefit from it actually not being
guaranteed, as it would let a CPU register mapping system drop the
association of CPU register and parrot register at that point. But then I
thought that it doesn't matter anyway - for most cases the JIT should have
enough trace flow to know whether the register contents are not going to get
used again (in which case it can break the mapping). [With the corollary that
if the values in them are re-used, then clearly the mapping must continue]

So I think it would be sensible to defined that you can rely on this, as it
is the least surprising behaviour.

Nicholas Clark
-- 
Brainfuck better than perl?     http://www.perl.org/advocacy/spoofathon/

Reply via email to