types

package
v1.1.130 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Non-type metadata kinds have this bit set.
	MetadataKindIsNonType = 0x400
	// Non-heap metadata kinds have this bit set.
	MetadataKindIsNonHeap = 0x200
	// The above two flags are negative because the "class" kind has to be zero,
	// and class metadata is both type and heap metadata.
	// Runtime-private metadata has this bit set. The compiler must not statically
	// generate metadata objects with these kinds, and external tools should not
	// rely on the stability of these values or the precise binary layout of
	// their associated data structures.
	MetadataKindIsRuntimePrivate = 0x100
)
View Source
const (
	// Bit used to indicate that an associated type witness is a pointer to a mangled name (vs. a pointer to metadata).
	AssociatedTypeMangledNameBit uint32 = 0x01
	// Prefix byte used to identify an associated type whose mangled name is relative to the protocol's context rather than the conforming type's context.
	AssociatedTypeInProtocolContextByte uint8 = 0xFF
)
View Source
const (
	Method mdKind = iota
	Init
	Getter
	Setter
	ModifyCoroutine
	ReadCoroutine
)
View Source
const (
	ExtraDiscriminatorShift = 16
	ExtraDiscriminatorMask  = 0xFFFF0000
)
View Source
const EnableChainingMask = 0x1

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessibleFunctionCacheEntry added in v1.1.101

type AccessibleFunctionCacheEntry struct {
	Name    string
	NameLen uint32
	R       uint64 // AccessibleFunctionRecord

}

type AccessibleFunctionFlags added in v1.1.101

type AccessibleFunctionFlags uint32
const (
	Distributed AccessibleFunctionFlags = 0
)

type AccessibleFunctionsSection added in v1.1.101

type AccessibleFunctionsSection struct {
	Begin uint64 // AccessibleFunctionRecord
	End   uint64 // AccessibleFunctionRecord
}

type AccessibleFunctionsState added in v1.1.101

type AccessibleFunctionsState struct {
	Cache          AccessibleFunctionCacheEntry
	SectionsToScan AccessibleFunctionsSection
}

type AutomaticDynamicReplacementEntry added in v1.1.101

type AutomaticDynamicReplacementEntry struct {
	ReplacementScope int32 // DynamicReplacementScope
	Flags            uint32
}

type AutomaticDynamicReplacements added in v1.1.101

type AutomaticDynamicReplacements struct {
	Flags     uint32
	NumScopes uint32
	AutomaticDynamicReplacementEntry
}

type AutomaticDynamicReplacementsSome added in v1.1.101

type AutomaticDynamicReplacementsSome struct {
	Flags           uint32
	NumReplacements uint32
	Replacements    []DynamicReplacementSomeDescriptor
}

type ConformanceDescriptor added in v1.1.101

type ConformanceDescriptor struct {
	TargetProtocolConformanceDescriptor
	Protocol     string
	TypeRef      *TypeDescriptor
	WitnessTable int32
}

type ConformanceFlags added in v1.1.101

type ConformanceFlags uint32
const (
	UnusedLowBits ConformanceFlags = 0x07 // historical conformance kind

	TypeMetadataKindMask  ConformanceFlags = 0x7 << 3 // 8 type reference kinds
	TypeMetadataKindShift ConformanceFlags = 3

	IsRetroactiveMask          ConformanceFlags = 0x01 << 6
	IsSynthesizedNonUniqueMask ConformanceFlags = 0x01 << 7

	NumConditionalRequirementsMask  ConformanceFlags = 0xFF << 8
	NumConditionalRequirementsShift ConformanceFlags = 8

	HasResilientWitnessesMask  ConformanceFlags = 0x01 << 16
	HasGenericWitnessTableMask ConformanceFlags = 0x01 << 17
)

func (ConformanceFlags) GetNumConditionalRequirements added in v1.1.101

func (f ConformanceFlags) GetNumConditionalRequirements() int

GetNumConditionalRequirements retrieve the # of conditional requirements.

func (ConformanceFlags) GetTypeReferenceKind added in v1.1.101

func (f ConformanceFlags) GetTypeReferenceKind() TypeReferenceKind

GetTypeReferenceKind retrieve the type reference kind kind.

func (ConformanceFlags) HasGenericWitnessTable added in v1.1.101

func (f ConformanceFlags) HasGenericWitnessTable() bool

HasGenericWitnessTable whether this conformance has a generic witness table that may need to be instantiated.

func (ConformanceFlags) HasResilientWitnesses added in v1.1.101

func (f ConformanceFlags) HasResilientWitnesses() bool

HasResilientWitnesses whether this conformance has any resilient witnesses.

func (ConformanceFlags) IsRetroactive added in v1.1.101

func (f ConformanceFlags) IsRetroactive() bool

IsRetroactive Is the conformance "retroactive"?

A conformance is retroactive when it occurs in a module that is neither the module in which the protocol is defined nor the module in which the conforming type is defined. With retroactive conformance, it is possible to detect a conflict at run time.

func (ConformanceFlags) IsSynthesizedNonUnique added in v1.1.101

func (f ConformanceFlags) IsSynthesizedNonUnique() bool

IsSynthesizedNonUnique is the conformance synthesized in a non-unique manner?

The Swift compiler will synthesize conformances on behalf of some imported entities (e.g., C typedefs with the swift_wrapper attribute). Such conformances are retroactive by nature, but the presence of multiple such conformances is not a conflict because all synthesized conformances will be equivalent.

func (ConformanceFlags) String added in v1.1.101

func (f ConformanceFlags) String() string

type ContextDescriptorFlags added in v1.1.100

type ContextDescriptorFlags uint32

func (ContextDescriptorFlags) IsGeneric added in v1.1.100

func (f ContextDescriptorFlags) IsGeneric() bool

func (ContextDescriptorFlags) IsUnique added in v1.1.100

func (f ContextDescriptorFlags) IsUnique() bool

func (ContextDescriptorFlags) Kind added in v1.1.100

func (ContextDescriptorFlags) KindSpecific added in v1.1.100

func (ContextDescriptorFlags) String added in v1.1.100

func (f ContextDescriptorFlags) String() string

func (ContextDescriptorFlags) Version added in v1.1.100

func (f ContextDescriptorFlags) Version() uint8

type ContextDescriptorKind added in v1.1.100

type ContextDescriptorKind uint8
const (
	// This context descriptor represents a module.
	CDKindModule ContextDescriptorKind = 0 // module

	/// This context descriptor represents an extension.
	CDKindExtension ContextDescriptorKind = 1 // extension

	/// This context descriptor represents an anonymous possibly-generic context
	/// such as a function body.
	CDKindAnonymous ContextDescriptorKind = 2 // anonymous

	/// This context descriptor represents a protocol context.
	CDKindProtocol ContextDescriptorKind = 3 // protocol

	/// This context descriptor represents an opaque type alias.
	CDKindOpaqueType ContextDescriptorKind = 4 // opaque_type

	/// First kind that represents a type of any sort.
	CDKindTypeFirst = 16 // type_first

	/// This context descriptor represents a class.
	CDKindClass ContextDescriptorKind = CDKindTypeFirst // class

	/// This context descriptor represents a struct.
	CDKindStruct ContextDescriptorKind = CDKindTypeFirst + 1 // struct

	/// This context descriptor represents an enum.
	CDKindEnum ContextDescriptorKind = CDKindTypeFirst + 2 // enum

	/// Last kind that represents a type of any sort.
	CDKindTypeLast = 31 // type_last
)

func (ContextDescriptorKind) String added in v1.1.100

func (i ContextDescriptorKind) String() string

type Descriptor added in v1.1.101

type Descriptor struct {
	Flags                      ContextDescriptorFlags // overide kind specific flags w/ ProtocolContextDescriptorFlags TODO: handle kind specific flags
	ParentOffset               int32
	NameOffset                 int32  // The name of the protocol.
	NumRequirementsInSignature uint32 // The number of generic requirements in the requirement signature of the protocol.
	NumRequirements            uint32 /* The number of requirements in the protocol. If any requirements beyond MinimumWitnessTableSizeInWords are present
	 * in the witness table template, they will be not be overwritten with defaults. */
	AssociatedTypeNamesOffset int32 // Associated type names, as a space-separated list in the same order as the requirements.
}

Descriptor in __TEXT.__swift5_protos This section contains an array of 32-bit signed integers. Each integer is a relative offset that points to a protocol descriptor in the __TEXT.__const section.

func (Descriptor) GetProtocolContextDescriptorFlags added in v1.1.101

func (d Descriptor) GetProtocolContextDescriptorFlags() ProtocolContextDescriptorFlags

func (Descriptor) String added in v1.1.101

func (d Descriptor) String() string

type DynamicReplacementChainEntry added in v1.1.101

type DynamicReplacementChainEntry struct {
	ImplementationFunction uint64 // void *
	Next                   uint64 // DynamicReplacementChainEntry *
}

type DynamicReplacementDescriptor added in v1.1.101

type DynamicReplacementDescriptor struct {
	ReplacedFunctionKey int32 // DynamicReplacementKey
	ReplacementFunction int32 // UNION w/ ReplacementAsyncFunction - TargetCompactFunctionPointer|TargetRelativeDirectPointer
	ChainEntry          int32 // DynamicReplacementChainEntry
	Flags               uint32
}

func (DynamicReplacementDescriptor) ShouldChain added in v1.1.101

func (d DynamicReplacementDescriptor) ShouldChain() bool

type DynamicReplacementKey added in v1.1.101

type DynamicReplacementKey struct {
	Root  int32
	Flags uint32
}

func (DynamicReplacementKey) ExtraDiscriminator added in v1.1.101

func (d DynamicReplacementKey) ExtraDiscriminator() uint16

func (DynamicReplacementKey) IsAsync added in v1.1.101

func (d DynamicReplacementKey) IsAsync() bool

type DynamicReplacementScope added in v1.1.101

type DynamicReplacementScope struct {
	Flags           uint32
	NumReplacements uint32 // hard coded to 1
	DynamicReplacementDescriptor
}

type DynamicReplacementSomeDescriptor added in v1.1.101

type DynamicReplacementSomeDescriptor struct {
	OriginalOpaqueTypeDesc    int32 // OpaqueTypeDescriptor -> TargetContextDescriptor
	ReplacementOpaqueTypeDesc int32 // OpaqueTypeDescriptor -> TargetContextDescriptor
}

type GenericEnvironmentFlags added in v1.1.101

type GenericEnvironmentFlags uint32

func (GenericEnvironmentFlags) GetNumGenericParameterLevels added in v1.1.101

func (f GenericEnvironmentFlags) GetNumGenericParameterLevels() uint32

func (GenericEnvironmentFlags) GetNumGenericRequirements added in v1.1.101

func (f GenericEnvironmentFlags) GetNumGenericRequirements() uint32

type GenericRequirementFlags added in v1.1.101

type GenericRequirementFlags uint32

func (GenericRequirementFlags) HasExtraArgument added in v1.1.101

func (f GenericRequirementFlags) HasExtraArgument() bool

func (GenericRequirementFlags) HasKeyArgument added in v1.1.101

func (f GenericRequirementFlags) HasKeyArgument() bool

func (GenericRequirementFlags) Kind added in v1.1.101

func (GenericRequirementFlags) String added in v1.1.101

func (f GenericRequirementFlags) String() string

type GenericRequirementKind added in v1.1.101

type GenericRequirementKind uint8
const (
	GRKindProtocol  GenericRequirementKind = 0 // protocol
	GRKindSameType  GenericRequirementKind = 1 // same-type
	GRKindBaseClass GenericRequirementKind = 2 // base class
	// implied by a same-type or base-class constraint that binds a parameter with protocol requirements.
	GRKindSameConformance GenericRequirementKind = 3    // same-conformance
	GRKindLayout          GenericRequirementKind = 0x1F // layout
)

func (GenericRequirementKind) String added in v1.1.101

func (i GenericRequirementKind) String() string

type MetadataInitializationKind added in v1.1.100

type MetadataInitializationKind uint8
const (
	// There are either no special rules for initializing the metadata or the metadata is generic.
	// (Genericity is set in the non-kind-specific descriptor flags.)
	MetadataInitNone MetadataInitializationKind = 0 // none
	//The type requires non-trivial singleton initialization using the "in-place" code pattern.
	MetadataInitSingleton MetadataInitializationKind = 1 // singleton
	// The type requires non-trivial singleton initialization using the "foreign" code pattern.
	MetadataInitForeign MetadataInitializationKind = 2 // foreign

)

func (MetadataInitializationKind) String added in v1.1.100

type MetadataKind added in v1.1.101

type MetadataKind uint32
const (
	ClassMetadataKind                    MetadataKind = 0                                                        // class
	StructMetadataKind                   MetadataKind = 0 | MetadataKindIsNonHeap                                // struct
	EnumMetadataKind                     MetadataKind = 1 | MetadataKindIsNonHeap                                // enum
	OptionalMetadataKind                 MetadataKind = 2 | MetadataKindIsNonHeap                                // optional
	ForeignClassMetadataKind             MetadataKind = 3 | MetadataKindIsNonHeap                                // foreign class
	ForeignReferenceTypeMetadataKind     MetadataKind = 4 | MetadataKindIsNonHeap                                // foreign reference type
	OpaqueMetadataKind                   MetadataKind = 0 | MetadataKindIsRuntimePrivate | MetadataKindIsNonHeap // opaque
	TupleMetadataKind                    MetadataKind = 1 | MetadataKindIsRuntimePrivate | MetadataKindIsNonHeap // tuple
	FunctionMetadataKind                 MetadataKind = 2 | MetadataKindIsRuntimePrivate | MetadataKindIsNonHeap // function
	ExistentialMetadataKind              MetadataKind = 3 | MetadataKindIsRuntimePrivate | MetadataKindIsNonHeap // existential
	MetatypeMetadataKind                 MetadataKind = 4 | MetadataKindIsRuntimePrivate | MetadataKindIsNonHeap // metatype
	ObjCClassWrapperMetadataKind         MetadataKind = 5 | MetadataKindIsRuntimePrivate | MetadataKindIsNonHeap // objc class wrapper
	ExistentialMetatypeMetadataKind      MetadataKind = 6 | MetadataKindIsRuntimePrivate | MetadataKindIsNonHeap // existential metatype
	ExtendedExistentialMetadataKind      MetadataKind = 7 | MetadataKindIsRuntimePrivate | MetadataKindIsNonHeap // extended existential type
	HeapLocalVariableMetadataKind        MetadataKind = 0 | MetadataKindIsNonType                                // heap local variable
	HeapGenericLocalVariableMetadataKind MetadataKind = 0 | MetadataKindIsNonType | MetadataKindIsRuntimePrivate // heap generic local variable
	ErrorObjectMetadataKind              MetadataKind = 1 | MetadataKindIsNonType | MetadataKindIsRuntimePrivate // error object
	TaskMetadataKind                     MetadataKind = 2 | MetadataKindIsNonType | MetadataKindIsRuntimePrivate // task
	JobMetadataKind                      MetadataKind = 3 | MetadataKindIsNonType | MetadataKindIsRuntimePrivate // job
	// The largest possible non-isa-pointer metadata kind value.
	LastEnumerated MetadataKind = 0x7FF
)

func (MetadataKind) String added in v1.1.101

func (i MetadataKind) String() string

type MethodDescriptorFlags added in v1.1.100

type MethodDescriptorFlags uint32

func (MethodDescriptorFlags) ExtraDiscriminator added in v1.1.100

func (f MethodDescriptorFlags) ExtraDiscriminator() uint16

func (MethodDescriptorFlags) IsAsync added in v1.1.100

func (f MethodDescriptorFlags) IsAsync() bool

func (MethodDescriptorFlags) IsDynamic added in v1.1.100

func (f MethodDescriptorFlags) IsDynamic() bool

func (MethodDescriptorFlags) IsInstance added in v1.1.100

func (f MethodDescriptorFlags) IsInstance() bool

func (MethodDescriptorFlags) Kind added in v1.1.100

func (f MethodDescriptorFlags) Kind() string

func (MethodDescriptorFlags) String added in v1.1.100

func (f MethodDescriptorFlags) String() string

type Protocol

type Protocol struct {
	Name           string
	AssociatedType string
	Parent         string
	Descriptor
	SignatureRequirements []TargetGenericRequirementDescriptor
	Requirements          []TargetProtocolRequirement
}

Protocol swift protocol object

func (Protocol) String added in v1.1.101

func (p Protocol) String() string

type ProtocolContextDescriptorFlags added in v1.1.101

type ProtocolContextDescriptorFlags uint16

ProtocolContextDescriptorFlags flags for protocol context descriptors. These values are used as the kindSpecificFlags of the ContextDescriptorFlags for the protocol.

const (
	/// Whether this protocol is class-constrained.
	HasClassConstraint       ProtocolContextDescriptorFlags = 0
	HasClassConstraint_width ProtocolContextDescriptorFlags = 1
	/// Whether this protocol is resilient.
	IsResilient ProtocolContextDescriptorFlags = 1
	/// Special protocol value.
	SpecialProtocolKind       ProtocolContextDescriptorFlags = 2
	SpecialProtocolKind_width ProtocolContextDescriptorFlags = 6
)

type ProtocolRequirementFlags added in v1.1.101

type ProtocolRequirementFlags uint32

func (ProtocolRequirementFlags) ExtraDiscriminator added in v1.1.101

func (f ProtocolRequirementFlags) ExtraDiscriminator() uint16

func (ProtocolRequirementFlags) IsAsync added in v1.1.101

func (f ProtocolRequirementFlags) IsAsync() bool

func (ProtocolRequirementFlags) IsFunctionImpl added in v1.1.101

func (f ProtocolRequirementFlags) IsFunctionImpl() bool

func (ProtocolRequirementFlags) IsInstance added in v1.1.101

func (f ProtocolRequirementFlags) IsInstance() bool

func (ProtocolRequirementFlags) IsSignedWithAddress added in v1.1.101

func (f ProtocolRequirementFlags) IsSignedWithAddress() bool

func (ProtocolRequirementFlags) Kind added in v1.1.101

func (ProtocolRequirementFlags) String added in v1.1.101

func (f ProtocolRequirementFlags) String() string

type ProtocolRequirementKind added in v1.1.101

type ProtocolRequirementKind uint8
const (
	PRKindBaseProtocol                        ProtocolRequirementKind = iota // base protocol
	PRKindMethodc                                                            // method
	PRKindInit                                                               // initializer
	PRKindGetter                                                             // getter
	PRKindSetter                                                             // setter
	PRKindReadCoroutine                                                      // read coroutine
	PRKindModifyCoroutine                                                    // modify coroutine
	PRKindAssociatedTypeAccessFunction                                       // associated type access function
	PRKindAssociatedConformanceAccessFunction                                // associated conformance access function
)

func (ProtocolRequirementKind) String added in v1.1.101

func (i ProtocolRequirementKind) String() string

type TargetAccessibleFunctionRecord added in v1.1.101

type TargetAccessibleFunctionRecord struct {
	Name               int32 // char *
	GenericEnvironment int32 // TargetGenericEnvironment
	FunctionType       int32 // mangled name
	Function           int32 // void *
	Flags              AccessibleFunctionFlags
}

type TargetAnonymousContextDescriptor added in v1.1.100

type TargetAnonymousContextDescriptor struct {
	TargetContextDescriptor
}

type TargetClassDescriptor added in v1.1.100

type TargetClassDescriptor struct {
	TargetTypeContextDescriptor
	SuperclassType              int32
	MetadataNegativeSizeInWords uint32
	MetadataPositiveSizeInWords uint32
	NumImmediateMembers         uint32
	NumFields                   uint32
	FieldOffsetVectorOffset     uint32
}

type TargetContextDescriptor added in v1.1.100

type TargetContextDescriptor struct {
	Flags        ContextDescriptorFlags
	ParentOffset int32
}

type TargetEnumDescriptor added in v1.1.100

type TargetEnumDescriptor struct {
	TargetTypeContextDescriptor
	NumPayloadCasesAndPayloadSizeOffset uint32
	NumEmptyCases                       uint32
}

func (TargetEnumDescriptor) GetNumCases added in v1.1.100

func (e TargetEnumDescriptor) GetNumCases() uint32

func (TargetEnumDescriptor) GetNumPayloadCases added in v1.1.100

func (e TargetEnumDescriptor) GetNumPayloadCases() uint32

func (TargetEnumDescriptor) GetPayloadSizeOffset added in v1.1.100

func (e TargetEnumDescriptor) GetPayloadSizeOffset() uint32

type TargetExtensionContextDescriptor added in v1.1.100

type TargetExtensionContextDescriptor struct {
	TargetContextDescriptor
	ExtendedContext int32
}

type TargetForeignMetadataInitialization added in v1.1.100

type TargetForeignMetadataInitialization struct {
	CompletionFunction int32 // The completion function. The pattern will always be null.
}

type TargetGenericContextDescriptorHeader added in v1.1.100

type TargetGenericContextDescriptorHeader struct {
	NumParams         uint16
	NumRequirements   uint16
	NumKeyArguments   uint16
	NumExtraArguments uint16
}

func (TargetGenericContextDescriptorHeader) GetArgumentLayoutSizeInWords added in v1.1.100

func (g TargetGenericContextDescriptorHeader) GetArgumentLayoutSizeInWords() uint32

func (TargetGenericContextDescriptorHeader) GetNumArguments added in v1.1.100

func (g TargetGenericContextDescriptorHeader) GetNumArguments() uint32

func (TargetGenericContextDescriptorHeader) HasArguments added in v1.1.100

func (g TargetGenericContextDescriptorHeader) HasArguments() bool

type TargetGenericEnvironment added in v1.1.101

type TargetGenericEnvironment struct {
	Flags GenericEnvironmentFlags
}

type TargetGenericRequirementDescriptor added in v1.1.101

type TargetGenericRequirementDescriptor struct {
	Flags                               GenericRequirementFlags
	Param                               int32 // The type that's constrained, described as a mangled name.
	TypeOrProtocolOrConformanceOrLayout int32 // UNION: flags determine type
}

type TargetMethodDescriptor added in v1.1.100

type TargetMethodDescriptor struct {
	Flags MethodDescriptorFlags
	Impl  int32
}

type TargetModuleContextDescriptor added in v1.1.100

type TargetModuleContextDescriptor struct {
	TargetContextDescriptor
	NameOffset int32
}

type TargetOpaqueTypeDescriptor added in v1.1.100

type TargetOpaqueTypeDescriptor struct {
	TargetContextDescriptor
}

type TargetProtocolConformanceDescriptor added in v1.1.101

type TargetProtocolConformanceDescriptor struct {
	ProtocolOffsest            int32
	TypeRefOffsest             int32
	WitnessTablePatternOffsest int32
	Flags                      ConformanceFlags
}

type TargetProtocolDescriptor added in v1.1.100

type TargetProtocolDescriptor struct {
	TargetContextDescriptor
	NameOffset                 int32  // The name of the protocol.
	NumRequirementsInSignature uint32 // The number of generic requirements in the requirement signature of the protocol.
	NumRequirements            uint32 /* The number of requirements in the protocol. If any requirements beyond MinimumWitnessTableSizeInWords are present
	 * in the witness table template, they will be not be overwritten with defaults. */
	AssociatedTypeNamesOffset int32 // Associated type names, as a space-separated list in the same order as the requirements.
}

type TargetProtocolRequirement added in v1.1.101

type TargetProtocolRequirement struct {
	Flags                 ProtocolRequirementFlags
	DefaultImplementation int32
}

type TargetSingletonMetadataInitialization added in v1.1.100

type TargetSingletonMetadataInitialization struct {
	InitializationCacheOffset int32 // The initialization cache. Out-of-line because mutable.
	IncompleteMetadata        int32 // UNION: The incomplete metadata, for structs, enums and classes without resilient ancestry.
	// ResilientPattern
	// If the class descriptor's hasResilientSuperclass() flag is set,
	// this field instead points at a pattern used to allocate and
	// initialize metadata for this class, since it's size and contents
	// is not known at compile time.
	CompletionFunction int32 // The completion function. The pattern will always be null, even for a resilient class.
}

type TargetStructDescriptor added in v1.1.100

type TargetStructDescriptor struct {
	TargetTypeContextDescriptor
	NumFields               uint32
	FieldOffsetVectorOffset uint32
}

type TargetTypeContextDescriptor added in v1.1.101

type TargetTypeContextDescriptor struct {
	TargetContextDescriptor
	NameOffset        int32 // The name of the type.
	AccessFunctionPtr int32 // The access function for the type.
	FieldsOffset      int32 // A pointer to the field descriptor for the type, if any.
}

type TargetTypeGenericContextDescriptorHeader added in v1.1.100

type TargetTypeGenericContextDescriptorHeader struct {
	InstantiationCache          int32
	DefaultInstantiationPattern int32
	Base                        TargetGenericContextDescriptorHeader
}

type TargetVTableDescriptorHeader added in v1.1.100

type TargetVTableDescriptorHeader struct {
	VTableOffset uint32
	VTableSize   uint32
}

type TargetWitnessTable added in v1.1.101

type TargetWitnessTable struct {
	Description int32
}

type Type added in v1.1.100

type Type struct {
	Address uint64
	Name    string
}

type TypeContextDescriptorFlags added in v1.1.100

type TypeContextDescriptorFlags uint16
const (

	/// Whether there's something unusual about how the metadata is
	/// initialized.
	///
	/// Meaningful for all type-descriptor kinds.
	MetadataInitialization       TypeContextDescriptorFlags = 0
	MetadataInitialization_width TypeContextDescriptorFlags = 2

	/// Set if the type has extended import information.
	///
	/// If true, a sequence of strings follow the null terminator in the
	/// descriptor, terminated by an empty string (i.e. by two null
	/// terminators in a row).  See TypeImportInfo for the details of
	/// these strings and the order in which they appear.
	///
	/// Meaningful for all type-descriptor kinds.
	HasImportInfo TypeContextDescriptorFlags = 2

	/// Set if the type descriptor has a pointer to a list of canonical
	/// prespecializations.
	HasCanonicalMetadataPrespecializations TypeContextDescriptorFlags = 3

	/// Set if the class is an actor.
	///
	/// Only meaningful for class descriptors.
	Class_IsActor TypeContextDescriptorFlags = 7

	/// Set if the class is a default actor class.  Note that this is
	/// based on the best knowledge available to the class; actor
	/// classes with resilient superclassess might be default actors
	/// without knowing it.
	///
	/// Only meaningful for class descriptors.
	Class_IsDefaultActor TypeContextDescriptorFlags = 8

	/// The kind of reference that this class makes to its resilient superclass
	/// descriptor.  A TypeReferenceKind.
	///
	/// Only meaningful for class descriptors.
	Class_ResilientSuperclassReferenceKind       TypeContextDescriptorFlags = 9
	Class_ResilientSuperclassReferenceKind_width TypeContextDescriptorFlags = 3

	/// Whether the immediate class members in this metadata are allocated
	/// at negative offsets.  For now, we don't use this.
	Class_AreImmediateMembersNegative TypeContextDescriptorFlags = 12

	/// Set if the context descriptor is for a class with resilient ancestry.
	///
	/// Only meaningful for class descriptors.
	Class_HasResilientSuperclass TypeContextDescriptorFlags = 13

	/// Set if the context descriptor includes metadata for dynamically
	/// installing method overrides at metadata instantiation time.
	Class_HasOverrideTable TypeContextDescriptorFlags = 14

	/// Set if the context descriptor includes metadata for dynamically
	/// constructing a class's vtables at metadata instantiation time.
	///
	/// Only meaningful for class descriptors.
	Class_HasVTable TypeContextDescriptorFlags = 15
)

func (TypeContextDescriptorFlags) AreImmediateMembersNegative added in v1.1.100

func (f TypeContextDescriptorFlags) AreImmediateMembersNegative() bool

func (TypeContextDescriptorFlags) HasImportInfo added in v1.1.100

func (f TypeContextDescriptorFlags) HasImportInfo() bool

func (TypeContextDescriptorFlags) HasOverrideTable added in v1.1.100

func (f TypeContextDescriptorFlags) HasOverrideTable() bool

func (TypeContextDescriptorFlags) HasResilientSuperclass added in v1.1.100

func (f TypeContextDescriptorFlags) HasResilientSuperclass() bool

func (TypeContextDescriptorFlags) HasVTable added in v1.1.100

func (f TypeContextDescriptorFlags) HasVTable() bool

func (TypeContextDescriptorFlags) IsActor added in v1.1.100

func (f TypeContextDescriptorFlags) IsActor() bool

func (TypeContextDescriptorFlags) IsDefaultActor added in v1.1.100

func (f TypeContextDescriptorFlags) IsDefaultActor() bool

func (TypeContextDescriptorFlags) MetadataInitialization added in v1.1.100

func (f TypeContextDescriptorFlags) MetadataInitialization() MetadataInitializationKind

func (TypeContextDescriptorFlags) ResilientSuperclassReferenceKind added in v1.1.100

func (f TypeContextDescriptorFlags) ResilientSuperclassReferenceKind() TypeReferenceKind

func (TypeContextDescriptorFlags) String added in v1.1.100

type TypeDescriptor

type TypeDescriptor struct {
	Address        uint64
	Parent         Type
	Name           string
	Kind           ContextDescriptorKind
	AccessFunction uint64
	FieldOffsets   []int32
	Generic        *TargetTypeGenericContextDescriptorHeader
	VTable         *VTable
	Fields         []*fields.Field
	Type           any
}

func (TypeDescriptor) IsCImportedModuleName added in v1.1.100

func (t TypeDescriptor) IsCImportedModuleName() bool

type TypeReferenceKind added in v1.1.100

type TypeReferenceKind uint8

TypeReferenceKind kinds of type metadata/protocol conformance records.

const (
	//The conformance is for a nominal type referenced directly; getTypeDescriptor() points to the type context descriptor.
	DirectTypeDescriptor TypeReferenceKind = 0x00
	// The conformance is for a nominal type referenced indirectly; getTypeDescriptor() points to the type context descriptor.
	IndirectTypeDescriptor TypeReferenceKind = 0x01
	// The conformance is for an Objective-C class that should be looked up by class name.
	DirectObjCClassName TypeReferenceKind = 0x02
	// The conformance is for an Objective-C class that has no nominal type descriptor.
	// getIndirectObjCClass() points to a variable that contains the pointer to
	// the class object, which then requires a runtime call to get metadata.
	//
	// On platforms without Objective-C interoperability, this case is unused.
	IndirectObjCClass TypeReferenceKind = 0x03
	// We only reserve three bits for this in the various places we store it.
	FirstKind = DirectTypeDescriptor
	LastKind  = IndirectObjCClass
)

func (TypeReferenceKind) String added in v1.1.100

func (i TypeReferenceKind) String() string

type VTable added in v1.1.100

type VTable struct {
	TargetVTableDescriptorHeader
	MethodListOffset int64
	Methods          []TargetMethodDescriptor
}

func (*VTable) GetMethods added in v1.1.100

func (v *VTable) GetMethods(base uint64) []method

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL