Exemplo n.º 1
0
 public State(State other)
 {
     _stack = new StackQueue <SSA.Value>();
     for (int i = 0; i < other._stack.Count; ++i)
     {
         _stack.Push(other._stack.PeekBottom(i));
     }
     _arguments = _stack.Section(other._arguments.Base, other._arguments.Len);
     _locals    = _stack.Section(other._locals.Base, other._locals.Len);
     _bindings  = new List <Nesting>();
     _bindings.AddRange(other._bindings);
 }
Exemplo n.º 2
0
        public State(Mono.Cecil.MethodDefinition md, int level)
        {
            int args = 0;

            if (md.HasThis)
            {
                args++;
            }
            args += md.Parameters.Count;
            int locals = md.Body.Variables.Count;

            // Create a stack with variables, which will be
            // bound to phi functions.
            _stack = new StackQueue <SSA.Value>();
            // Allocate parameters, even though we don't what they may be.
            _arguments = _stack.Section(_stack.Count, args);
            for (int i = 0; i < args; ++i)
            {
                _stack.Push(new SSA.Variable());
            }

            // Allocate local variables.
            _locals = _stack.Section(_stack.Count, locals);
            for (int i = 0; i < locals; ++i)
            {
                _stack.Push(new SSA.Variable());
            }

            for (int i = _stack.Size(); i < level; ++i)
            {
                _stack.Push(new SSA.Variable());
            }

            _bindings = new List <Nesting>();
            _bindings.Add(new Nesting());
        }
Exemplo n.º 3
0
 public LValue(StackQueue <ValueBase> stack)
 {
     _space    = stack.Section(1);
     _relative = 0;
     _absolute = _space.Base + _relative;
 }