internal static GotoInstruction Create(int labelIndex, bool hasResult, bool hasValue)
 {
     if (labelIndex < CacheSize)
     {
         var index = Variants * labelIndex | (hasResult ? 2 : 0) | (hasValue ? 1 : 0);
         return s_cache[index] ?? (s_cache[index] = new GotoInstruction(labelIndex, hasResult, hasValue));
     }
     return new GotoInstruction(labelIndex, hasResult, hasValue);
 }
Example #2
0
 public void EmitGoto(BranchLabel label, bool hasResult, bool hasValue)
 {
     Emit(GotoInstruction.Create(EnsureLabelIndex(label), hasResult, hasValue));
 }
Example #3
0
 internal static GotoInstruction Create(int labelIndex, bool hasResult, bool hasValue)
 {
     int num;
     int num1;
     if (labelIndex >= 32)
     {
         return new GotoInstruction(labelIndex, hasResult, hasValue);
     }
     else
     {
         int num2 = 4 * labelIndex;
         if (hasResult)
         {
             num = 2;
         }
         else
         {
             num = 0;
         }
         int num3 = num2 | num;
         if (hasValue)
         {
             num1 = 1;
         }
         else
         {
             num1 = 0;
         }
         int num4 = num3 | num1;
         GotoInstruction cache = GotoInstruction.Cache[num4];
         GotoInstruction gotoInstruction = cache;
         if (cache == null)
         {
             GotoInstruction gotoInstruction1 = new GotoInstruction(labelIndex, hasResult, hasValue);
             GotoInstruction gotoInstruction2 = gotoInstruction1;
             GotoInstruction.Cache[num4] = gotoInstruction1;
             gotoInstruction = gotoInstruction2;
         }
         return gotoInstruction;
     }
 }