Exemple #1
0
 public MapNodeProfile GetMapNodeProfile(int index)
 {
     if (index >= MapProfileData.Count)
     {
         _resizeProfileData <MapNodeProfile>(MapProfileData, index + 1, null);
         MapProfileData[index] = new MapNodeProfile(null, null);
     }
     if (MapProfileData[index] == null)
     {
         MapProfileData[index] = new MapNodeProfile(null, null);
     }
     Debug.Assert(index > -1 && index < MapProfileData.Count, "Assignment happens in codegen time");
     return(MapProfileData[index]);
 }
Exemple #2
0
        public void CreateNewProfile(ReadIndexerExpression node, mdr.PropertyMap map, mdr.PropertyDescriptor pd)
        {
            MapNodeProfile prof = new MapNodeProfile(map, pd);

            if (node.ProfileIndex == -1)
            {
                node.ProfileIndex = MapProfileData.Count;
                MapProfileData.Add(prof);
                jsMD.MapProfileSize++;
            }
            else
            {
                _resizeProfileData <MapNodeProfile>(MapProfileData, node.ProfileIndex + 1, null);
                MapProfileData[node.ProfileIndex] = prof;
            }
            HasMaps = true;
        }
Exemple #3
0
 public int GetMapNodeIndex(ReadIndexerExpression node)
 {
     //Debug.Assert(node.ProfileIndex <= MapProfileData.Count, "Assignment happens in codegen time");
     if (node.ProfileIndex == -1)
     {
         node.ProfileIndex = MapProfilerCounter;
         int index = node.ProfileIndex;
         if (index >= MapProfileData.Count)
         {
             _resizeProfileData <MapNodeProfile>(MapProfileData, index + 1, null);
             MapProfileData[index] = new MapNodeProfile(null, null);
         }
         MapProfilerCounter++;
         if (MapProfilerCounter > jsMD.MapProfileSize)
         {
             jsMD.MapProfileSize = MapProfilerCounter;
         }
     }
     return(node.ProfileIndex);
 }