本文整理汇总了C#中ProtoCore.RuntimeCore.RemoveCallSiteGCRoot方法的典型用法代码示例。如果您正苦于以下问题:C# RuntimeCore.RemoveCallSiteGCRoot方法的具体用法?C# RuntimeCore.RemoveCallSiteGCRoot怎么用?C# RuntimeCore.RemoveCallSiteGCRoot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProtoCore.RuntimeCore
的用法示例。
在下文中一共展示了RuntimeCore.RemoveCallSiteGCRoot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DispatchNew
//Dispatch
private StackValue DispatchNew(
Context context,
List<StackValue> arguments,
List<List<ReplicationGuide>> partialReplicationGuides,
List<AtLevel> atLevels,
StackFrame stackFrame, RuntimeCore runtimeCore)
{
// Update the CallsiteExecutionState with
// TODO: Replace this with the real data
UpdateCallsiteExecutionState(null, runtimeCore);
Stopwatch sw = new Stopwatch();
sw.Start();
StringBuilder log = new StringBuilder();
log.AppendLine("Method name: " + methodName);
#region Get Function Group
//@PERF: Possible optimisation point here, to deal with static dispatches that don't need replication analysis
//Handle resolution Pass 1: Name -> Method Group
FunctionGroup funcGroup = GetFuncGroup(runtimeCore);
if (funcGroup == null)
{
log.AppendLine("Function group not located");
log.AppendLine("Resolution failed in: " + sw.ElapsedMilliseconds);
if (runtimeCore.Options.DumpFunctionResolverLogic)
runtimeCore.DSExecutable.EventSink.PrintMessage(log.ToString());
return ReportFunctionGroupNotFound(runtimeCore, arguments);
}
//check accesibility of function group
bool methodAccessible = IsFunctionGroupAccessible(runtimeCore, ref funcGroup);
if (!methodAccessible)
{
return ReportMethodNotAccessible(runtimeCore);
}
//If we got here then the function group got resolved
log.AppendLine("Function group resolved: " + funcGroup);
#endregion
arguments = GetArgumentsAtLevels(arguments, atLevels, runtimeCore).Select(a => a.Argument).ToList();
partialReplicationGuides = PerformRepGuideDemotion(arguments, partialReplicationGuides, runtimeCore);
//Replication Control is an ordered list of the elements that we have to replicate over
//Ordering implies containment, so element 0 is the outer most forloop, element 1 is nested within it etc.
//Take the explicit replication guides and build the replication structure
//Turn the replication guides into a guide -> List args data structure
var partialInstructions = Replicator.BuildPartialReplicationInstructions(partialReplicationGuides);
//Get the fep that are resolved
List<FunctionEndPoint> resolvesFeps;
List<ReplicationInstruction> replicationInstructions;
arguments = PerformRepGuideForcedPromotion(arguments, partialReplicationGuides, runtimeCore);
ComputeFeps(log, context, arguments, funcGroup, partialInstructions, partialReplicationGuides, stackFrame, runtimeCore, out resolvesFeps, out replicationInstructions);
if (resolvesFeps.Count == 0)
{
log.AppendLine("Resolution Failed");
if (runtimeCore.Options.DumpFunctionResolverLogic)
runtimeCore.DSExecutable.EventSink.PrintMessage(log.ToString());
return ReportMethodNotFoundForArguments(runtimeCore, arguments);
}
arguments.ForEach(x => runtimeCore.AddCallSiteGCRoot(CallSiteID, x));
StackValue ret = Execute(resolvesFeps, context, arguments, replicationInstructions, stackFrame, runtimeCore, funcGroup);
runtimeCore.RemoveCallSiteGCRoot(CallSiteID);
return ret;
}