Leopold Toetsch <[EMAIL PROTECTED]> writes: > Piers Cawley wrote: >> But under this scheme, the implementing function will have to do a >> saveall for every function it calls because it doesn't know what >> registers its caller cares about. And you're almost certainly going >> to want to call other functions to do the heavy lifting for all the >> usual reasons of code reuse. > > Yep that's true. As well as with real caller saves. Which leads back to > my (almost) warnocked "proposal":
Consider a sub, call it fred, that calls other subs and only uses PMC registers. At compile time, you wrap those calls in appropriate pushtopp/poptopp pairs. Then, at runtime, 'fred' gets set up as the implemntation for an op. Which, given your implementation, means that each function call that fred makes should be protected with savetop/restoretop pairs. Oops.