C# Class System.Linq.Expressions.Compiler.CompilerScope

CompilerScope is the data structure which the Compiler keeps information related to compiling scopes. It stores the following information: 1. Parent relationship (for resolving variables) 2. Information about hoisted variables 3. Information for resolving closures Instances are produced by VariableBinder, which does a tree walk looking for scope nodes: LambdaExpression and BlockExpression.
Mostra file Open project: kumpera/mono Class Usage Examples

Private Properties

Property Type Description
AddLocal void
AllocateLocals void
CacheBoxToLocal void
CompilerScope System
EmitAddressOf void
EmitCachedVariables void
EmitClosureAccess void
EmitClosureToVariable void
EmitGet void
EmitNewHoistedLocals void
EmitSet void
EmitVariableAccess void
Enter CompilerScope
Exit CompilerScope
GetVariables IList
GetVariables IList
ResolveVariable Storage
ResolveVariable Storage
SetParent void
ShouldCache bool
ShouldCache bool

Private Methods

Method Description
AddLocal ( LambdaCompiler gen, ParameterExpression variable ) : void

Adds a new virtual variable corresponding to an IL local

AllocateLocals ( LambdaCompiler lc ) : void
CacheBoxToLocal ( LambdaCompiler lc, ParameterExpression v ) : void
CompilerScope ( object node, bool isMethod ) : System
EmitAddressOf ( ParameterExpression variable ) : void
EmitCachedVariables ( ) : void
EmitClosureAccess ( LambdaCompiler lc, HoistedLocals locals ) : void
EmitClosureToVariable ( LambdaCompiler lc, HoistedLocals locals ) : void
EmitGet ( ParameterExpression variable ) : void
EmitNewHoistedLocals ( LambdaCompiler lc ) : void
EmitSet ( ParameterExpression variable ) : void
EmitVariableAccess ( LambdaCompiler lc, ReadOnlyCollection vars ) : void
Enter ( LambdaCompiler lc, CompilerScope parent ) : CompilerScope

Called when entering a lambda/block. Performs all variable allocation needed, including creating hoisted locals and IL locals for accessing parent locals

Exit ( ) : CompilerScope

Frees unnamed locals, clears state associated with this compiler

GetVariables ( ) : IList
GetVariables ( object scope ) : IList
ResolveVariable ( ParameterExpression variable ) : Storage
ResolveVariable ( ParameterExpression variable, HoistedLocals hoistedLocals ) : Storage

Resolve a local variable in this scope or a closed over scope Throws if the variable is defined

SetParent ( LambdaCompiler lc, CompilerScope parent ) : void
ShouldCache ( ParameterExpression v ) : bool
ShouldCache ( ParameterExpression v, int refCount ) : bool