compiler.cfg.linear-scan: clean up spill slot assignment

db4
Slava Pestov 2010-04-30 18:19:56 -04:00
parent 65f86bfce7
commit ffd1844d52
2 changed files with 4 additions and 6 deletions

View File

@ -118,7 +118,7 @@ SYMBOL: unhandled-intervals
[ reg-classes ] dip { } map>assoc ; inline [ reg-classes ] dip { } map>assoc ; inline
: next-spill-slot ( rep -- n ) : next-spill-slot ( rep -- n )
rep-size cfg get cfg get
[ swap [ align dup ] [ + ] bi ] change-spill-area-size drop [ swap [ align dup ] [ + ] bi ] change-spill-area-size drop
<spill-slot> ; <spill-slot> ;
@ -129,12 +129,10 @@ SYMBOL: unhandled-sync-points
SYMBOL: spill-slots SYMBOL: spill-slots
: assign-spill-slot ( coalesced-vreg rep -- spill-slot ) : assign-spill-slot ( coalesced-vreg rep -- spill-slot )
dup tagged-rep? [ drop int-rep ] when rep-size spill-slots get [ nip next-spill-slot ] 2cache ;
spill-slots get [ nip next-spill-slot ] 2cache ;
: lookup-spill-slot ( coalesced-vreg rep -- spill-slot ) : lookup-spill-slot ( coalesced-vreg rep -- spill-slot )
dup tagged-rep? [ drop int-rep ] when rep-size 2array spill-slots get ?at [ ] [ bad-vreg ] if ;
2array spill-slots get ?at [ ] [ bad-vreg ] if ;
: init-allocator ( registers -- ) : init-allocator ( registers -- )
registers set registers set

View File

@ -36,7 +36,7 @@ M: location hashcode*
SYMBOL: spill-temps SYMBOL: spill-temps
: spill-temp ( rep -- n ) : spill-temp ( rep -- n )
spill-temps get [ next-spill-slot ] cache ; rep-size spill-temps get [ next-spill-slot ] cache ;
: add-mapping ( from to rep -- ) : add-mapping ( from to rep -- )
'[ _ <location> ] bi@ 2array , ; '[ _ <location> ] bi@ 2array , ;