Ejemplo n.º 1
0
 private static bool HandleArrayOperations(Instruction instruction,
                                           MetaMidRepresentationOperationFactory operationFactory, string opcodeStr)
 {
     if (opcodeStr == "newarr")
     {
         operationFactory.NewArray((Type)instruction.Operand);
         return(true);
     }
     if (opcodeStr == "stelem.i1" ||
         opcodeStr == "stelem.i2" ||
         opcodeStr == "stelem.i4" ||
         opcodeStr == "stelem.i8" ||
         opcodeStr == "stelem.r4" ||
         opcodeStr == "stelem.r8" ||
         opcodeStr == "stelem.i2")
     {
         operationFactory.SetArrayElementValue();
         return(true);
     }
     if (opcodeStr == "stelem.ref")
     {
         operationFactory.SetArrayElementValue();
         return(true);
     }
     if (opcodeStr == "stelem")
     {
         var elemInfo = (Type)instruction.Operand;
         operationFactory.StoreElement(elemInfo);
         return(true);
     }
     return(false);
 }