本文整理汇总了C#中ILCompiler.DependencyAnalysis.NodeFactory.Indirection方法的典型用法代码示例。如果您正苦于以下问题:C# NodeFactory.Indirection方法的具体用法?C# NodeFactory.Indirection怎么用?C# NodeFactory.Indirection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILCompiler.DependencyAnalysis.NodeFactory
的用法示例。
在下文中一共展示了NodeFactory.Indirection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetData
public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
{
var builder = new ObjectDataBuilder(factory);
// These need to be aligned the same as methods because they show up in same contexts
builder.RequireAlignment(factory.Target.MinimumFunctionAlignment);
builder.DefinedSymbols.Add(this);
MethodDesc canonMethod = Method.GetCanonMethodTarget(CanonicalFormKind.Specific);
// Pointer to the canonical body of the method
builder.EmitPointerReloc(factory.MethodEntrypoint(canonMethod));
// Find out what's the context to use
ISymbolNode contextParameter;
if (canonMethod.RequiresInstMethodDescArg())
{
contextParameter = factory.MethodGenericDictionary(Method);
}
else
{
Debug.Assert(canonMethod.RequiresInstMethodTableArg());
// Ask for a constructed type symbol because we need the vtable to get to the dictionary
contextParameter = factory.ConstructedTypeSymbol(Method.OwningType);
}
// The next entry is a pointer to the pointer to the context to be used for the canonical method
// TODO: in multi-module, this points to the import cell, and is no longer this weird pointer
builder.EmitPointerReloc(factory.Indirection(contextParameter));
return builder.ToObjectData();
}