コード例 #1
0
ファイル: Interpreter.cs プロジェクト: reshadi2/mcjs
    internal void PopLocation(ReadIndexerExpression node, mdr.DObject obj, mdr.PropertyDescriptor pd)
    {
      if (_currProfiler != null)
      {

        if (mdr.Runtime.Instance.Configuration.ProfileStats)
        {
          mdr.Runtime.Instance.Counters.GetCounter("Prop lookup").Count++;
          if (pd.IsDataDescriptor && !pd.IsInherited)
          {
            mdr.Runtime.Instance.Counters.GetCounter("Prop lookup owndata").Count++;
          }
          if (pd.IsDataDescriptor && pd.IsInherited)
          {
            mdr.Runtime.Instance.Counters.GetCounter("Prop lookup inherited").Count++;
          }
          MapNodeProfile mapProfile = _currProfiler.GetOrAddNodeProfile(node);
          if (mapProfile != null)
          {
            if (mapProfile.Map == obj.Map) 
            {
              mdr.Runtime.Instance.Counters.GetCounter("Prop lookup map hit").Count++;
              if (mapProfile.PD == pd)
              {
                mdr.Runtime.Instance.Counters.GetCounter("Prop lookup map/pd hit").Count++;
                if (pd.HasAttributes(mdr.PropertyDescriptor.Attributes.Data) && !pd.HasAttributes(mdr.PropertyDescriptor.Attributes.Inherited))
                {
                  mdr.Runtime.Instance.Counters.GetCounter("Prop lookup map/pd owndata hit").Count++;
                }
                if (pd.HasAttributes(mdr.PropertyDescriptor.Attributes.Inherited))
                {
                  mdr.Runtime.Instance.Counters.GetCounter("Prop lookup map/pd inherited hit").Count++;
                }
              }
            }
          }
        }
        _currProfiler.GetOrAddNodeProfile(node).UpdateNodeProfile(obj.Map, pd);
        //NodeProfile nProfile = _currProfiler.GetNodeProfile(node);
        //if (nProfile != null)
        //{
        //  (nProfile as MapNodeProfile).UpdateNodeProfile(obj.Map, pd);
        //}
        //else
        //{
        //  _currProfiler.CreateNewProfile(node, obj.Map, pd);
        //}
      }
    }