@@ -615,41 +615,6 @@ internal enum KeyPathComponent: Hashable {
615615 }
616616}
617617
618- // _semantics("optimize.sil.preserve_exclusivity" forces the compiler to
619- // generate access markers regardless of the current build settings. This way,
620- // user code that accesses keypaths are properly enforced even if the standard
621- // library has exclusivity checking internally disabled. The semantic attribute
622- // must be consistently applied to both the begin and end unpaired access
623- // markers, otherwise the runtime will fail catastrophically and unpredictably.
624- // This relies on Swift module serialization occurring before these _semantic
625- // function are inlined, since inlining would unpredictably cause the attribute
626- // to be dropped.
627- //
628- // An exclusivity violation will report the caller's stack frame location.
629- // Runtime diagnostics will be improved by inlining this function. However, this
630- // cannot be marked @transparent because it can't be inlined prior to
631- // serialization.
632- @inlinable
633- @inline ( __always)
634- @_semantics ( " optimize.sil.preserve_exclusivity " )
635- func beginAccessHelper< T> ( _ address: Builtin . RawPointer , _ accessRecordPtr: Builtin . RawPointer , _ type: T . Type ) {
636- Builtin . beginUnpairedModifyAccess ( address, accessRecordPtr, type)
637- }
638-
639- @inlinable
640- @inline ( __always)
641- @_semantics ( " optimize.sil.preserve_exclusivity " )
642- func endAccessHelper( _ accessRecordPtr: Builtin . RawPointer ) {
643- Builtin . endUnpairedAccess ( accessRecordPtr)
644- }
645-
646- @inlinable
647- @inline ( __always)
648- @_semantics ( " optimize.sil.preserve_exclusivity " )
649- func instantaneousAccessHelper< T> ( _ address: Builtin . RawPointer , _ type: T . Type ) {
650- Builtin . performInstantaneousReadAccess ( address, T . self)
651- }
652-
653618// A class that maintains ownership of another object while a mutable projection
654619// into it is underway. The lifetime of the instance of this class is also used
655620// to begin and end exclusive 'modify' access to the projected address.
@@ -704,7 +669,7 @@ internal final class ClassHolder<ProjectionType> {
704669
705670 // Begin a 'modify' access to the address. This access is ended in
706671 // ClassHolder's deinitializer.
707- beginAccessHelper ( address. _rawValue, accessRecordPtr, type)
672+ Builtin . beginUnpairedModifyAccess ( address. _rawValue, accessRecordPtr, type)
708673
709674 return holder
710675 }
@@ -714,7 +679,7 @@ internal final class ClassHolder<ProjectionType> {
714679 let accessRecordPtr = Builtin . projectTailElems ( self , AccessRecord . self)
715680
716681 // Ends the access begun in _create().
717- endAccessHelper ( accessRecordPtr)
682+ Builtin . endUnpairedAccess ( accessRecordPtr)
718683 }
719684}
720685
@@ -1265,7 +1230,8 @@ internal struct RawKeyPathComponent {
12651230 // Perform an instaneous record access on the address in order to
12661231 // ensure that the read will not conflict with an already in-progress
12671232 // 'modify' access.
1268- instantaneousAccessHelper ( offsetAddress. _rawValue, NewValue . self)
1233+ Builtin . performInstantaneousReadAccess ( offsetAddress. _rawValue,
1234+ NewValue . self)
12691235 return . continue( offsetAddress
12701236 . assumingMemoryBound ( to: NewValue . self)
12711237 . pointee)
0 commit comments