remove math.blas.syntax and merge parsing words into math.blas.vectors/matrices
[factor/jcg.git] / basis / compiler / cfg / linear-scan / linear-scan.factor
blob855f2a6648e3cc7edf7dcae1fa3fd5d1fbf7273d
1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel accessors namespaces make
4 cpu.architecture
5 compiler.cfg
6 compiler.cfg.instructions
7 compiler.cfg.linear-scan.live-intervals
8 compiler.cfg.linear-scan.allocation
9 compiler.cfg.linear-scan.assignment ;
10 IN: compiler.cfg.linear-scan
12 ! References:
14 ! Linear Scan Register Allocation
15 ! by Massimiliano Poletto and Vivek Sarkar
16 ! http://www.cs.ucla.edu/~palsberg/course/cs132/linearscan.pdf
18 ! Linear Scan Register Allocation for the Java HotSpot Client Compiler
19 ! by Christian Wimmer
20 ! and http://www.ssw.uni-linz.ac.at/Research/Papers/Wimmer04Master/
22 ! Quality and Speed in Linear-scan Register Allocation
23 ! by Omri Traub, Glenn Holloway, Michael D. Smith
24 ! http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.34.8435
26 : (linear-scan) ( insns -- insns' )
27     dup compute-live-intervals
28     machine-registers allocate-registers assign-registers ;
30 : linear-scan ( mr -- mr' )
31     [
32         [
33             [
34                 (linear-scan) %
35                 spill-counts get _spill-counts
36             ] { } make
37         ] change-instructions
38     ] with-scope ;