Exemplo n.º 1
0
 internal DebugFrame(
     DebugThread thread,
     FunctionInfo funcInfo,
     IRuntimeVariables liftedLocals,
     int frameOrder)
     : this(thread, funcInfo) {
     _liftedLocals = liftedLocals;
     _stackDepth = frameOrder;
 }
Exemplo n.º 2
0
 internal DebugRuntimeVariables(IRuntimeVariables runtimeVariables) {
     _runtimeVariables = runtimeVariables;
 }
Exemplo n.º 3
0
 public static void VarargsAssign(IRuntimeVariables variables, object[] values)
 {
     var variablesArray = VarargsAssign(variables.Count, values);
     for (var i = 0; i < variables.Count; i++)
         variables[i] = variablesArray[i];
 }
Exemplo n.º 4
0
        /// <summary>
        /// // This method is called from the generator to update the frame with generator's locals
        /// </summary>
        internal void ReplaceLiftedLocals(IRuntimeVariables liftedLocals) {
            Debug.Assert(_liftedLocals == null || liftedLocals.Count >= _liftedLocals.Count);

            IRuntimeVariables oldLiftecLocals = _liftedLocals;

            // Replace the list of IStrongBoxes with the new list
            _liftedLocals = liftedLocals;

            if (oldLiftecLocals != null) {
                for (int i = 0; i < oldLiftecLocals.Count; i++) {
                    if (!_funcInfo.Variables[i].IsParameter && i < _liftedLocals.Count)
                        _liftedLocals[i] = oldLiftecLocals[i];
                }
            }

            // Null out scope/variable states to force creation of new ones
            _variables.Clear();
        }
Exemplo n.º 5
0
 public FrameRuntimeVariablesPair(IRuntimeVariables runtimeVariables, DebugFrame frame)
 {
     RuntimeVariables = runtimeVariables;
     Frame = frame;
 }
Exemplo n.º 6
0
 private static IRuntimeVariables MergeRuntimeVariables(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
 {
     return(new RuntimeOps.MergedRuntimeVariables(first, second, indexes));
 }
Exemplo n.º 7
0
 public FrameRuntimeVariablesPair(IRuntimeVariables runtimeVariables, DebugFrame frame)
 {
     RuntimeVariables = runtimeVariables;
     Frame            = frame;
 }
Exemplo n.º 8
0
        public static IRuntimeVariables MergeRuntimeVariables(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
        {
            Contract.Ensures(Contract.Result <System.Runtime.CompilerServices.IRuntimeVariables>() != null);

            return(default(IRuntimeVariables));
        }
Exemplo n.º 9
0
        public FunctionStack(string identifier)
        {
            Identifier = identifier;

            Context = null;
            UpScope = null;
            ExecScope = null;
            UpValues = null;
            UpValueNames = null;
            LocalVariables = null;
            LocalVariableNames = null;
            Locals = null;
        }
    public static IRuntimeVariables MergeRuntimeVariables(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
    {
      Contract.Ensures(Contract.Result<System.Runtime.CompilerServices.IRuntimeVariables>() != null);

      return default(IRuntimeVariables);
    }
Exemplo n.º 11
0
 /// <summary>
 /// Creates a new expression quoter.
 /// </summary>
 /// <param name="locals">The hoisted locals information gathered by the compiler at compile time.</param>
 /// <param name="closure">The closure to access for the binding of hoisted variables.</param>
 public ExpressionQuoter(HoistedLocals locals, IRuntimeVariables closure)
 {
     _locals  = locals;
     _closure = closure;
 }
Exemplo n.º 12
0
 internal static IRuntimeVariables Create(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
 {
     return(new LightLambdaClosureVisitor.MergedRuntimeVariables(first, second, indexes));
 }
Exemplo n.º 13
0
 private MergedRuntimeVariables(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
 {
     this._first   = first;
     this._second  = second;
     this._indexes = indexes;
 }
Exemplo n.º 14
0
 internal ScopedRuntimeVariables(IList<VariableInfo> variableInfos, IRuntimeVariables variables)
 {
     _variableInfos = variableInfos;
     _variables = variables;
 }
 /// <summary>
 /// Creates an <see cref="IRuntimeVariables"/> object providing access to closed over variables.
 /// </summary>
 /// <param name="closure">The closure containing the variables.</param>
 /// <param name="indexes">The indices into the closure where variables are found.</param>
 public RuntimeVariableList(IRuntimeVariables closure, long[] indexes)
 {
     _closure = closure;
     _indexes = indexes;
 }
 /// <summary>
 ///     Combines two runtime variable lists and returns a new list.
 /// </summary>
 /// <param name="first">The first list.</param>
 /// <param name="second">The second list.</param>
 /// <param name="indexes">The index array indicating which list to get variables from.</param>
 /// <returns>The merged runtime variables.</returns>
 // [Obsolete("do not use this method", true), EditorBrowsable(EditorBrowsableState.Never)]
 public static IRuntimeVariables MergeRuntimeVariables(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
 {
     return(new MergedRuntimeVariables(first, second, indexes));
 }
Exemplo n.º 17
0
        public FunctionStack(CodeContext context, LuaScope upScope, LuaScope execScope, string identifier)
        {
            ContractUtils.Requires(context != null);

            Context = context;
            UpScope = upScope;
            ExecScope = execScope;

            if (UpScope != null)
                UpValueNames = UpScope.GetLocalNames().ToArray();

            if (ExecScope != null)
                LocalVariableNames = ExecScope.GetLocalNames().ToArray();

            if (ExecScope != null && ExecScope.LocalsCount > 0)
                Locals = new Stack<VariableAccess>();
            else
                Locals = null;

            Identifier = identifier;

            LocalVariableNames = null;
            LocalVariables = null;
            UpValueNames = null;
            UpValues = null;
        }
 internal MergedRuntimeVariables(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
 {
     _first = first;
     _second = second;
     _indexes = indexes;
 }
Exemplo n.º 19
0
 private static string GetInfo(IRuntimeVariables vars)
 {
     return("{ Count = " + vars.Count + ", Values = { " + string.Join(", ", Enumerable.Range(0, vars.Count).Select(i => vars[i])) + " } }");
 }
Exemplo n.º 20
0
 internal void LiftVariables(IRuntimeVariables runtimeVariables)
 {
     // Don't create the frame object right away.  Create it when it's actually needed for debugging.
     _frames.Add(new FrameRuntimeVariablesPair(new DebugRuntimeVariables(runtimeVariables), null));
 }
 internal ScopedRuntimeVariables(IList <VariableInfo> variableInfos, IRuntimeVariables variables)
 {
     _variableInfos = variableInfos;
     _variables     = variables;
 }
 internal MergedRuntimeVariables(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
 {
     _first   = first;
     _second  = second;
     _indexes = indexes;
 }
Exemplo n.º 23
0
 public static void LiftVariables(DebugThread thread, IRuntimeVariables runtimeVariables)
 {
     ((DefaultDebugThread)thread).LiftVariables(runtimeVariables);
 }
Exemplo n.º 24
0
 internal void LiftVariables(IRuntimeVariables runtimeVariables)
 {
     // Don't create the frame object right away.  Create it when it's actually needed for debugging.
     _frames.Add(new FrameRuntimeVariablesPair(new DebugRuntimeVariables(runtimeVariables), null));
 }
Exemplo n.º 25
0
 public static void ReplaceLiftedLocals(DebugFrame frame, IRuntimeVariables liftedLocals)
 {
     frame.ReplaceLiftedLocals(liftedLocals);
 }
 internal static IRuntimeVariables Create(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
 {
     return(new MergedRuntimeVariables(first, second, indexes));
 }
 internal DebugRuntimeVariables(IRuntimeVariables runtimeVariables)
 {
     _runtimeVariables = runtimeVariables;
 }
 private static string GetInfo(IRuntimeVariables vars)
 {
     return "{ Count = " + vars.Count + ", Values = { " + string.Join(", ", Enumerable.Range(0, vars.Count).Select(i => vars[i])) + " } }";
 }
Exemplo n.º 29
0
 public LocalsDictionary(IRuntimeVariables locals, SymbolId[] symbols)
 {
     Assert.NotNull(locals, symbols);
     _locals  = locals;
     _symbols = symbols;
 }
Exemplo n.º 30
0
 public LocalsDictionary(IRuntimeVariables locals, SymbolId[] symbols) {
     Assert.NotNull(locals, symbols);
     _locals = locals;
     _symbols = symbols;
 }
Exemplo n.º 31
0
 public static IRuntimeVariables MergeRuntimeVariables(IRuntimeVariables first, IRuntimeVariables second, int[] indexes)
 {
     throw new NotImplementedException();
 }