compiler.cfg.alias-analysis: fix bug in lazy alias class instantiation

db4
Slava Pestov 2010-09-26 21:16:50 -07:00 committed by Slava Pestov
parent e48c28359e
commit 53aed0805a
1 changed files with 4 additions and 3 deletions

View File

@ -14,7 +14,8 @@ compiler.cfg.representations.preferred ;
FROM: namespaces => set ; FROM: namespaces => set ;
IN: compiler.cfg.alias-analysis IN: compiler.cfg.alias-analysis
! We try to eliminate redundant slot operations using some simple heuristics. ! We try to eliminate redundant slot operations using some
! simple heuristics.
! !
! All heap-allocated objects which are loaded from the stack, or ! All heap-allocated objects which are loaded from the stack, or
! other object slots are pessimistically assumed to belong to ! other object slots are pessimistically assumed to belong to
@ -108,7 +109,7 @@ SYMBOL: heap-ac
2dup eq? [ 2drop ] [ 2dup eq? [ 2drop ] [
[ ac>vregs ] dip [ ac>vregs ] dip
[ vregs>acs get '[ [ _ ] dip _ set-at ] each ] [ vregs>acs get '[ [ _ ] dip _ set-at ] each ]
[ acs>vregs get at push-all ] [ ac>vregs push-all ]
2bi 2bi
] if ; ] if ;
@ -129,7 +130,7 @@ ERROR: vreg-not-new vreg ;
#! Set alias class of newly-seen vreg. #! Set alias class of newly-seen vreg.
vreg vregs>acs get key? [ vreg vreg-not-new ] when vreg vregs>acs get key? [ vreg vreg-not-new ] when
ac vreg vregs>acs get set-at ac vreg vregs>acs get set-at
vreg ac acs>vregs get push-at ; vreg ac ac>vregs push ;
: live-slot ( slot#/f vreg -- vreg' ) : live-slot ( slot#/f vreg -- vreg' )
#! If the slot number is unknown, we never reuse a previous #! If the slot number is unknown, we never reuse a previous