Example #1
0
 internal void AddLabelInfo(LabelTarget target, LabelInfo info)
 {
     if (this.Labels == null)
     {
         this.Labels = new HybridReferenceDictionary<LabelTarget, LabelInfo>();
     }
     this.Labels[target] = info;
 }
Example #2
0
 public LightCompiler(int compilationThreshold)
 {
     this._locals = new LocalVariables();
     this._debugInfos = new List<DebugInfo>();
     this._treeLabels = new HybridReferenceDictionary<LabelTarget, LabelInfo>();
     this._labelBlock = new LabelScopeInfo(null, LabelScopeKind.Lambda);
     this._exceptionForRethrowStack = new Stack<ParameterExpression>();
     this._instructions = new InstructionList();
     this._compilationThreshold = (compilationThreshold < 0) ? 0x20 : compilationThreshold;
 }
Example #3
0
        internal void AddLabelInfo(LabelTarget target, LabelInfo info)
        {
            Debug.Assert(CanJumpInto);

            if (Labels == null)
            {
                Labels = new HybridReferenceDictionary <LabelTarget, LabelInfo>();
            }

            Labels[target] = info;
        }
Example #4
0
 internal Interpreter(string name, LocalVariables locals, HybridReferenceDictionary<LabelTarget, BranchLabel> labelMapping, InstructionArray instructions, DebugInfo[] debugInfos, int compilationThreshold)
 {
     this._name = name;
     this._localCount = locals.LocalCount;
     this._closureVariables = locals.ClosureVariables;
     this._instructions = instructions;
     this._objects = instructions.Objects;
     this._labels = instructions.Labels;
     this._labelMapping = labelMapping;
     this._debugInfos = debugInfos;
     this._compilationThreshold = compilationThreshold;
 }
        internal Interpreter(string name, LocalVariables locals, HybridReferenceDictionary<LabelTarget, BranchLabel> labelMapping,
            InstructionArray instructions, DebugInfo[] debugInfos)
        {
            Name = name;
            LocalCount = locals.LocalCount;
            LabelMapping = labelMapping;
            ClosureVariables = locals.ClosureVariables;

            _instructions = instructions;
            _objects = instructions.Objects;
            _labels = instructions.Labels;
            _debugInfos = debugInfos;
        }
Example #6
0
 internal LoopCompiler(LoopExpression loop, HybridReferenceDictionary <LabelTarget, BranchLabel> labelMapping, Dictionary <ParameterExpression, LocalVariable> locals,
                       Dictionary <ParameterExpression, LocalVariable> closureVariables, int loopStartInstructionIndex, int loopEndInstructionIndex)
 {
     _loop                      = loop;
     _outerVariables            = locals;
     _closureVariables          = closureVariables;
     _frameDataVar              = Expression.Parameter(typeof(object[]));
     _frameClosureVar           = Expression.Parameter(typeof(StrongBox <object>[]));
     _frameVar                  = Expression.Parameter(typeof(InterpretedFrame));
     _loopVariables             = new Dictionary <ParameterExpression, LoopVariable>();
     _returnLabel               = Expression.Label(typeof(int));
     _labelMapping              = labelMapping;
     _loopStartInstructionIndex = loopStartInstructionIndex;
     _loopEndInstructionIndex   = loopEndInstructionIndex;
 }
Example #7
0
        internal Interpreter(string name, LocalVariables locals, HybridReferenceDictionary <LabelTarget, BranchLabel> labelMapping,
                             InstructionArray instructions, DebugInfo[] debugInfos, int compilationThreshold)
        {
            _name            = name;
            LocalCount       = locals.LocalCount;
            ClosureVariables = locals.ClosureVariables;

            Instructions = instructions;
            _objects     = instructions.Objects;
            _labels      = instructions.Labels;
            LabelMapping = labelMapping;

            _debugInfos           = debugInfos;
            _compilationThreshold = compilationThreshold;
        }
Example #8
0
 private HybridReferenceDictionary<LabelTarget, BranchLabel> GetBranchMapping()
 {
     HybridReferenceDictionary<LabelTarget, BranchLabel> dictionary = new HybridReferenceDictionary<LabelTarget, BranchLabel>(this._treeLabels.Count);
     foreach (KeyValuePair<LabelTarget, LabelInfo> pair in this._treeLabels)
     {
         dictionary[pair.Key] = pair.Value.GetLabel(this);
     }
     return dictionary;
 }