Allocation of PASM registers (in PASM mode)

Allison Randal allison at parrot.org
Sun Jan 11 21:10:04 UTC 2009


Will Coleda wrote:
> 
> If P42 in PASM acts the same way as $P42 in PIR, why do we have two
> different ways to say the same thing?

PASM and PIR are different languages, and represent registers 
differently. Specifically, we kept the $ in PIR, because it means we 
don't have to reserve all names that might look like register names to 
prevent confusion if someone declares:

   .local pmc P246

PASM, on the other hand, doesn't have named variables, so the extra $ is 
useless.


The one argument against sane register allocation in PASM is that if 
PASM is a "plain-english representation of bytecode", and bytecode deals 
with literal registers, then PASM should deal with literal registers 
too. But, I'd rather solve that with a convention that when dumping 
bytecode to PASM, it dumps "P2" for PMC register 2 (for easy 
identification). But, when you re-run the dumped PASM, it may allocate 
the registers differently (especially if you've modified the dumped PASM).

Allison


More information about the parrot-dev mailing list