34 lines
1.0 KiB
Factor
34 lines
1.0 KiB
Factor
|
! Copyright (C) 2008 Slava Pestov.
|
||
|
! See http://factorcode.org/license.txt for BSD license.
|
||
|
USING: kernel accessors namespaces
|
||
|
compiler.backend
|
||
|
compiler.cfg
|
||
|
compiler.cfg.linear-scan.live-intervals
|
||
|
compiler.cfg.linear-scan.allocation
|
||
|
compiler.cfg.linear-scan.assignment ;
|
||
|
IN: compiler.cfg.linear-scan
|
||
|
|
||
|
! References:
|
||
|
|
||
|
! Linear Scan Register Allocation
|
||
|
! by Massimiliano Poletto and Vivek Sarkar
|
||
|
! http://www.cs.ucla.edu/~palsberg/course/cs132/linearscan.pdf
|
||
|
|
||
|
! Linear Scan Register Allocation for the Java HotSpot Client Compiler
|
||
|
! by Christian Wimmer
|
||
|
! and http://www.ssw.uni-linz.ac.at/Research/Papers/Wimmer04Master/
|
||
|
|
||
|
! Quality and Speed in Linear-scan Register Allocation
|
||
|
! by Omri Traub, Glenn Holloway, Michael D. Smith
|
||
|
! http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.8435
|
||
|
|
||
|
: linear-scan ( mr -- mr' )
|
||
|
[
|
||
|
[
|
||
|
dup compute-live-intervals
|
||
|
machine-registers allocate-registers
|
||
|
assign-registers
|
||
|
] change-instructions
|
||
|
spill-counts get >>spill-counts
|
||
|
] with-scope ;
|