>>OO code is full of subs which a) are called very often and b) look >>like this: >> >> sub code >> { >> my $self = shift; >> return $self->{CODE}; >> } >> >> sub body >> { >> my $self = shift; >> if (@_) { >> $self->{BODY} = shift; >> } >> >> return $self->{BODY}; >> } > >Yup, caller save doesn't necessarily favor code like this. On the >other hand, it does favor recursive code and code with heavier-weight >bodies. It's always a toss-up. Nothing's free, and all decisions have >consequences of some sort.
I think caller save is the way to go. I am just questioning how many registers to actually save prior to each call. The cost of saving registers may be relatively cheap, but it is not zero. There must be a good reason why the calling conventions on register rich CPUs often call-save just 6 registers. It must have been backed up by research with hard numbers on hundreds of typical programs. __________________________________________________ Do You Yahoo!? Yahoo! Health - your guide to health and wellness http://health.yahoo.com