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


C# NodeFactory.EETypeOptionalFields方法代码示例

本文整理汇总了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();
        }
开发者ID:huamichaelchen,项目名称:corert,代码行数:9,代码来源:EETypeOptionalFieldsNode.cs

示例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();
        }
开发者ID:krytarowski,项目名称:corert,代码行数:37,代码来源:GenericDefinitionEETypeNode.cs

示例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;
 }
开发者ID:krytarowski,项目名称:corert,代码行数:6,代码来源:ConstructedEETypeNode.cs

示例4: OutputOptionalFields

 private void OutputOptionalFields(NodeFactory factory, ref ObjectDataBuilder objData)
 {
     if(_optionalFieldsBuilder.IsAtLeastOneFieldUsed())
     {
         objData.EmitPointerReloc(factory.EETypeOptionalFields(_optionalFieldsBuilder));
     }
 }
开发者ID:modulexcite,项目名称:corert,代码行数:7,代码来源:EETypeNode.cs

示例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;
        }
开发者ID:modulexcite,项目名称:corert,代码行数:11,代码来源:EETypeNode.cs

示例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();
        }
开发者ID:xier2012,项目名称:corert,代码行数:41,代码来源:EETypeNode.cs

示例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();
        }
开发者ID:noahfalk,项目名称:corert,代码行数:30,代码来源:EETypeNode.cs


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