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); }
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()); }
public LValue(StackQueue <ValueBase> stack) { _space = stack.Section(1); _relative = 0; _absolute = _space.Base + _relative; }