mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
KeyPaths: Rationalize fragility attributes.
This commit is contained in:
@@ -12,7 +12,6 @@
|
||||
|
||||
import SwiftShims
|
||||
|
||||
@usableFromInline @_transparent
|
||||
internal func _abstract(
|
||||
methodName: StaticString = #function,
|
||||
file: StaticString = #file, line: UInt = #line
|
||||
@@ -28,7 +27,6 @@ internal func _abstract(
|
||||
// MARK: Type-erased abstract base classes
|
||||
|
||||
/// A type-erased key path, from any root type to any resulting value type.
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
public class AnyKeyPath: Hashable, _AppendKeyPath {
|
||||
/// The root type for this key path.
|
||||
@inlinable
|
||||
@@ -42,11 +40,9 @@ public class AnyKeyPath: Hashable, _AppendKeyPath {
|
||||
return _rootAndValueType.value
|
||||
}
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal final var _kvcKeyPathStringPtr: UnsafePointer<CChar>?
|
||||
|
||||
/// The hash value.
|
||||
@inlinable
|
||||
final public var hashValue: Int {
|
||||
return _hashValue(for: self)
|
||||
}
|
||||
@@ -73,7 +69,6 @@ public class AnyKeyPath: Hashable, _AppendKeyPath {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
public static func ==(a: AnyKeyPath, b: AnyKeyPath) -> Bool {
|
||||
// Fast-path identical objects
|
||||
if a === b {
|
||||
@@ -113,7 +108,6 @@ public class AnyKeyPath: Hashable, _AppendKeyPath {
|
||||
|
||||
// SPI for the Foundation overlay to allow interop with KVC keypath-based
|
||||
// APIs.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
public var _kvcKeyPathString: String? {
|
||||
guard let ptr = _kvcKeyPathStringPtr else { return nil }
|
||||
|
||||
@@ -124,21 +118,15 @@ public class AnyKeyPath: Hashable, _AppendKeyPath {
|
||||
|
||||
// Prevent normal initialization. We use tail allocation via
|
||||
// allocWithTailElems().
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal init() {
|
||||
_sanityCheckFailure("use _create(...)")
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
deinit {}
|
||||
|
||||
// internal-with-availability
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
public class var _rootAndValueType: (root: Any.Type, value: Any.Type) {
|
||||
@usableFromInline
|
||||
internal class var _rootAndValueType: (root: Any.Type, value: Any.Type) {
|
||||
_abstract()
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
public // @testable
|
||||
static func _create(
|
||||
capacityInBytes bytes: Int,
|
||||
@@ -155,7 +143,6 @@ public class AnyKeyPath: Hashable, _AppendKeyPath {
|
||||
return result
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func withBuffer<T>(_ f: (KeyPathBuffer) throws -> T) rethrows -> T {
|
||||
defer { _fixLifetime(self) }
|
||||
|
||||
@@ -163,7 +150,7 @@ public class AnyKeyPath: Hashable, _AppendKeyPath {
|
||||
return try f(KeyPathBuffer(base: base))
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@usableFromInline // Exposed as public API by MemoryLayout<Root>.offset(of:)
|
||||
internal var _storedInlineOffset: Int? {
|
||||
return withBuffer {
|
||||
var buffer = $0
|
||||
@@ -186,22 +173,15 @@ public class AnyKeyPath: Hashable, _AppendKeyPath {
|
||||
|
||||
/// A partially type-erased key path, from a concrete root type to any
|
||||
/// resulting value type.
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
public class PartialKeyPath<Root>: AnyKeyPath { }
|
||||
|
||||
// MARK: Concrete implementations
|
||||
@_frozen // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal enum KeyPathKind { case readOnly, value, reference }
|
||||
|
||||
/// A key path from a specific root type to a specific resulting value type.
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
public class KeyPath<Root, Value>: PartialKeyPath<Root> {
|
||||
public typealias _Root = Root
|
||||
public typealias _Value = Value
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
public final override class var _rootAndValueType: (
|
||||
@usableFromInline
|
||||
internal final override class var _rootAndValueType: (
|
||||
root: Any.Type,
|
||||
value: Any.Type
|
||||
) {
|
||||
@@ -209,12 +189,9 @@ public class KeyPath<Root, Value>: PartialKeyPath<Root> {
|
||||
}
|
||||
|
||||
// MARK: Implementation
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias Kind = KeyPathKind
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal class var kind: Kind { return .readOnly }
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static func appendedType<AppendedValue>(
|
||||
with t: KeyPath<Value, AppendedValue>.Type
|
||||
) -> KeyPath<Root, AppendedValue>.Type {
|
||||
@@ -238,7 +215,7 @@ public class KeyPath<Root, Value>: PartialKeyPath<Root> {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@usableFromInline
|
||||
internal final func projectReadOnly(from root: Root) -> Value {
|
||||
// TODO: For perf, we could use a local growable buffer instead of Any
|
||||
var curBase: Any = root
|
||||
@@ -277,23 +254,20 @@ public class KeyPath<Root, Value>: PartialKeyPath<Root> {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
deinit {
|
||||
withBuffer { $0.destroy() }
|
||||
}
|
||||
}
|
||||
|
||||
/// A key path that supports reading from and writing to the resulting value.
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
public class WritableKeyPath<Root, Value>: KeyPath<Root, Value> {
|
||||
// MARK: Implementation detail
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal override class var kind: Kind { return .value }
|
||||
|
||||
// `base` is assumed to be undergoing a formal access for the duration of the
|
||||
// call, so must not be mutated by an alias
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@usableFromInline
|
||||
internal func projectMutableAddress(from base: UnsafePointer<Root>)
|
||||
-> (pointer: UnsafeMutablePointer<Value>, owner: AnyObject?) {
|
||||
var p = UnsafeRawPointer(base)
|
||||
@@ -338,16 +312,13 @@ public class WritableKeyPath<Root, Value>: KeyPath<Root, Value> {
|
||||
|
||||
/// A key path that supports reading from and writing to the resulting value
|
||||
/// with reference semantics.
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
public class ReferenceWritableKeyPath<
|
||||
Root, Value
|
||||
> : WritableKeyPath<Root, Value> {
|
||||
// MARK: Implementation detail
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal final override class var kind: Kind { return .reference }
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal final override func projectMutableAddress(
|
||||
from base: UnsafePointer<Root>
|
||||
) -> (pointer: UnsafeMutablePointer<Value>, owner: AnyObject?) {
|
||||
@@ -356,7 +327,7 @@ public class ReferenceWritableKeyPath<
|
||||
return projectMutableAddress(from: base.pointee)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@usableFromInline
|
||||
internal final func projectMutableAddress(from origBase: Root)
|
||||
-> (pointer: UnsafeMutablePointer<Value>, owner: AnyObject?) {
|
||||
var keepAlive: AnyObject?
|
||||
@@ -420,8 +391,6 @@ public class ReferenceWritableKeyPath<
|
||||
|
||||
// MARK: Implementation details
|
||||
|
||||
@_frozen // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal enum KeyPathComponentKind {
|
||||
/// The keypath references an externally-defined property or subscript whose
|
||||
/// component describes how to interact with the key path.
|
||||
@@ -444,24 +413,17 @@ internal enum KeyPathComponentKind {
|
||||
case optionalWrap
|
||||
}
|
||||
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal struct ComputedPropertyID: Hashable {
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal init(value: Int, isStoredProperty: Bool, isTableOffset: Bool) {
|
||||
self.value = value
|
||||
self.isStoredProperty = isStoredProperty
|
||||
self.isTableOffset = isTableOffset
|
||||
}
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var value: Int
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var isStoredProperty: Bool
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var isTableOffset: Bool
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static func ==(
|
||||
x: ComputedPropertyID, y: ComputedPropertyID
|
||||
) -> Bool {
|
||||
@@ -470,7 +432,6 @@ internal struct ComputedPropertyID: Hashable {
|
||||
&& x.isTableOffset == x.isTableOffset
|
||||
}
|
||||
|
||||
@inlinable
|
||||
internal func hash(into hasher: inout Hasher) {
|
||||
hasher.combine(value)
|
||||
hasher.combine(isStoredProperty)
|
||||
@@ -478,45 +439,30 @@ internal struct ComputedPropertyID: Hashable {
|
||||
}
|
||||
}
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
internal struct ComputedArgumentWitnesses {
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias Destroy = @convention(thin)
|
||||
(_ instanceArguments: UnsafeMutableRawPointer, _ size: Int) -> ()
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias Copy = @convention(thin)
|
||||
(_ srcInstanceArguments: UnsafeRawPointer,
|
||||
_ destInstanceArguments: UnsafeMutableRawPointer,
|
||||
_ size: Int) -> ()
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias Equals = @convention(thin)
|
||||
(_ xInstanceArguments: UnsafeRawPointer,
|
||||
_ yInstanceArguments: UnsafeRawPointer,
|
||||
_ size: Int) -> Bool
|
||||
// FIXME(hasher) Combine to an inout Hasher instead
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias Hash = @convention(thin)
|
||||
(_ instanceArguments: UnsafeRawPointer,
|
||||
_ size: Int) -> Int
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let destroy: Destroy?
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let copy: Copy
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let equals: Equals
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let hash: Hash
|
||||
}
|
||||
|
||||
@_frozen // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal enum KeyPathComponent: Hashable {
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal struct ArgumentRef {
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal init(
|
||||
data: UnsafeRawBufferPointer,
|
||||
witnesses: UnsafePointer<ComputedArgumentWitnesses>
|
||||
@@ -525,9 +471,7 @@ internal enum KeyPathComponent: Hashable {
|
||||
self.witnesses = witnesses
|
||||
}
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var data: UnsafeRawBufferPointer
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var witnesses: UnsafePointer<ComputedArgumentWitnesses>
|
||||
}
|
||||
|
||||
@@ -559,7 +503,6 @@ internal enum KeyPathComponent: Hashable {
|
||||
/// The keypath wraps a value in an optional.
|
||||
case optionalWrap
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static func ==(a: KeyPathComponent, b: KeyPathComponent) -> Bool {
|
||||
switch (a, b) {
|
||||
case (.struct(offset: let a), .struct(offset: let b)),
|
||||
@@ -651,27 +594,20 @@ internal enum KeyPathComponent: Hashable {
|
||||
// A class that maintains ownership of another object while a mutable projection
|
||||
// into it is underway. The lifetime of the instance of this class is also used
|
||||
// to begin and end exclusive 'modify' access to the projected address.
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal final class ClassHolder<ProjectionType> {
|
||||
|
||||
/// The type of the scratch record passed to the runtime to record
|
||||
/// accesses to guarantee exlcusive access.
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias AccessRecord = Builtin.UnsafeValueBuffer
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var previous: AnyObject?
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var instance: AnyObject
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal init(previous: AnyObject?, instance: AnyObject) {
|
||||
self.previous = previous
|
||||
self.instance = instance
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal final class func _create(
|
||||
previous: AnyObject?,
|
||||
instance: AnyObject,
|
||||
@@ -708,7 +644,6 @@ internal final class ClassHolder<ProjectionType> {
|
||||
return holder
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
deinit {
|
||||
let accessRecordPtr = Builtin.projectTailElems(self, AccessRecord.self)
|
||||
|
||||
@@ -718,30 +653,19 @@ internal final class ClassHolder<ProjectionType> {
|
||||
}
|
||||
|
||||
// A class that triggers writeback to a pointer when destroyed.
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal final class MutatingWritebackBuffer<CurValue, NewValue> {
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let previous: AnyObject?
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let base: UnsafeMutablePointer<CurValue>
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let set: @convention(thin) (NewValue, inout CurValue, UnsafeRawPointer, Int) -> ()
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let argument: UnsafeRawPointer
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let argumentSize: Int
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var value: NewValue
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
deinit {
|
||||
set(value, &base.pointee, argument, argumentSize)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal
|
||||
init(previous: AnyObject?,
|
||||
internal init(previous: AnyObject?,
|
||||
base: UnsafeMutablePointer<CurValue>,
|
||||
set: @escaping @convention(thin) (NewValue, inout CurValue, UnsafeRawPointer, Int) -> (),
|
||||
argument: UnsafeRawPointer,
|
||||
@@ -757,28 +681,18 @@ internal final class MutatingWritebackBuffer<CurValue, NewValue> {
|
||||
}
|
||||
|
||||
// A class that triggers writeback to a non-mutated value when destroyed.
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal final class NonmutatingWritebackBuffer<CurValue, NewValue> {
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let previous: AnyObject?
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let base: CurValue
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let set: @convention(thin) (NewValue, CurValue, UnsafeRawPointer, Int) -> ()
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let argument: UnsafeRawPointer
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal let argumentSize: Int
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var value: NewValue
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
deinit {
|
||||
set(value, base, argument, argumentSize)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal
|
||||
init(previous: AnyObject?,
|
||||
base: CurValue,
|
||||
@@ -795,129 +709,95 @@ internal final class NonmutatingWritebackBuffer<CurValue, NewValue> {
|
||||
}
|
||||
}
|
||||
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal struct RawKeyPathComponent {
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal init(header: Header, body: UnsafeRawBufferPointer) {
|
||||
self.header = header
|
||||
self.body = body
|
||||
}
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var header: Header
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var body: UnsafeRawBufferPointer
|
||||
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal struct Header {
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var payloadMask: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_PayloadMask
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var discriminatorMask: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_DiscriminatorMask
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var discriminatorShift: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_DiscriminatorShift
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var externalTag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ExternalTag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var structTag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_StructTag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedTag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedTag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var classTag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ClassTag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var optionalTag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_OptionalTag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var optionalChainPayload: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_OptionalChainPayload
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var optionalWrapPayload: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_OptionalWrapPayload
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var optionalForcePayload: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_OptionalForcePayload
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var endOfReferencePrefixFlag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_EndOfReferencePrefixFlag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var outOfLineOffsetPayload: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_OutOfLineOffsetPayload
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var unresolvedFieldOffsetPayload: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_UnresolvedFieldOffsetPayload
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var unresolvedIndirectOffsetPayload: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_UnresolvedIndirectOffsetPayload
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var maximumOffsetPayload: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_MaximumOffsetPayload
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedMutatingFlag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedMutatingFlag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedSettableFlag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedSettableFlag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedIDByStoredPropertyFlag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedIDByStoredPropertyFlag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedIDByVTableOffsetFlag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedIDByVTableOffsetFlag
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedHasArgumentsFlag: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedHasArgumentsFlag
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedIDResolutionMask: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedIDResolutionMask
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedIDResolved: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedIDResolved
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var computedIDUnresolvedIndirectPointer: UInt32 {
|
||||
return _SwiftKeyPathComponentHeader_ComputedIDUnresolvedIndirectPointer
|
||||
}
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var _value: UInt32
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var discriminator: UInt32 {
|
||||
return (_value & Header.discriminatorMask) >> Header.discriminatorShift
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var payload: UInt32 {
|
||||
get {
|
||||
return _value & Header.payloadMask
|
||||
@@ -928,7 +808,6 @@ internal struct RawKeyPathComponent {
|
||||
_value = _value & ~Header.payloadMask | newValue
|
||||
}
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var endOfReferencePrefix: Bool {
|
||||
get {
|
||||
return _value & Header.endOfReferencePrefixFlag != 0
|
||||
@@ -942,7 +821,6 @@ internal struct RawKeyPathComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var kind: KeyPathComponentKind {
|
||||
switch (discriminator, payload) {
|
||||
case (Header.externalTag, _):
|
||||
@@ -966,12 +844,10 @@ internal struct RawKeyPathComponent {
|
||||
|
||||
// The component header is 4 bytes, but may be followed by an aligned
|
||||
// pointer field for some kinds of component, forcing padding.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal static var pointerAlignmentSkew: Int {
|
||||
return MemoryLayout<Int>.size - MemoryLayout<Int32>.size
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var isTrivialPropertyDescriptor: Bool {
|
||||
return _value ==
|
||||
_SwiftKeyPathComponentHeader_TrivialPropertyDescriptorMarker
|
||||
@@ -979,7 +855,6 @@ internal struct RawKeyPathComponent {
|
||||
|
||||
/// If this is the header for a component in a key path pattern, return
|
||||
/// the size of the body of the component.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var patternComponentBodySize: Int {
|
||||
switch kind {
|
||||
case .struct, .class:
|
||||
@@ -1024,7 +899,6 @@ internal struct RawKeyPathComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var bodySize: Int {
|
||||
let ptrSize = MemoryLayout<Int>.size
|
||||
switch header.kind {
|
||||
@@ -1055,7 +929,6 @@ internal struct RawKeyPathComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _structOrClassOffset: Int {
|
||||
_sanityCheck(header.kind == .struct || header.kind == .class,
|
||||
"no offset for this kind")
|
||||
@@ -1070,7 +943,6 @@ internal struct RawKeyPathComponent {
|
||||
return Int(header.payload)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _computedIDValue: Int {
|
||||
_sanityCheck(header.kind == .computed,
|
||||
"not a computed property")
|
||||
@@ -1078,7 +950,6 @@ internal struct RawKeyPathComponent {
|
||||
as: Int.self)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _computedID: ComputedPropertyID {
|
||||
let payload = header.payload
|
||||
return ComputedPropertyID(
|
||||
@@ -1087,7 +958,6 @@ internal struct RawKeyPathComponent {
|
||||
isTableOffset: payload & Header.computedIDByVTableOffsetFlag != 0)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _computedGetter: UnsafeRawPointer {
|
||||
_sanityCheck(header.kind == .computed,
|
||||
"not a computed property")
|
||||
@@ -1097,7 +967,6 @@ internal struct RawKeyPathComponent {
|
||||
as: UnsafeRawPointer.self)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _computedSetter: UnsafeRawPointer {
|
||||
_sanityCheck(header.kind == .computed,
|
||||
"not a computed property")
|
||||
@@ -1109,15 +978,12 @@ internal struct RawKeyPathComponent {
|
||||
as: UnsafeRawPointer.self)
|
||||
}
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias ComputedArgumentLayoutFn = @convention(thin)
|
||||
(_ patternArguments: UnsafeRawPointer) -> (size: Int, alignmentMask: Int)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias ComputedArgumentInitializerFn = @convention(thin)
|
||||
(_ patternArguments: UnsafeRawPointer,
|
||||
_ instanceArguments: UnsafeMutableRawPointer) -> ()
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _computedArgumentHeaderPointer: UnsafeRawPointer {
|
||||
_sanityCheck(header.kind == .computed,
|
||||
"not a computed property")
|
||||
@@ -1130,11 +996,9 @@ internal struct RawKeyPathComponent {
|
||||
(header.payload & Header.computedSettableFlag != 0 ? 3 : 2)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _computedArgumentSize: Int {
|
||||
return _computedArgumentHeaderPointer.load(as: Int.self)
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal
|
||||
var _computedArgumentWitnesses: UnsafePointer<ComputedArgumentWitnesses> {
|
||||
return _computedArgumentHeaderPointer.load(
|
||||
@@ -1142,16 +1006,13 @@ internal struct RawKeyPathComponent {
|
||||
as: UnsafePointer<ComputedArgumentWitnesses>.self)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _computedArguments: UnsafeRawPointer {
|
||||
return _computedArgumentHeaderPointer + MemoryLayout<Int>.size * 2
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var _computedMutableArguments: UnsafeMutableRawPointer {
|
||||
return UnsafeMutableRawPointer(mutating: _computedArguments)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var value: KeyPathComponent {
|
||||
switch header.kind {
|
||||
case .struct:
|
||||
@@ -1203,7 +1064,6 @@ internal struct RawKeyPathComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func destroy() {
|
||||
switch header.kind {
|
||||
case .struct,
|
||||
@@ -1224,7 +1084,6 @@ internal struct RawKeyPathComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func clone(into buffer: inout UnsafeMutableRawBufferPointer,
|
||||
endOfReferencePrefix: Bool) {
|
||||
var newHeader = header
|
||||
@@ -1289,8 +1148,6 @@ internal struct RawKeyPathComponent {
|
||||
count: buffer.count - componentSize)
|
||||
}
|
||||
|
||||
@_frozen // FIXME(sil-serialize-all)
|
||||
@usableFromInline
|
||||
internal enum ProjectionResult<NewValue, LeafValue> {
|
||||
/// Continue projecting the key path with the given new value.
|
||||
case `continue`(NewValue)
|
||||
@@ -1298,7 +1155,6 @@ internal struct RawKeyPathComponent {
|
||||
/// result of the projection.
|
||||
case `break`(LeafValue)
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var assumingContinue: NewValue {
|
||||
switch self {
|
||||
case .continue(let x):
|
||||
@@ -1309,7 +1165,6 @@ internal struct RawKeyPathComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func projectReadOnly<CurValue, NewValue, LeafValue>(
|
||||
_ base: CurValue,
|
||||
to: NewValue.Type,
|
||||
@@ -1379,7 +1234,6 @@ internal struct RawKeyPathComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func projectMutableAddress<CurValue, NewValue>(
|
||||
_ base: UnsafeRawPointer,
|
||||
from _: CurValue.Type,
|
||||
@@ -1480,45 +1334,31 @@ internal struct RawKeyPathComponent {
|
||||
}
|
||||
}
|
||||
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal struct KeyPathBuffer {
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var data: UnsafeRawBufferPointer
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var trivial: Bool
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var hasReferencePrefix: Bool
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var mutableData: UnsafeMutableRawBufferPointer {
|
||||
return UnsafeMutableRawBufferPointer(mutating: data)
|
||||
}
|
||||
|
||||
@_fixed_layout // FIXME(sil-serialize-all)
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal struct Header {
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal var _value: UInt32
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal static var sizeMask: UInt32 {
|
||||
return _SwiftKeyPathBufferHeader_SizeMask
|
||||
}
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal static var reservedMask: UInt32 {
|
||||
return _SwiftKeyPathBufferHeader_ReservedMask
|
||||
}
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal static var trivialFlag: UInt32 {
|
||||
return _SwiftKeyPathBufferHeader_TrivialFlag
|
||||
}
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal static var hasReferencePrefixFlag: UInt32 {
|
||||
return _SwiftKeyPathBufferHeader_HasReferencePrefixFlag
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal init(size: Int, trivial: Bool, hasReferencePrefix: Bool) {
|
||||
_sanityCheck(size <= Int(Header.sizeMask), "key path too big")
|
||||
_value = UInt32(size)
|
||||
@@ -1526,11 +1366,8 @@ internal struct KeyPathBuffer {
|
||||
| (hasReferencePrefix ? Header.hasReferencePrefixFlag : 0)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var size: Int { return Int(_value & Header.sizeMask) }
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var trivial: Bool { return _value & Header.trivialFlag != 0 }
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var hasReferencePrefix: Bool {
|
||||
get {
|
||||
return _value & Header.hasReferencePrefixFlag != 0
|
||||
@@ -1546,19 +1383,16 @@ internal struct KeyPathBuffer {
|
||||
|
||||
// In a key path pattern, the "trivial" flag is used to indicate
|
||||
// "instantiable in-line"
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var instantiableInLine: Bool {
|
||||
return trivial
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func validateReservedBits() {
|
||||
_precondition(_value & Header.reservedMask == 0,
|
||||
"Reserved bits set to an unexpected bit pattern")
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal init(base: UnsafeRawPointer) {
|
||||
let header = base.load(as: Header.self)
|
||||
data = UnsafeRawBufferPointer(
|
||||
@@ -1568,7 +1402,6 @@ internal struct KeyPathBuffer {
|
||||
hasReferencePrefix = header.hasReferencePrefix
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal init(partialData: UnsafeRawBufferPointer,
|
||||
trivial: Bool = false,
|
||||
hasReferencePrefix: Bool = false) {
|
||||
@@ -1577,7 +1410,6 @@ internal struct KeyPathBuffer {
|
||||
self.hasReferencePrefix = hasReferencePrefix
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func destroy() {
|
||||
// Short-circuit if nothing in the object requires destruction.
|
||||
if trivial { return }
|
||||
@@ -1590,7 +1422,6 @@ internal struct KeyPathBuffer {
|
||||
}
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal mutating func next() -> (RawKeyPathComponent, Any.Type?) {
|
||||
let header = pop(RawKeyPathComponent.Header.self)
|
||||
// Track if this is the last component of the reference prefix.
|
||||
@@ -1617,7 +1448,6 @@ internal struct KeyPathBuffer {
|
||||
return (component, nextType)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal mutating func pop<T>(_ type: T.Type) -> T {
|
||||
_sanityCheck(_isPOD(T.self), "should be POD")
|
||||
let raw = popRaw(size: MemoryLayout<T>.size,
|
||||
@@ -1630,9 +1460,9 @@ internal struct KeyPathBuffer {
|
||||
resultBuf.deallocate()
|
||||
return result
|
||||
}
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal
|
||||
mutating func popRaw(size: Int, alignment: Int) -> UnsafeRawBufferPointer {
|
||||
internal mutating func popRaw(
|
||||
size: Int, alignment: Int
|
||||
) -> UnsafeRawBufferPointer {
|
||||
var baseAddress = data.baseAddress.unsafelyUnwrapped
|
||||
var misalignment = Int(bitPattern: baseAddress) % alignment
|
||||
if misalignment != 0 {
|
||||
@@ -1684,7 +1514,7 @@ func _projectKeyPathAny<RootValue>(
|
||||
return _openExistential(keyPathRoot, do: openRoot)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public // COMPILER_INTRINSIC
|
||||
func _projectKeyPathReadOnly<Root, Value>(
|
||||
root: Root,
|
||||
@@ -1693,7 +1523,7 @@ func _projectKeyPathReadOnly<Root, Value>(
|
||||
return keyPath.projectReadOnly(from: root)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public // COMPILER_INTRINSIC
|
||||
func _projectKeyPathWritable<Root, Value>(
|
||||
root: UnsafeMutablePointer<Root>,
|
||||
@@ -1702,7 +1532,7 @@ func _projectKeyPathWritable<Root, Value>(
|
||||
return keyPath.projectMutableAddress(from: root)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public // COMPILER_INTRINSIC
|
||||
func _projectKeyPathReferenceWritable<Root, Value>(
|
||||
root: Root,
|
||||
@@ -1752,7 +1582,7 @@ extension _AppendKeyPath where Self == AnyKeyPath {
|
||||
/// - Returns: A key path from the root of this key path and the value type
|
||||
/// of `path`, if `path` can be appended. If `path` can't be appended,
|
||||
/// returns `nil`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending(path: AnyKeyPath) -> AnyKeyPath? {
|
||||
return _tryToAppendKeyPaths(root: self, leaf: path)
|
||||
}
|
||||
@@ -1785,7 +1615,7 @@ extension _AppendKeyPath /* where Self == PartialKeyPath<T> */ {
|
||||
/// - Returns: A key path from the root of this key path and the value type
|
||||
/// of `path`, if `path` can be appended. If `path` can't be appended,
|
||||
/// returns `nil`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending<Root>(path: AnyKeyPath) -> PartialKeyPath<Root>?
|
||||
where Self == PartialKeyPath<Root> {
|
||||
return _tryToAppendKeyPaths(root: self, leaf: path)
|
||||
@@ -1816,7 +1646,7 @@ extension _AppendKeyPath /* where Self == PartialKeyPath<T> */ {
|
||||
/// - Returns: A key path from the root of this key path to the value type
|
||||
/// of `path`, if `path` can be appended. If `path` can't be appended,
|
||||
/// returns `nil`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending<Root, AppendedRoot, AppendedValue>(
|
||||
path: KeyPath<AppendedRoot, AppendedValue>
|
||||
) -> KeyPath<Root, AppendedValue>?
|
||||
@@ -1835,7 +1665,7 @@ extension _AppendKeyPath /* where Self == PartialKeyPath<T> */ {
|
||||
/// - Returns: A key path from the root of this key path to the value type
|
||||
/// of `path`, if `path` can be appended. If `path` can't be appended,
|
||||
/// returns `nil`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending<Root, AppendedRoot, AppendedValue>(
|
||||
path: ReferenceWritableKeyPath<AppendedRoot, AppendedValue>
|
||||
) -> ReferenceWritableKeyPath<Root, AppendedValue>?
|
||||
@@ -1861,7 +1691,7 @@ extension _AppendKeyPath /* where Self == KeyPath<T,U> */ {
|
||||
/// - Parameter path: The key path to append.
|
||||
/// - Returns: A key path from the root of this key path to the value type of
|
||||
/// `path`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending<Root, Value, AppendedValue>(
|
||||
path: KeyPath<Value, AppendedValue>
|
||||
) -> KeyPath<Root, AppendedValue>
|
||||
@@ -1890,7 +1720,7 @@ extension _AppendKeyPath /* where Self == KeyPath<T,U> */ {
|
||||
/// - Parameter path: The key path to append.
|
||||
/// - Returns: A key path from the root of this key path to the value type of
|
||||
/// `path`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending<Root, Value, AppendedValue>(
|
||||
path: ReferenceWritableKeyPath<Value, AppendedValue>
|
||||
) -> ReferenceWritableKeyPath<Root, AppendedValue>
|
||||
@@ -1910,7 +1740,7 @@ extension _AppendKeyPath /* where Self == WritableKeyPath<T,U> */ {
|
||||
/// - Parameter path: The key path to append.
|
||||
/// - Returns: A key path from the root of this key path to the value type of
|
||||
/// `path`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending<Root, Value, AppendedValue>(
|
||||
path: WritableKeyPath<Value, AppendedValue>
|
||||
) -> WritableKeyPath<Root, AppendedValue>
|
||||
@@ -1928,7 +1758,7 @@ extension _AppendKeyPath /* where Self == WritableKeyPath<T,U> */ {
|
||||
/// - Parameter path: The key path to append.
|
||||
/// - Returns: A key path from the root of this key path to the value type of
|
||||
/// `path`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending<Root, Value, AppendedValue>(
|
||||
path: ReferenceWritableKeyPath<Value, AppendedValue>
|
||||
) -> ReferenceWritableKeyPath<Root, AppendedValue>
|
||||
@@ -1948,7 +1778,7 @@ extension _AppendKeyPath /* where Self == ReferenceWritableKeyPath<T,U> */ {
|
||||
/// - Parameter path: The key path to append.
|
||||
/// - Returns: A key path from the root of this key path to the value type of
|
||||
/// `path`.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@inlinable
|
||||
public func appending<Root, Value, AppendedValue>(
|
||||
path: WritableKeyPath<Value, AppendedValue>
|
||||
) -> ReferenceWritableKeyPath<Root, AppendedValue>
|
||||
@@ -1957,9 +1787,8 @@ extension _AppendKeyPath /* where Self == ReferenceWritableKeyPath<T,U> */ {
|
||||
}
|
||||
}
|
||||
|
||||
// internal-with-availability
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
public func _tryToAppendKeyPaths<Result: AnyKeyPath>(
|
||||
@usableFromInline
|
||||
internal func _tryToAppendKeyPaths<Result: AnyKeyPath>(
|
||||
root: AnyKeyPath,
|
||||
leaf: AnyKeyPath
|
||||
) -> Result? {
|
||||
@@ -1986,9 +1815,8 @@ public func _tryToAppendKeyPaths<Result: AnyKeyPath>(
|
||||
return _openExistential(rootRoot, do: open)
|
||||
}
|
||||
|
||||
// internal-with-availability
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
public func _appendingKeyPaths<
|
||||
@usableFromInline
|
||||
internal func _appendingKeyPaths<
|
||||
Root, Value, AppendedValue,
|
||||
Result: KeyPath<Root, AppendedValue>
|
||||
>(
|
||||
@@ -2150,13 +1978,11 @@ public func _appendingKeyPaths<
|
||||
// buffer header. Includes the size of the Swift heap object header and the
|
||||
// pointer to the KVC string.
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal var keyPathObjectHeaderSize: Int {
|
||||
return MemoryLayout<HeapObject>.size + MemoryLayout<Int>.size
|
||||
}
|
||||
|
||||
// Runtime entry point to instantiate a key path object.
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
@_cdecl("swift_getKeyPath")
|
||||
public func _swift_getKeyPath(pattern: UnsafeMutableRawPointer,
|
||||
arguments: UnsafeRawPointer)
|
||||
@@ -2205,7 +2031,6 @@ public func _swift_getKeyPath(pattern: UnsafeMutableRawPointer,
|
||||
return _getKeyPath_instantiatedOutOfLine(patternPtr, arguments)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func _getKeyPath_instantiatedOutOfLine(
|
||||
_ pattern: UnsafeRawPointer,
|
||||
_ arguments: UnsafeRawPointer)
|
||||
@@ -2234,7 +2059,6 @@ internal func _getKeyPath_instantiatedOutOfLine(
|
||||
return UnsafeRawPointer(Unmanaged.passRetained(instance).toOpaque())
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func _getKeyPath_instantiateInline(
|
||||
_ objectRawPtr: Builtin.RawPointer
|
||||
) {
|
||||
@@ -2271,11 +2095,9 @@ internal func _getKeyPath_instantiateInline(
|
||||
unsafeBitCast(keyPathClass, to: OpaquePointer.self))
|
||||
}
|
||||
|
||||
@usableFromInline // FIXME(sil-serialize-all)
|
||||
internal typealias MetadataAccessor =
|
||||
@convention(c) (UnsafeRawPointer) -> UnsafeRawPointer
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func _getKeyPathClassAndInstanceSizeFromPattern(
|
||||
_ pattern: UnsafeRawPointer,
|
||||
_ arguments: UnsafeRawPointer
|
||||
@@ -2566,7 +2388,6 @@ internal func _getKeyPathClassAndInstanceSizeFromPattern(
|
||||
size: size, alignmentMask: alignmentMask)
|
||||
}
|
||||
|
||||
@inlinable // FIXME(sil-serialize-all)
|
||||
internal func _instantiateKeyPathBuffer(
|
||||
_ origPatternBuffer: KeyPathBuffer,
|
||||
_ origDestData: UnsafeMutableRawBufferPointer,
|
||||
|
||||
Reference in New Issue
Block a user