compiler.tree.escape-analysis.allocations: stub doc file from comments
parent
b4e4792cb6
commit
06560b24a6
|
@ -0,0 +1,28 @@
|
||||||
|
USING: compiler.tree disjoint-sets help.markup help.syntax ;
|
||||||
|
IN: compiler.tree.escape-analysis.allocations
|
||||||
|
|
||||||
|
HELP: allocations
|
||||||
|
{ $var-description "A map from values to one of the following:"
|
||||||
|
{ $list
|
||||||
|
"f -- initial status, assigned to values we have not seen yet; may potentially become an allocation later"
|
||||||
|
"a sequence of values -- potentially unboxed tuple allocations"
|
||||||
|
"t -- not allocated in this procedure, can never be unboxed"
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
HELP: compute-escaping-allocations
|
||||||
|
{ $description "Compute which tuples escape" } ;
|
||||||
|
|
||||||
|
HELP: escaping-values
|
||||||
|
{ $var-description "We track escaping values with a " { $link disjoint-set } "." } ;
|
||||||
|
|
||||||
|
HELP: slot-access
|
||||||
|
{ $var-description "We track slot access to connect constructor inputs with accessor outputs." } ;
|
||||||
|
|
||||||
|
HELP: value-classes
|
||||||
|
{ $var-description "A map from values to classes. Only for " { $link #introduce } " outputs." } ;
|
||||||
|
|
||||||
|
ARTICLE: "compiler.tree.escape-analysis.allocations" "Tracking memory allocations"
|
||||||
|
"Tracks memory allocations and unboxes those which can be determined never escapes." ;
|
||||||
|
|
||||||
|
ABOUT: "compiler.tree.escape-analysis.allocations"
|
|
@ -5,18 +5,12 @@ namespaces sequences stack-checker.values ;
|
||||||
FROM: namespaces => set ;
|
FROM: namespaces => set ;
|
||||||
IN: compiler.tree.escape-analysis.allocations
|
IN: compiler.tree.escape-analysis.allocations
|
||||||
|
|
||||||
! A map from values to classes. Only for #introduce outputs
|
|
||||||
SYMBOL: value-classes
|
SYMBOL: value-classes
|
||||||
|
|
||||||
: value-class ( value -- class ) value-classes get at ;
|
: value-class ( value -- class ) value-classes get at ;
|
||||||
|
|
||||||
: set-value-class ( class value -- ) value-classes get set-at ;
|
: set-value-class ( class value -- ) value-classes get set-at ;
|
||||||
|
|
||||||
! A map from values to one of the following:
|
|
||||||
! - f -- initial status, assigned to values we have not seen yet;
|
|
||||||
! may potentially become an allocation later
|
|
||||||
! - a sequence of values -- potentially unboxed tuple allocations
|
|
||||||
! - t -- not allocated in this procedure, can never be unboxed
|
|
||||||
SYMBOL: allocations
|
SYMBOL: allocations
|
||||||
|
|
||||||
: (allocation) ( -- allocations )
|
: (allocation) ( -- allocations )
|
||||||
|
@ -31,8 +25,6 @@ SYMBOL: allocations
|
||||||
: record-allocations ( allocations values -- )
|
: record-allocations ( allocations values -- )
|
||||||
(allocation) '[ _ set-at ] 2each ;
|
(allocation) '[ _ set-at ] 2each ;
|
||||||
|
|
||||||
! We track slot access to connect constructor inputs with
|
|
||||||
! accessor outputs.
|
|
||||||
SYMBOL: slot-accesses
|
SYMBOL: slot-accesses
|
||||||
|
|
||||||
TUPLE: slot-access slot# value ;
|
TUPLE: slot-access slot# value ;
|
||||||
|
@ -42,7 +34,6 @@ C: <slot-access> slot-access
|
||||||
: record-slot-access ( out slot# in -- )
|
: record-slot-access ( out slot# in -- )
|
||||||
<slot-access> swap slot-accesses get set-at ;
|
<slot-access> swap slot-accesses get set-at ;
|
||||||
|
|
||||||
! We track escaping values with a disjoint set.
|
|
||||||
SYMBOL: escaping-values
|
SYMBOL: escaping-values
|
||||||
|
|
||||||
SYMBOL: +escaping+
|
SYMBOL: +escaping+
|
||||||
|
@ -126,7 +117,6 @@ DEFER: copy-value
|
||||||
[ nth swap copy-value ]
|
[ nth swap copy-value ]
|
||||||
} cond ;
|
} cond ;
|
||||||
|
|
||||||
! Compute which tuples escape
|
|
||||||
SYMBOL: escaping-allocations
|
SYMBOL: escaping-allocations
|
||||||
|
|
||||||
: compute-escaping-allocations ( -- )
|
: compute-escaping-allocations ( -- )
|
||||||
|
|
Loading…
Reference in New Issue