Luke Palmer <[EMAIL PROTECTED]> wrote:It seems to me that there is no good solution to this problem without annotating the register set or killing the register allocator.
I think I've proposed a reasonable solution: putting lexicals in registers.
I'm reading these threads a bit out of order so I think I'm missing some context here, but lexicals in registers works out fine as long as the backing pad is kept up to date. (And since PMCs are all reference types that's pretty easy) Lexicals *exclusively* in registers won't work -- the languages we're doing require pads.
If the big issue is spilling properly, lexicals could be removed entirely from the spill picture with proper PIR notation and some fleshing out of how we're handling pads. For example it'd be fine to do something like:
.sub foo
.lexicals x, y, z
%1 = new Integer
%2 = new String
%3 = new Hash
%1 = 12
%2 = "foo"
%3[%2] = %1
.end%nnn could work the same as $Pnnn notation but refer to slots in the current pad. Since these are always PMCs, and always have a functioning backing store, they can be dropped as need be and reloaded.
Originally they were going to be tied in heavily to the full array notation so lexicals wouldn't be required to take up registers -- code like:
a = b + c
could've been expressed by a single op:
add lexbase[1], lexbase[2], lexbase[3]
and take a lot of pressure of the register allocator, but...
--
Dan--------------------------------------it's like this-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk
