本文整理汇总了C#中ILCompiler.DependencyAnalysis.NodeFactory.EETypeOptionalFields方法的典型用法代码示例。如果您正苦于以下问题:C# NodeFactory.EETypeOptionalFields方法的具体用法?C# NodeFactory.EETypeOptionalFields怎么用?C# NodeFactory.EETypeOptionalFields使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILCompiler.DependencyAnalysis.NodeFactory
的用法示例。
在下文中一共展示了NodeFactory.EETypeOptionalFields方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShouldSkipEmittingObjectNode
public override bool ShouldSkipEmittingObjectNode(NodeFactory factory)
{
// Ensure that no duplicate EETypeOptionalFieldsNodes are emitted by letting the node Factory
// pick a winner for each given EETypeOptionalFieldsBuilder
if (factory.EETypeOptionalFields(_fieldBuilder) != this)
return true;
return !_fieldBuilder.IsAtLeastOneFieldUsed();
}
示例2: GetData
public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false)
{
ObjectDataBuilder dataBuilder = new ObjectDataBuilder(factory);
dataBuilder.Alignment = dataBuilder.TargetPointerSize;
dataBuilder.DefinedSymbols.Add(this);
EETypeRareFlags rareFlags = 0;
short flags = (short)EETypeKind.GenericTypeDefEEType;
if (_type.IsValueType)
flags |= (short)EETypeFlags.ValueTypeFlag;
if (_type.IsInterface)
flags |= (short)EETypeFlags.IsInterfaceFlag;
if (factory.TypeSystemContext.HasLazyStaticConstructor(_type))
rareFlags = rareFlags | EETypeRareFlags.HasCctorFlag;
if (rareFlags != 0)
_optionalFieldsBuilder.SetFieldValue(EETypeOptionalFieldTag.RareFlags, (uint)rareFlags);
if (_optionalFieldsBuilder.IsAtLeastOneFieldUsed())
flags |= (short)EETypeFlags.OptionalFieldsFlag;
dataBuilder.EmitShort((short)_type.Instantiation.Length);
dataBuilder.EmitShort(flags);
dataBuilder.EmitInt(0); // Base size is always 0
dataBuilder.EmitZeroPointer(); // No related type
dataBuilder.EmitShort(0); // No VTable
dataBuilder.EmitShort(0); // No interface map
dataBuilder.EmitInt(_type.GetHashCode());
dataBuilder.EmitPointerReloc(factory.ModuleManagerIndirection);
if (_optionalFieldsBuilder.IsAtLeastOneFieldUsed())
{
dataBuilder.EmitPointerReloc(factory.EETypeOptionalFields(_optionalFieldsBuilder));
}
return dataBuilder.ToObjectData();
}
示例3: SearchDynamicDependencies
public override IEnumerable<CombinedDependencyListEntry> SearchDynamicDependencies(List<DependencyNodeCore<NodeFactory>> markedNodes, int firstNode, NodeFactory factory)
{
List<CombinedDependencyListEntry> dynamicNodes = new List<DependencyNodeCore<NodeFactory>.CombinedDependencyListEntry>();
dynamicNodes.Add(new CombinedDependencyListEntry(factory.EETypeOptionalFields(_optionalFieldsBuilder), null, "EEType optional fields"));
return dynamicNodes;
}
示例4: OutputOptionalFields
private void OutputOptionalFields(NodeFactory factory, ref ObjectDataBuilder objData)
{
if(_optionalFieldsBuilder.IsAtLeastOneFieldUsed())
{
objData.EmitPointerReloc(factory.EETypeOptionalFields(_optionalFieldsBuilder));
}
}
示例5: ComputeNonRelocationBasedDependencies
protected override DependencyList ComputeNonRelocationBasedDependencies(NodeFactory factory)
{
DependencyList dependencyList = new DependencyNodeCore<NodeFactory>.DependencyList();
if (_type is MetadataType && _constructed && _type.RuntimeInterfaces.Length > 0)
{
dependencyList.Add(factory.InterfaceDispatchMap(_type), "Interface dispatch map");
}
dependencyList.Add(factory.EETypeOptionalFields(_optionalFieldsBuilder), "EEType optional fields");
return dependencyList;
}
示例6: GetData
public override ObjectData GetData(NodeFactory factory, bool relocsOnly)
{
ObjectDataBuilder objData = new ObjectDataBuilder(factory);
objData.Alignment = 16;
objData.DefinedSymbols.Add(this);
// Todo: Generic Type Definition EETypes
// Early-out just to prevent crashing at compile time...
if (_type.HasInstantiation && _type.IsTypeDefinition)
{
objData.EmitZeroPointer();
return objData.ToObjectData();
}
ComputeOptionalEETypeFields(factory);
if (null == _optionalFieldsNode)
{
_optionalFieldsNode = factory.EETypeOptionalFields(_optionalFieldsBuilder);
}
OutputComponentSize(ref objData);
OutputFlags(factory, ref objData);
OutputBaseSize(ref objData);
OutputRelatedType(factory, ref objData);
OutputVirtualSlotAndInterfaceCount(factory, ref objData);
objData.EmitInt(_type.GetHashCode());
if (_constructed)
{
OutputVirtualSlots(factory, ref objData, _type, _type);
OutputInterfaceMap(factory, ref objData);
}
OutputFinalizerMethod(factory, ref objData);
OutputOptionalFields(factory, ref objData);
OutputNullableTypeParameter(factory, ref objData);
return objData.ToObjectData();
}
示例7: GetData
public override ObjectData GetData(NodeFactory factory, bool relocsOnly)
{
ObjectDataBuilder objData = new ObjectDataBuilder(factory);
objData.Alignment = 16;
objData.DefinedSymbols.Add(this);
ComputeOptionalEETypeFields(factory);
if (null == _optionalFieldsNode)
{
_optionalFieldsNode = factory.EETypeOptionalFields(_optionalFieldsBuilder);
}
OutputComponentSize(ref objData);
OutputFlags(factory, ref objData);
OutputBaseSize(ref objData);
OutputRelatedType(factory, ref objData);
OutputVirtualSlotAndInterfaceCount(factory, ref objData);
objData.EmitInt(_type.GetHashCode());
if (_constructed)
{
OutputVirtualSlots(factory, ref objData, _type, _type);
OutputFinalizerMethod(factory, ref objData);
OutputOptionalFields(factory, ref objData);
OutputNullableTypeParameter(factory, ref objData);
}
return objData.ToObjectData();
}