compiler.cfg.linear-scan: extend lifetime intervals of base pointers correctly (reported by Anton Gorenko)
parent
e6de81706b
commit
b052aa61cb
|
@ -132,17 +132,30 @@ M: vreg-insn compute-live-intervals* ( insn -- )
|
|||
[ [ temp-vregs ] dip '[ _ record-temp ] each ]
|
||||
2tri ;
|
||||
|
||||
! Extend lifetime intervals of base pointers, so that their
|
||||
! values are available even if the base pointer is never used
|
||||
! again.
|
||||
|
||||
GENERIC: uses-vregs* ( insn -- seq )
|
||||
|
||||
M: gc-map-insn uses-vregs* ( insn -- )
|
||||
[ uses-vregs ] [ gc-map>> derived-roots>> values ] bi append ;
|
||||
|
||||
M: vreg-insn uses-vregs* uses-vregs ;
|
||||
|
||||
M: insn uses-vregs* drop f ;
|
||||
|
||||
M: clobber-insn compute-live-intervals* ( insn -- )
|
||||
dup insn#>>
|
||||
[ [ defs-vregs ] dip '[ _ f record-def ] each ]
|
||||
[ [ uses-vregs ] dip '[ _ t record-use ] each ]
|
||||
[ [ uses-vregs* ] dip '[ _ t record-use ] each ]
|
||||
[ [ temp-vregs ] dip '[ _ record-temp ] each ]
|
||||
2tri ;
|
||||
|
||||
M: hairy-clobber-insn compute-live-intervals* ( insn -- )
|
||||
dup insn#>>
|
||||
[ [ defs-vregs ] dip '[ _ t record-def ] each ]
|
||||
[ [ uses-vregs ] dip '[ _ t record-use ] each ]
|
||||
[ [ uses-vregs* ] dip '[ _ t record-use ] each ]
|
||||
[ [ temp-vregs ] dip '[ _ record-temp ] each ]
|
||||
2tri ;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ math memory namespaces namespaces.private parser
|
|||
quotations sequences specialized-arrays stack-checker
|
||||
stack-checker.errors system threads tools.test words
|
||||
alien.complex concurrency.promises alien.data
|
||||
byte-arrays classes compiler.test ;
|
||||
byte-arrays classes compiler.test libc ;
|
||||
FROM: alien.c-types => float short ;
|
||||
SPECIALIZED-ARRAY: float
|
||||
SPECIALIZED-ARRAY: char
|
||||
|
@ -823,3 +823,9 @@ TUPLE: some-tuple x ;
|
|||
aa-indirect-1 >>x
|
||||
] compile-call
|
||||
] unit-test
|
||||
|
||||
! GC maps regression
|
||||
: anton's-regression ( -- )
|
||||
f (free) f (free) ;
|
||||
|
||||
[ ] [ anton's-regression ] unit-test
|
||||
|
|
Loading…
Reference in New Issue