예제 #1
0
 protected internal override void VisitLoadElement(LoadElement node, object data)
 {
     StackTypes stack = data as StackTypes;
     Verifier.ProcessLdElem(stack, new TypeEx(node.Type), false);
     AddTask(node.Next,stack);
 }
예제 #2
0
파일: Visitor.cs 프로젝트: DragonXYZ/cilpe
 protected internal virtual void VisitLoadElement(LoadElement node, object data)
 {
     throw new NodeNotSupportedException(node);
 }
예제 #3
0
파일: Spec.cs 프로젝트: DragonXYZ/cilpe
 protected override void VisitLoadElement(LoadElement 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.loadVar(downNode, ptr, o);
 }
예제 #4
0
파일: BTA.cs 프로젝트: DragonXYZ/cilpe
        protected override void VisitLoadElement(LoadElement upNode, object o)
        {
            State state = o as State;
            PrimitiveBTValue idx = state.Stack.Pop() as PrimitiveBTValue;
            ReferenceBTValue arr = state.Stack.Pop() as ReferenceBTValue;

            if (idx.BTType == arr.BTType)
            {
                ReferenceBTValue elm = arr.ArrayElements;
                state.Stack.Push(elm.ToStack(upNode.Type));

                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 if (idx.BTType == BTType.Static)
                throw new LiftException(idx);
            else if (arr.BTType == BTType.Static)
                throw new LiftException(arr);
            else
                throw new InternalException();
        }
예제 #5
0
파일: BTA.cs 프로젝트: DragonXYZ/cilpe
 protected override void VisitLoadElement(LoadElement upNode, object o)
 {
     DepthContainer cnt = o as DepthContainer;
     cnt.Depth += 1;
 }
예제 #6
0
파일: Emitter.cs 프로젝트: DragonXYZ/cilpe
 protected internal override void VisitLoadElement(LoadElement node, object data)
 {
     if(node.Type.Equals( typeof(IntPtr) ))
         generator.Emit(OpCodes.Ldelem_I);
     else if(node.Type.Equals( typeof(sbyte) ))
         generator.Emit(OpCodes.Ldelem_I1);
     else if(node.Type.Equals( typeof(short) ))
         generator.Emit(OpCodes.Ldelem_I2);
     else if(node.Type.Equals( typeof(int) ))
         generator.Emit(OpCodes.Ldelem_I4);
     else if(node.Type.Equals( typeof(long) ))
         generator.Emit(OpCodes.Ldelem_I8);
     else if(node.Type.Equals( typeof(UIntPtr) ))
         generator.Emit(OpCodes.Ldelem_I);
     else if(node.Type.Equals( typeof(byte) ))
         generator.Emit(OpCodes.Ldelem_I1);
     else if(node.Type.Equals( typeof(ushort) ))
         generator.Emit(OpCodes.Ldelem_I2);
     else if(node.Type.Equals( typeof(uint) ))
         generator.Emit(OpCodes.Ldelem_I4);
     else if(node.Type.Equals( typeof(ulong) ))
         generator.Emit(OpCodes.Ldelem_I8);
     else if(node.Type.Equals( typeof(float) ))
         generator.Emit(OpCodes.Ldelem_R4);
     else if(node.Type.Equals( typeof(double) ))
         generator.Emit(OpCodes.Ldelem_R8);
     else if(node.Type.Equals( typeof(object) ))
         generator.Emit(OpCodes.Ldelem_Ref);
     else
         throw new EmissionException();
     AddTask(node.Next,null);
 }