1. Entries in the compiler database
    1. Variable properties
      1. captured
      2. global
      3. call-sites
      4. home
      5. unknown
      6. assigned
      7. assigned-locally
      8. undefined
      9. value
      10. potential-value
      11. references
      12. side-effecting
      13. foldable
      14. boxed
      15. contractable
      16. inlinable
      17. collapsable
      18. removable
      19. replacable
      20. replacing
      21. standard-binding
      22. extended-binding
      23. unused
      24. rest-parameter
      25. o-r/access-count
      26. constant
    2. Procedure properties
      1. contains
      2. contained-in
      3. has-unused-parameters
      4. use-expr
      5. closure-size
      6. customizable
      7. simple
      8. explicit-rest
      9. captured-variables

Entries in the compiler database

The compiler database maps each user- or internal variable name to a property list holding various properties that are obtained through a previous analysis pass over the compiled code. Additionally, the database contains entries for each procedure-id (a unique internal symbol identifier) for each lambda node processed during analysis.

Note that the interaction of these properties may be quite subtle and the influence certain combinations of variable and/or procedure attributes control all further optimization and translation phases. Performing modifications in the database should only be done with great care.

Variable properties

captured

 [property] captured -> <boolean>

If true: variable is used outside it's home-scope and so lexically visible in an inner (nested) lambda.

global

 [property] global -> <boolean>                      

If true: variable does not occur in any lambda-list.

call-sites

 [property] call-sites -> ((<lambda-id> <node>) ...) 

Known nodes of call-sites (##core#call nodes) that invoke a procedure bound to this variable.

home

 [property] home -> <lambda-id>                      

Procedure which introduces this variable (either in the lambda-list or via let).

unknown

 [property] unknown -> <boolean>                     

If true: variable can not have a known value.

assigned

 [property] assigned -> <boolean>                    

If true: variable is assigned somewhere.

assigned-locally

 [property] assigned-locally -> <boolean>           

If true: variable has been assigned inside user lambda.

undefined

 [property] undefined -> <boolean>                  

If true: variable is unknown yet but may be known later. letrec expands into let forms binding variables to ##core#undefined and this will result in this property being set.

value

 [property] value -> <node>                         

Variable has a known value refering to a node.

potential-value

 [property] potential-value -> <node>               

Global variable was assigned this value and may potentially be known.

currently not used, I believe - fw

references

 [property] references -> (<node> ...)               

Nodes that are accesses of this variable (##core#variable nodes).

side-effecting

 [property] side-effecting -> <boolean>             

If true: variable names side-effecting standard-binding.

foldable

 [property] foldable -> <boolean>                   

If true: variable names foldable standard-binding.

boxed

 [property] boxed -> <boolean>                      

If true: variable has to be boxed after closure-conversion (i.e. is assigned to).

contractable

 [property] contractable -> <boolean>               

If true: variable names contractable procedure (known and called only once). A variable is contractable if it has a procedure as known value, has only one use and one call-site and if the lambda has no free non-global variables or is an internal lambda.

inlinable

 [property] inlinable -> <boolean>                  

If true: variable names potentially inlinable procedure.

collapsable

 [property] collapsable -> <boolean>                

If true: variable is collapsable, that is, it refers to a known constant value which is either collapsable itself or is only referenced once.

removable

 [property] removable -> <boolean>                  

If true: variable is not used.

replacable

 [property] replacable -> <variable>                 

Variable can be replaced by another variable. A replacable variable has a variable as known value and if either that variable has a known value itself, or if it is not captured and referenced only once, the target and the source are never assigned and the source is non-global or we are in block-mode. The target-variable is not allowed to be global. The variable that can be substituted for the current one is marked as replacing. This is done to prohibit beta-contraction of the replacing variable (It wouldn't be there, if it was contracted).

Also make a variable replacable, if it has a known value of the form (lambda (<xvar>) (<kvar> <xvar>)) and is an internally created procedure.

replacing

 [property] replacing -> <boolean>                   

If true: variable can replace another variable (don't remove).

standard-binding

 [property] standard-binding -> <boolean>           

If true: variable names a standard binding as defined in c-platform.scm.

extended-binding

 [property] extended-binding -> <boolean>           

If true: variable names an extended binding as defined in c-platform.scm.

unused

 [property] unused -> <boolean>                      

If true: variable is a formal parameter that is never used. Another way to look at it is that a variable that has a known value that is a procedure, and if the number of call-sites is equal to the number of references (does not escape), then make all formal parameters unused which are never referenced or assigned (if no rest parameter exist). Also marks the procedure as has-unused-parameters (if not in callback-names). If the procedure is internal (a continuation) do NOT mark unused parameters.

rest-parameter

 [property] rest-parameter -> #f | 'vector | 'list  

If true: variable holds rest-argument list mode

o-r/access-count

 [property] o-r/access-count -> <n>                 

Contains number of references to this variable where the reference is an arguments of a optimizable rest operators (a standard operator that accesses the rest-argument and which can be replaced by a more efficient vector-operation).

constant

 [property] constant -> <boolean>                   

If true: variable has fixed value.

Procedure properties

contains

 [property] contains -> (<lambda-id> ...)           

Procedures contained in this lambda.

contained-in

 [property] contained-in -> <lambda-id>

Procedure containing this lambda.

has-unused-parameters

 [property] has-unused-parameters -> <boolean>      

If true: procedure has unused formal parameters.

use-expr

 [property] use-expr -> (<lambda-id> ...)           

Marks non-direct use-sites of common subexpression.

closure-size

 [property] closure-size -> <integer>               

Number of free variables stored in a closure.

customizable

 [property] customizable -> <boolean>               

If true: all call sites are known, procedure does not escape.

simple

 [property] simple -> <boolean>                     

If true: procedure only calls its continuation and no other procedures.

explicit-rest

 [property] explicit-rest -> <boolean>              

A procedure that is called with consed rest list and has no unused parameter variables.

captured-variables

 [property] captured-variables -> (<var> ...)       

List of closed over variables.