Skip to content

Commit ea795a2

Browse files
authored
Merge pull request #17909 from lorentey/outline-arc-warmup
[stdlib] Make _stdlib_initializeReturnAutoreleased non-@inlinable
2 parents 6ecfe7a + cedfdae commit ea795a2

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

stdlib/public/core/Runtime.swift.gyb

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -544,31 +544,17 @@ open class _SwiftNativeNSData {
544544
// Support for reliable testing of the return-autoreleased optimization
545545
//===----------------------------------------------------------------------===//
546546

547-
@_fixed_layout // FIXME(sil-serialize-all)
548-
@usableFromInline // FIXME(sil-serialize-all)
549547
@objc
550548
internal class _stdlib_ReturnAutoreleasedDummy {
551-
@inlinable // FIXME(sil-serialize-all)
552549
@objc
553550
internal init() {}
554551

555-
@inlinable // FIXME(sil-serialize-all)
556-
deinit {}
557-
558552
// Use 'dynamic' to force Objective-C dispatch, which uses the
559553
// return-autoreleased call sequence.
560554
@objc
561555
internal dynamic func returnsAutoreleased(_ x: AnyObject) -> AnyObject {
562556
return x
563557
}
564-
565-
// Use 'dynamic' to prevent this call to be duplicated into other modules.
566-
@objc
567-
internal dynamic func initializeReturnAutoreleased() {
568-
// On x86_64 it is sufficient to perform one cycle of return-autoreleased
569-
// call sequence in order to initialize all required PLT entries.
570-
_ = self.returnsAutoreleased(self)
571-
}
572558
}
573559

574560
/// This function ensures that the return-autoreleased optimization works.
@@ -583,11 +569,12 @@ internal class _stdlib_ReturnAutoreleasedDummy {
583569
/// separate for each dylib.
584570
///
585571
/// Call this function in a fresh autorelease pool.
586-
@inlinable // FIXME(sil-serialize-all)
587572
public func _stdlib_initializeReturnAutoreleased() {
588-
// _stdlib_initializeReturnAutoreleasedImpl()
589573
#if arch(x86_64)
590-
_stdlib_ReturnAutoreleasedDummy().initializeReturnAutoreleased()
574+
// On x86_64 it is sufficient to perform one cycle of return-autoreleased
575+
// call sequence in order to initialize all required PLT entries.
576+
let dummy = _stdlib_ReturnAutoreleasedDummy()
577+
_ = dummy.returnsAutoreleased(dummy)
591578
#endif
592579
}
593580
#else

0 commit comments

Comments
 (0)