Skip to content
Stéphane Lozier edited this page Jan 18, 2021 · 1 revision

3 ET Runtime

There are a few functions that are required by the code the ET compiler produces. When generating and compiling ETs for execution within the same process, there are no issues whatsoever. The following functions or any changes to them will be consistent within the version of the .NET Framework that you are using:

RuntimeOps.MergeRuntimeVariables(

IRuntimeVariables first, IRuntimeVariables second, int[] indexes)

RuntimeOps.Quote(Expression expression, object hoistedLocals,

object[] locals)

If you use LambdaExpression.CompileToMethod to generate a DLL with your code, then you cannot use UnaryExpression with node kind Quote, which requires the above functions. However, CompileToMethod may emit calls to these methods:

IRuntimeVariables RuntimeOps.CreateRuntimeVariables(

object[] data, long[] indexes)

IRuntimeVariables RuntimeOps.CreateRuntimeVariables()

We need to keep these around and working if the DLL the customer writes out is otherwise working in future version of the CLR.

Expression Trees v2 Spec

Frontmatter
1 Introduction
  1.1 Relation to Other Models
  1.2 Review from LINQ Expression Trees v1
  1.3 Design Goals
    1.3.1 Compatibility with V1
    1.3.2 Model Abstraction Level
    1.3.3 .NET 4.0 vs. V-next+1
    1.3.4 Non-goal: Design Time Language Models
2 Highlighted Concepts
  2.1 Expression-based Model
  2.2 Reducible Nodes
  2.3 Bound, Unbound, and Dynamic Nodes
    2.3.1 DynamicExpression Node
    2.3.2 Binding Information in Expression Nodes
  2.4 Iteration, Goto's, and Exits
    2.4.1 LoopExpression and Higher-level Iteration Node Types
    2.4.2 Modeling Exits, LabelExpression, and GotoExpression with a Value
    2.4.3 GotoExpression Capabilities
  2.5 Assignments and L-values
    2.5.1 Indexed Locations
    2.5.2 Compound Assignment or In-place Binary and Unary Operations
    2.5.3 User-defined Setting Syntax
    2.5.4 Destructuring Assignment
  2.6 Array Access
  2.7 Blocks, Scopes, Variables, ParameterExpression, and Explicit Lifting
  2.8 Lambdas
    2.8.1 Ensuring Returns are Lexical Exits with Matching Types
    2.8.2 Throw
    2.8.3 Recursion
    2.8.4 Tail Call
  2.9 Generators (Codeplex only)
  2.10 Rich Static Call Site Modeling (v-next+1)
  2.11 Expression "Tree" Where Possible
  2.12 Serializability
  2.13 Shared Visitor Support
  2.14 Design Impact from Performance Improvements
  2.15 Annotations (Debug/Source Information Only)
    2.15.1 Source Location Information
    2.15.2 CUT General Annotations Support
  2.16 Node Kind and Operator Enum Values
  2.17 ToString Method
3 ET Runtime
4 API Reference
  4.1 Terminology for Lifted V1 Spec Text (marked by boxed red text)
  4.2 Quirks Mode for Silverlight
  4.3 Expression Abstract Class
    4.3.1 Class Summary
    4.3.2 NodeType Property
    4.3.3 Type Property
    4.3.4 CanReduce Property
    4.3.5 Reduce Method
    4.3.6 ReduceAndCheck Method
    4.3.7 ReduceExtensions Method
    4.3.8 DebugView Property
    4.3.9 DumpExpression Method (Codeplex only)
    4.3.10 GetFuncType Method
    4.3.11 TryGetFuncType Method
    4.3.12 GetActionType Method
    4.3.13 TryGetActionType Method
    4.3.14 GetDelegateType Method
    4.3.15 VisitChildren Method
    4.3.16 Accept Method
  4.4 ExpressionType Enum
    4.4.1 Type Summary
    4.4.2 Add
    4.4.3 AddChecked
    4.4.4 And
    4.4.5 AndAlso
    4.4.6 ArrayLength
    4.4.7 ArrayIndex
    4.4.8 Call
    4.4.9 Coalesce
    4.4.10 Conditional
    4.4.11 Constant
    4.4.12 Convert
    4.4.13 ConvertChecked
    4.4.14 Divide
    4.4.15 Equal
    4.4.16 ExclusiveOr
    4.4.17 GreaterThan
    4.4.18 GreaterThanOrEqual
    4.4.19 Invoke
    4.4.20 Lambda
    4.4.21 LeftShift
    4.4.22 LessThan
    4.4.23 LessThanOrEqual
    4.4.24 ListInit
    4.4.25 MemberAccess
    4.4.26 MemberInit
    4.4.27 Modulo
    4.4.28 Multiply
    4.4.29 MulitplyChecked
    4.4.30 Negate
    4.4.31 UnaryPlus
    4.4.32 NegateChecked
    4.4.33 New
    4.4.34 NewArrayInit
    4.4.35 NewArrayBounds
    4.4.36 Not
    4.4.37 NotEqual
    4.4.38 Or
    4.4.39 OrElse
    4.4.40 Parameter
    4.4.41 Power
    4.4.42 Quote
    4.4.43 RightShift
    4.4.44 Subtract
    4.4.45 SubtrtactChecked
    4.4.46 TypeAs
    4.4.47 TypeIs
    4.4.48 TypeEqual
    4.4.49 Assign
    4.4.50 Block
    4.4.51 DebugInfo
    4.4.52 Decrement
    4.4.53 Dynamic
    4.4.54 Default
    4.4.55 Extension
    4.4.56 Goto
    4.4.57 Increment
    4.4.58 Index
    4.4.59 Label
    4.4.60 RuntimeVariables
    4.4.61 Loop
    4.4.62 Switch
    4.4.63 Throw
    4.4.64 Try
    4.4.65 Unbox
    4.4.66 AddAssign
    4.4.67 AddAssignChecked
    4.4.68 DivideAssign
    4.4.69 ExclusiveOrAssign
    4.4.70 LeftShiftAssign
    4.4.71 ModuloAssign
    4.4.72 MultiplyAssign
    4.4.73 MulitplyAssignChecked
    4.4.74 OrAssign
    4.4.75 PowerAssign
    4.4.76 RightShiftAssign
    4.4.77 SubtractAssign
    4.4.78 SubtractAssignChecked
    4.4.79 PreIncrementAssign
    4.4.80 PreDecrementAssign
    4.4.81 PostIncrementAssign
    4.4.82 PostDecrementAssign
    4.4.83 OnesComplement
    4.4.84 IsTrue
    4.4.85 IsFalse
    4.4.86 AssignRef (POST CLR 4.0)
  4.5 DefaultExpression Class
    4.5.1 Class Summary
    4.5.2 Factory Methods
  4.6 BinaryExpression Class
    4.6.1 Class Summary
    4.6.2 Conversion Property
    4.6.3 IsLifted Property
    4.6.4 IsLiftedToNull Property
    4.6.5 Method Property
    4.6.6 Left Property
    4.6.7 Right Property
    4.6.8 Update Method
    4.6.9 Arithmetic, Shift, and Bit Operations Factory Methods
    4.6.10 Obsolete Array Index (Single-dimension) Factory
    4.6.11 Assignment Factory Method
    4.6.12 Coalesce Operator Factory Methods
    4.6.13 Conditional And and Or Operator Factory Methods
    4.6.14 Comparison Operators Factory Methods
    4.6.15 General Factory Methods
  4.7 TypeBinaryExpression Class
    4.7.1 Class Summary
    4.7.2 Expression Property
    4.7.3 TypeOperand Property
    4.7.4 Update Method
    4.7.5 Factory Methods
  4.8 UnaryExpression Class
    4.8.1 Class Summary
    4.8.2 IsLifted Property
    4.8.3 IsLiftedToNull Property
    4.8.4 Method Property
    4.8.5 Operand Property
    4.8.6 Update Method
    4.8.7 ArrayLength Factory Method
    4.8.8 Conversion Factory Methods
    4.8.9 Functional Increment and Decrement Factory Methods
    4.8.10 Side-effecting Pre- and Post- Increment and Decrement Factory Methods
    4.8.11 Numeric Negation and Plus Factory Methods
    4.8.12 Logical and Bit Negation Factory Methods
    4.8.13 IsTrue and IsFalse Factories
    4.8.14 Quote Factory Method
    4.8.15 Throw Flow Control Factory Mehtods
    4.8.16 Reference Conversion Factory Methods
    4.8.17 Unboxing (as Pointer to Box's Value) Factory Method
    4.8.18 General Factory Methods
    4.8.19 NewDelegate Expression (V-next+1)
  4.9 BlockExpression Class
    4.9.1 Class Summary
    4.9.2 Expressions Property
    4.9.3 Result Property
    4.9.4 Variables Property
    4.9.5 Update Method
    4.9.6 Factory Methods
  4.10 ConstantExpression Class
    4.10.1 Class Summary
    4.10.2 Value Property
    4.10.3 Factory Methods
  4.11 ConditionalExpression Class
    4.11.1 Class Summary
    4.11.2 IfFalse Property
    4.11.3 IfTrue Property
    4.11.4 Test Property
    4.11.5 Update Method
    4.11.6 Factory Methods
  4.12 DynamicExpression Class
    4.12.1 Class Summary
    4.12.2 Arguments Property
    4.12.3 Binder Property
    4.12.4 DelegateType
    4.12.5 Update Method
    4.12.6 Factories
  4.13 CallInfo Class
    4.13.1 Class Summary
    4.13.2 ArgumentCount Property
    4.13.3 ArgumentNames Property
    4.13.4 Factory Methods
  4.14 DebugInfoExpression Class
    4.14.1 Class Summary
    4.14.2 Document Property
    4.14.3 StartLine Property
    4.14.4 StartColumn Property
    4.14.5 EndLine Property
    4.14.6 EndColumn Property
    4.14.7 IsClear Property
    4.14.8 Factory Methods
  4.15 SymbolDocumentInfo Class
    4.15.1 Class Summary
    4.15.2 DocumentType Property
    4.15.3 FileName Property
    4.15.4 Language Property
    4.15.5 LanguageVendor Property
    4.15.6 Factory Methods
  4.16 TryExpression Class
    4.16.1 Class Summary
    4.16.2 Body Property
    4.16.3 Fault Property
    4.16.4 Finally Property
    4.16.5 Handlers Property
    4.16.6 Update Method
    4.16.7 Factory Methods
  4.17 CatchBlock Class
    4.17.1 Class Summary
    4.17.2 Body Property
    4.17.3 Filter Property
    4.17.4 Test Property
    4.17.5 Variable Property
    4.17.6 Update Method
    4.17.7 Factories
  4.18 MethodCallExpression Class
    4.18.1 Class Summary
    4.18.2 Arguments Property
    4.18.3 Method Property
    4.18.4 Object Property
    4.18.5 Update Method
    4.18.6 General Call Factories
    4.18.7 Obsolete Multi-dimensional Array Index Factory
  4.19 POST CLR 4.0 -- ComplexMethodCallExpression Class
    4.19.1 Class Summary
  4.20 InvocationExpression Class
    4.20.1 Class Summary
    4.20.2 Arguments Property
    4.20.3 Expression Property
    4.20.4 Update Method
    4.20.5 Factory Methods
  4.21 IndexExpression Class
    4.21.1 Class Summary
    4.21.2 Arguments Property
    4.21.3 Indexer Property
    4.21.4 Object Property
    4.21.5 Update Method
    4.21.6 Factory Methods
  4.22 LoopExpression Class
    4.22.1 Examples
      4.22.1.1 While Less Than Ten
      4.22.1.2 ForEach over IEnumerable
      4.22.1.3 Lexical Semantics with Blocks and Loops Involved
    4.22.2 Class Summary
    4.22.3 Update Method
    4.22.4 Factory Methods
  4.23 POST CLR 4.0 -- ForExpression Class
    4.23.1 Class Summary
  4.24 POST CLR 4.0 -- ForEachExpression Class
    4.24.1 Class Summary
  4.25 POST CLR 4.0 -- WhileExpression Class
    4.25.1 Class Summary
  4.26 POST CLR 4.0 -- RepeatUntilExpression Class
    4.26.1 Class Summary
  4.27 GotoExpression Class
    4.27.1 Class Summary
    4.27.2 Kind Property
    4.27.3 Target Property
    4.27.4 Value Property
    4.27.5 Update Method
    4.27.6 Factory Methods
  4.28 GotoExpressionKind Enum
    4.28.1 Type Summary
    4.28.2 Members
  4.29 LabelExpression Class
    4.29.1 Example
    4.29.2 Class Summary
    4.29.3 DefaultValue Property
    4.29.4 Target Property
    4.29.5 Update Method
    4.29.6 Factory Methods
  4.30 LabelTarget Class
    4.30.1 Class Summary
    4.30.2 Name Property
    4.30.3 Type Property
    4.30.4 Factory Methods
  4.31 MemberExpression Class
    4.31.1 Class Summary
    4.31.2 Expression Property
    4.31.3 Member Property
    4.31.4 Update Method
    4.31.5 Factory Methods
  4.32 MemberInitExpression Class
    4.32.1 Class Summary
    4.32.2 Bindings Property
    4.32.3 NewExpression Property
    4.32.4 Update Method
    4.32.5 Factory Methods
  4.33 MemberBinding Class
    4.33.1 Class Summary
    4.33.2 MemberBinding Constructor
    4.33.3 BindingType Property
    4.33.4 Member Property
  4.34 MemberBindingType Enum
    4.34.1 Type Summary
    4.34.2 Type Members
  4.35 MemberListBinding Class
    4.35.1 Class Summary
    4.35.2 Initializers Property
    4.35.3 Update Method
    4.35.4 Factory Methods
  4.36 MemberMemberBinding Class
    4.36.1 Class Summary
    4.36.2 Bindings Property
    4.36.3 Update Method
    4.36.4 Factory Methods
  4.37 MemberAssignment Class
    4.37.1 Class Summary
    4.37.2 Expression Property
    4.37.3 Update Method
    4.37.4 Factory Methods
  4.38 ListInitExpression Class
    4.38.1 Class Summary
    4.38.2 Initializers Property
    4.38.3 NewExpression Property
    4.38.4 Update Method
    4.38.5 Factory Methods
  4.39 ElementInit Class
    4.39.1 Class Summary
    4.39.2 AddMethod Property
    4.39.3 Arguments Property
    4.39.4 Update Method
    4.39.5 Factory Methods
  4.40 NewExpression Class
    4.40.1 Class Summary
    4.40.2 Arguments Property
    4.40.3 Constructor Property
    4.40.4 Members Property
    4.40.5 Update Method
    4.40.6 Factory Methods
  4.41 NewArrayExpression Class
    4.41.1 Class Summary
    4.41.2 Expressions Property
    4.41.3 Update Method
    4.41.4 Factory Methods
  4.42 LambdaExpression Class
    4.42.1 Examples
    4.42.2 Class Summary
    4.42.3 Body Property
    4.42.4 Name Property
    4.42.5 Parameters Property
    4.42.6 ReturnType Property
    4.42.7 TallCall Property
    4.42.8 Compile* Methods
    4.42.9 Update Method
    4.42.10 Factory Methods
  4.43 Expression<TDelegate> Class
    4.43.1 Class Summary
  4.44 DebugInfoGenerator Class
    4.44.1 Class Summary
    4.44.2 DebugInfoGenerator Method
    4.44.3 MarkSequencePoint Method
  4.45 ParameterExpression Class
    4.45.1 Class Summary
    4.45.2 IsByRef Property
    4.45.3 Name Property
    4.45.4 Factory Methods
  4.46 RuntimeVariablesExpression Class
    4.46.1 Class Summary
    4.46.2 Variables Property
    4.46.3 Update Method
    4.46.4 Factory Methods
  4.47 IRuntimeVariables Interface
    4.47.1 Class Summary
    4.47.2 Count Property
    4.47.3 This Property
  4.48 SwitchExpression Class
    4.48.1 Class Summary
    4.48.2 Cases Property
    4.48.3 Comparison Property
    4.48.4 DefaultBody Property
    4.48.5 SwitchValue Property
    4.48.6 Update Method
    4.48.7 Factory Methods
  4.49 SwitchCase Class
    4.49.1 Class Summary
    4.49.2 Body Property
    4.49.3 TestValues Property
    4.49.4 Update Method
    4.49.5 Factory Methods
  4.50 ExpressionVisitor Class
    4.50.1 Rebinding When Children Nodes' Type Properties Change
    4.50.2 Class Summary
    4.50.3 Visit<T> Method
    4.50.4 VisitLambda<T> Method
    4.50.5 VisitAndConvert<T> Method
    4.50.6 VisitConstant Method
    4.50.7 VisitDebugInfo Method
    4.50.8 VisitDynamic Method
    4.50.9 VisitDefault Method
    4.50.10 VisitExtension Method
    4.50.11 VisitLabelTarget Method
    4.50.12 VisitMember Method
    4.50.13 VisitNew Method
    4.50.14 VisitParameter Method
  4.51 POST CLR 4.0 -- GlobalVariableExpression Class
    4.51.1 Class Summary
  4.52 POST CLR 4.0 -- GeneratorExpression
    4.52.1 Class Summary
    4.52.2 Body Property
    4.52.3 Target Property
  4.53 POST CLR 4.0 -- YieldExpression Class
    4.53.1 Class Summary
    4.53.2 Target Property
    4.53.3 Value Property
    4.53.4 YieldMarker Property
  4.54 CUT Annotations Class
    4.54.1 Class Summary
    4.54.2 Empty Field
    4.54.3 Add<T> Method
    4.54.4 Contains<T> Method
    4.54.5 Get<T> Method
    4.54.6 TryGet<T> Method
    4.54.7 Remove<T> Method


Other documents:

Dynamic Language Runtime
DLR Hostirng Spec
Getting Started with the DLR as a Library Author
Sites, Binders, and Dynamic Object Interop Spec
SymPL Implementation on the Dynamic Language Runtime

Clone this wiki locally