internal static Instruction InitImmutableRefBox(int index)
        {
            if (s_initImmutableRefBox == null)
            {
                s_initImmutableRefBox = new Instruction[LocalInstrCacheSize];
            }

            if (index < s_initImmutableRefBox.Length)
            {
                return(s_initImmutableRefBox[index] ?? (s_initImmutableRefBox[index] = new InitializeLocalInstruction.ImmutableBox(index, null)));
            }

            return(new InitializeLocalInstruction.ImmutableBox(index, null));
        }
Example #2
0
 internal static Instruction InitImmutableRefBox(int index)
 {
     if (InstructionList._initImmutableRefBox == null)
     {
         InstructionList._initImmutableRefBox = new Instruction[64];
     }
     if (index >= (int)InstructionList._initImmutableRefBox.Length)
     {
         return(new InitializeLocalInstruction.ImmutableBox(index, null));
     }
     else
     {
         Instruction instruction  = InstructionList._initImmutableRefBox[index];
         Instruction instruction1 = instruction;
         if (instruction == null)
         {
             InitializeLocalInstruction.ImmutableBox immutableBox = new InitializeLocalInstruction.ImmutableBox(index, null);
             Instruction instruction2 = immutableBox;
             InstructionList._initImmutableRefBox[index] = immutableBox;
             instruction1 = instruction2;
         }
         return(instruction1);
     }
 }