public EETypeNode(TypeDesc type) { Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Specific)); Debug.Assert(!type.IsRuntimeDeterminedSubtype); _type = type; _optionalFieldsNode = new EETypeOptionalFieldsNode(this); }
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()); }
public EETypeNode(NodeFactory factory, TypeDesc type) { Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Specific)); Debug.Assert(!type.IsRuntimeDeterminedSubtype); _type = type; _optionalFieldsNode = new EETypeOptionalFieldsNode(this); CheckCanGenerateEEType(factory, type); }
public EETypeNode(NodeFactory factory, TypeDesc type) { Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Specific)); Debug.Assert(!type.IsRuntimeDeterminedSubtype); _type = type; _optionalFieldsNode = new EETypeOptionalFieldsNode(this); // Note: The fact that you can't create invalid EETypeNode is used from many places that grab // an EETypeNode from the factory with the sole purpose of making sure the validation has run // and that the result of the positive validation is "cached" (by the presence of an EETypeNode). CheckCanGenerateEEType(factory, type); }
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); OutputFinalizerMethod(factory, ref objData); OutputOptionalFields(factory, ref objData); OutputNullableTypeParameter(factory, ref objData); } return(objData.ToObjectData()); }
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(); }
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(); }