>>>Also, it's perfectly fine for a coordinated group of PMCs (like, say, 
>>>the ones that provide perl's base scalar behavior) to share grubby 
>>>internal knowledge, though I'd like to keep that under control, as it's 
>>>easy to get out of sync.

Ok, now that I'm looking closer, it appears my optimization might be broken,
depending on assumptions.

     void subtract_int (INTVAL value, PMC* dest) {
         dest->cache.int_val = SELF->cache.int_val - value;
     }

Would be broken if we did

sub P0, P1, 5

and P0 wasn't a PerlInt.

I think the common case is:

sub P0, P0, 5

which is basically

dec P0, 5

but we don't currently only have dec/inc for INT and NUM, not PMC.  Not good.

Maybe my optimization was well-intended but mis-placed.

-Melvin

Reply via email to