Jens Rieks <[EMAIL PROTECTED]> wrote: > Hi, > On Monday 22 March 2004 13:54, Leopold Toetsch wrote:
>> And P3 := overflow_args ? >> P0 := the_sub ?? >> P1 := return_continuation ? >> S0 := method_name ? > Sounds okay. Maybe its better to either alias return_continuation to the > register where P1 has been saved to? Or add another alias for it? I'll very likely change the code, so that P1 is restored immediately after a function call (like P2 now). OTOH it shouldn't matter. C<return_continuation> or C<self> alias whatever the *actual* thing is. >> This is all not really good. The register allocator can't track the >> usage of Px. > That is a strong argument. "setp_ind" on the other hand is also not tracked. > getp_ind might by a reasonable tradeoff. Imcc starts allocating registers at 16. If more then 16 regs are needed, current code will wrap around and start allocating in the low range, e.g. it'll use P4. Then *if* there is no sign, that P5 is used, this will be allocated. If the only reference to P5 is an indirect register access, things will break, horribly. We can of course just define, that {g,s]etp_ind will only use registers 0..15 and the register allocator only uses 16..31. All is safe then again. 16 registers of one kind ougth to be enough. If it still comes to spilling, first lexicals and globals should be used - these already have a store somewhere. This still needs some PIR syntax extension: .lexical foo # pmc is implied .global bar > jens leo