当前位置: 首页>>代码示例>>C#>>正文


C# Profiler.GetNodeProfile方法代码示例

本文整理汇总了C#中Profiler.GetNodeProfile方法的典型用法代码示例。如果您正苦于以下问题:C# Profiler.GetNodeProfile方法的具体用法?C# Profiler.GetNodeProfile怎么用?C# Profiler.GetNodeProfile使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profiler的用法示例。


在下文中一共展示了Profiler.GetNodeProfile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: GetType

 internal static mdr.ValueTypes GetType(GuardedCast node, Profiler profiler)
 {
   var expType = node.Expression.ValueType;
   if (expType != mdr.ValueTypes.DValueRef && JSRuntime.Instance.Configuration.EnableGuardElimination)
       node.IsRequired = false;
   if (expType == mdr.ValueTypes.DValueRef && JSRuntime.Instance.Configuration.EnableSpeculativeJIT && profiler != null)
   {
     var nodeProfile = profiler.GetNodeProfile(node) as GuardNodeProfile;
     var speculativeType = nodeProfile != null ? nodeProfile.GetHotPrimitiveType() : mdr.ValueTypes.DValueRef;
     if (speculativeType != mdr.ValueTypes.DValueRef)
     {
       expType = speculativeType;
     }
     if (JSRuntime.Instance.Configuration.EnableGuardElimination) node.IsRequired = true;
   }
   return expType;
 }
开发者ID:reshadi2,项目名称:mcjs,代码行数:17,代码来源:TypeCalculator.cs

示例2: InlineScope

      void InlineScope(Scope scope, Profiler scopeProfile)
      {
        foreach (Invocation ScopeInvocation in scope.Invocations)
        {
          CallExpression invocation = ScopeInvocation as CallExpression;
          if (invocation == null)
            continue; //For now we only support calls

          mdr.DFunction target = null;
          Profiler targetProfile = null;

          if (scopeProfile != null && JSRuntime.Instance.Configuration.EnableSpeculativeJIT)
          {
            var nodeProfile = scopeProfile.GetNodeProfile(invocation);
            if (nodeProfile != null)
            {
              target = nodeProfile.Target;
              if (target != null)
              {
                if (target.Code != null)
                  targetProfile = (target.Code as JSFunctionCode).Profiler;
              }
            }
          }

          var targetFuncMD = invocation.TargetFunctionMetadata;

          if (targetFuncMD != null)
          {
            if (invocation.InlinedIR != null)
            {
              ///We might be re-jiting a function and hence calling inliner again
              ///for invocation that were statically resolved and inline, we don't 
              ///have to repease the process again and can reuse the old inlined IR
              ///we can still use the targetProfile to help the rest of algorithms

              invocation.InlinedIR.TargetProfile = targetProfile;
              continue; //skip this call
            }
          }
          else
          {
            ///We need to clear the old inlined IR, 
            ///TODO: we should walk over the arguments of the call and remove users
            invocation.InlinedIR = null; //clear the old results if any

            if (target != null)
            {
              targetFuncMD = target.Metadata as JSFunctionMetadata;
            }
          }
          if (targetFuncMD != null)
          {
            InlineInvocation(invocation, targetFuncMD);
            if (invocation.InlinedIR != null)
            {
              invocation.InlinedIR.TargetProfile = targetProfile;
              InlineScope(invocation.InlinedIR.Scope, targetProfile);
            }
          }

        }
      }
开发者ID:reshadi2,项目名称:mcjs,代码行数:63,代码来源:FunctionInliner.cs


注:本文中的Profiler.GetNodeProfile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。