示例#1
0
 public GuardNodeProfile GetGuardNodeProfile(int index)
 {
     if (index >= GuardProfileData.Count)
     {
         _resizeProfileData <GuardNodeProfile>(GuardProfileData, index + 1, null);
         GuardProfileData[index] = new GuardNodeProfile(mdr.ValueTypes.Unknown);
     }
     if (GuardProfileData[index] == null)
     {
         GuardProfileData[index] = new GuardNodeProfile(mdr.ValueTypes.Unknown);
     }
     Debug.Assert(index > -1 && index < GuardProfileData.Count, "Assignment happens in codegen time");
     return(GuardProfileData[index]);
 }
示例#2
0
 public int GetGuardNodeIndex(GuardedCast node)
 {
     //Debug.Assert(node.ProfileIndex <= GuardProfileData.Count, "Assignment happens in codegen time");
     if (node.ProfileIndex == -1)
     {
         node.ProfileIndex = GuardProfilerCounter;
         int index = node.ProfileIndex;
         if (index >= GuardProfileData.Count)
         {
             _resizeProfileData <GuardNodeProfile>(GuardProfileData, index + 1, null);
             GuardProfileData[index] = new GuardNodeProfile(mdr.ValueTypes.Unknown);
         }
         GuardProfilerCounter++;
         if (GuardProfilerCounter > jsMD.GuardProfileSize)
         {
             jsMD.GuardProfileSize = GuardProfilerCounter;
         }
     }
     return(node.ProfileIndex);
 }
示例#3
0
 public void UpdateTypeProfile(GuardedCast node, mdr.ValueTypes type)
 {
     if (node.ProfileIndex < GuardProfileData.Count && node.ProfileIndex != -1)
     {
         var prof = GuardProfileData[node.ProfileIndex];
         prof.UpdateNodeProfile(type);
     }
     else
     {
         GuardNodeProfile prof = new GuardNodeProfile(type);
         if (node.ProfileIndex == -1)
         {
             node.ProfileIndex = GuardProfileData.Count;
             GuardProfileData.Add(prof);
             jsMD.GuardProfileSize++;
         }
         else
         {
             _resizeProfileData <GuardNodeProfile>(GuardProfileData, node.ProfileIndex + 1, null);
             GuardProfileData[node.ProfileIndex] = prof;
         }
     }
 }