Ejemplo n.º 1
0
 protected internal override void VisitStoreElement(StoreElement node, object data)
 {
     StackTypes stack = data as StackTypes;
     Verifier.ProcessStElem(stack, new TypeEx(node.Type));
     AddTask(node.Next,stack);
 }
Ejemplo n.º 2
0
 protected internal virtual void VisitStoreElement(StoreElement node, object data)
 {
     throw new NodeNotSupportedException(node);
 }
Ejemplo n.º 3
0
 protected override void VisitStoreElement(StoreElement downNode, object o)
 {
     StructValue idx = this.state.Stack.Pop() as StructValue;
     ObjectReferenceValue arr = this.state.Stack.Pop() as ObjectReferenceValue;
     PointerValue ptr = new PointerToElementValue(arr.Obj as Array, SpecializingVisitor.toInt(idx));
     this.storeVar(downNode, ptr, o);
 }
Ejemplo n.º 4
0
        protected override void VisitStoreElement(StoreElement upNode, object o)
        {
            State state = o as State;
            BTValue val = state.Stack.Pop() as BTValue;
            PrimitiveBTValue idx = state.Stack.Pop() as PrimitiveBTValue;
            ReferenceBTValue arr = state.Stack.Pop() as ReferenceBTValue;

            if (idx.BTType == arr.BTType)
            {
                ReferenceBTValue elm = arr.ArrayElements;

                Creators crtrs = BTValue.Merge(val.FromStack(), elm);
                if (crtrs.IsEmpty)
                {
                    BTType btType;
                    if (arr.BTType == BTType.Dynamic)
                        btType = BTType.Dynamic;
                    else if (elm.BTType == BTType.Dynamic)
                        btType = BTType.eXclusive;
                    else
                        btType = BTType.Static;
                    Annotation.SetNodeBTType(upNode, btType);

                    elm.Creators[this].AddCreator(upNode);
                }
                else
                    throw new LiftException(crtrs);
            }
            else if (idx.BTType == BTType.Static)
                throw new LiftException(idx);
            else if (arr.BTType == BTType.Static)
                throw new LiftException(arr);
            else
                throw new InternalException();
        }
Ejemplo n.º 5
0
 protected override void VisitStoreElement(StoreElement upNode, object o)
 {
     DepthContainer cnt = o as DepthContainer;
     cnt.Depth += 3;
 }
Ejemplo n.º 6
0
 protected internal override void VisitStoreElement(StoreElement node, object data)
 {
     if(node.Type.Equals( typeof(IntPtr) ))
         generator.Emit(OpCodes.Stelem_I);
     else if(node.Type.Equals( typeof(sbyte) ))
         generator.Emit(OpCodes.Stelem_I1);
     else if(node.Type.Equals( typeof(short) ))
         generator.Emit(OpCodes.Stelem_I2);
     else if(node.Type.Equals( typeof(int) ))
         generator.Emit(OpCodes.Stelem_I4);
     else if(node.Type.Equals( typeof(long) ))
         generator.Emit(OpCodes.Stelem_I8);
     else if(node.Type.Equals( typeof(UIntPtr) ))
         generator.Emit(OpCodes.Stelem_I);
     else if(node.Type.Equals( typeof(byte) ))
         generator.Emit(OpCodes.Stelem_I1);
     else if(node.Type.Equals( typeof(ushort) ))
         generator.Emit(OpCodes.Stelem_I2);
     else if(node.Type.Equals( typeof(uint) ))
         generator.Emit(OpCodes.Stelem_I4);
     else if(node.Type.Equals( typeof(ulong) ))
         generator.Emit(OpCodes.Stelem_I8);
     else if(node.Type.Equals( typeof(float) ))
         generator.Emit(OpCodes.Stelem_R4);
     else if(node.Type.Equals( typeof(double) ))
         generator.Emit(OpCodes.Stelem_R8);
     else if(node.Type.Equals( typeof(object) ))
         generator.Emit(OpCodes.Stelem_Ref);
     else
         throw new EmissionException();
     AddTask(node.Next,null);
 }