Пример #1
0
 protected internal virtual void VisitNewArray(NewArray node, object data)
 {
     throw new NodeNotSupportedException(node);
 }
Пример #2
0
 protected internal override void VisitNewArray(NewArray node, object data)
 {
     StackTypes stack = data as StackTypes;
     Verifier.ProcessNewArr(stack, node.Type);
     AddTask(node.Next,stack);
 }
Пример #3
0
        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);
        }
Пример #4
0
 public static BTType GetArrayElementsBTType(NewArray upNode)
 {
     ReferenceBTValue arr = AnnotatingVisitor.GetNewBTValue(upNode);
     return arr.ArrayElements.BTType;
 }
Пример #5
0
        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();
        }
Пример #6
0
 protected override void VisitNewArray(NewArray upNode, object o)
 {
 }
Пример #7
0
 protected internal override void VisitNewArray(NewArray node, object data)
 {
     generator.Emit(OpCodes.Newarr, node.Type);
     AddTask(node.Next,null);
 }