protected internal virtual void VisitNewArray(NewArray node, object data) { throw new NodeNotSupportedException(node); }
protected internal override void VisitNewArray(NewArray node, object data) { StackTypes stack = data as StackTypes; Verifier.ProcessNewArr(stack, node.Type); AddTask(node.Next,stack); }
protected override void VisitNewArray(NewArray downNode, object o) { PointerToNode ptrUpNode = (o as Data).PointerToNode; StructValue idx = this.state.Stack.Pop() as StructValue; Array arr = Array.CreateInstance(downNode.Type, SpecializingVisitor.toInt(idx)); ObjectReferenceValue obj = new ObjectReferenceValue(arr); if (Annotation.GetArrayElementsBTType(downNode) == BTType.Dynamic) for (int i = 0; i < SpecializingVisitor.toInt(idx); i++) { Variable varUp = this.mbbUp.Variables.CreateVar(downNode.Type, VariableKind.Local); this.varsHash[new PointerToElementValue(arr, i)] = varUp; ptrUpNode = SpecializingVisitor.initVariable(varUp, ptrUpNode); } this.state.Stack.Push(obj); this.AddTask(downNode.Next, ptrUpNode); }
public static BTType GetArrayElementsBTType(NewArray upNode) { ReferenceBTValue arr = AnnotatingVisitor.GetNewBTValue(upNode); return arr.ArrayElements.BTType; }
protected override void VisitNewArray(NewArray upNode, object o) { State state = o as State; PrimitiveBTValue length = state.Stack.Pop() as PrimitiveBTValue; ReferenceBTValue arr = AnnotatingVisitor.GetNewBTValue(upNode); if (arr == null) { arr = new ReferenceBTValue(AnnotatingVisitor.makeArrayType(upNode.Type), BTType.Static); AnnotatingVisitor.setNewBTValue(upNode, arr); arr.Creators[this].AddCreator(upNode); } if (length.BTType == arr.BTType) { state.Stack.Push(arr); BTType btType; if (arr.BTType == BTType.Dynamic) btType = BTType.Dynamic; else btType = BTType.eXclusive; Annotation.SetNodeBTType(upNode, btType); } else if (length.BTType == BTType.Static) throw new LiftException(length); else if (arr.BTType == BTType.Static) throw new LiftException(arr); else throw new InternalException(); }
protected override void VisitNewArray(NewArray upNode, object o) { }
protected internal override void VisitNewArray(NewArray node, object data) { generator.Emit(OpCodes.Newarr, node.Type); AddTask(node.Next,null); }