Example #1
0
 protected internal override void VisitLoadIndirect(LoadIndirect node, object data)
 {
     StackTypes stack = data as StackTypes;
     Verifier.ProcessLdInd(node.Type, stack);
     //looks like ProcessLdInd method functions correctly in case of LDOBJ
     AddTask(node.Next,stack);
 }
Example #2
0
 protected override void VisitLoadIndirect(LoadIndirect downNode, object o)
 {
     PointerValue ptr = this.state.Stack.Pop() as PointerValue;
     this.loadVar(downNode, ptr, o);
 }
Example #3
0
 protected internal virtual void VisitLoadIndirect(LoadIndirect node, object data)
 {
     throw new NodeNotSupportedException(node);
 }
Example #4
0
 protected internal override void VisitLoadIndirect(LoadIndirect node, object data)
 {
     if(node.Type.Equals( typeof(IntPtr) ))
         generator.Emit(OpCodes.Ldind_I);
     else if(node.Type.Equals( typeof(sbyte) ))
         generator.Emit(OpCodes.Ldind_I1);
     else if(node.Type.Equals( typeof(short) ))
         generator.Emit(OpCodes.Ldind_I2);
     else if(node.Type.Equals( typeof(int) ))
         generator.Emit(OpCodes.Ldind_I4);
     else if(node.Type.Equals( typeof(long) ))
         generator.Emit(OpCodes.Ldind_I8);
     else if(node.Type.Equals( typeof(UIntPtr) ))
         generator.Emit(OpCodes.Ldind_I); //missing Ldind_U ... ?...
     else if(node.Type.Equals( typeof(byte) ))
         generator.Emit(OpCodes.Ldind_U1);
     else if(node.Type.Equals( typeof(ushort) ))
         generator.Emit(OpCodes.Ldind_U2);
     else if(node.Type.Equals( typeof(uint) ))
         generator.Emit(OpCodes.Ldind_U4);
     else if(node.Type.Equals( typeof(ulong) ))
         generator.Emit(OpCodes.Ldind_I8); //missing Ldind_U8 ... ?...
     else if(node.Type.Equals( typeof(float) ))
         generator.Emit(OpCodes.Ldind_R4);
     else if(node.Type.Equals( typeof(double) ))
         generator.Emit(OpCodes.Ldind_R8);
     else if(node.Type.IsValueType)
     {
         if(node.Next is StoreIndirect && node.Next.PrevArray.Count == 1)
         {
             generator.Emit(OpCodes.Cpobj, node.Type);
             AddTask(node.Next.Next,null);
             return;
         }
         generator.Emit(OpCodes.Ldobj, node.Type);
     }
     else
         generator.Emit(OpCodes.Ldind_Ref);
     AddTask(node.Next,null);
 }