Commit Graph

12 Commits

Author SHA1 Message Date
Dario Rexin
ec995e500f [Runtime] Add ccAttrs to slow path in compatibility overrides
rdar://145523626

This was accidentally dropped when introducing the slow path, which causes CC mismatches for functions
using custom CC.
2025-02-24 17:31:27 -08:00
Alastair Houghton
ab8e561583 Merge pull request #78516 from al45tair/eng/PR-124913332
[Backtracing] Implement API per SE-0419
2025-01-28 10:48:33 +00:00
Dario Rexin
96d5ed22db [Runtime] Improve performance and memory footprint of compatibility overrides
rdar://143401725

Replacing the (non-inlined) call to `swift_once` with a relaxed atomic significantly improves the generated code and reduces the memory footprint. The mechanism itself now does not cause a stack frame to be generated and the expected case (no override) should be perfectly predicted and executed in straight line code. The override case should also be well predicted, with only two branches on the same value.
2025-01-23 13:06:40 -08:00
Alastair Houghton
760cc57bef [Backtracing] Rename _Backtracing to Runtime.
Move the backtracing code into a new Runtime module.  This means renaming
the Swift Runtime's CMake target because otherwise there will be a name
clash.

rdar://124913332
2025-01-17 10:09:36 +00:00
Michael Gottesman
cb8e8b505a Fix syntax highlighting by changing how we include COMPATIBILITY_OVERRIDE_INCLUDE_PATH.
The way that we include COMPATIBILITY_OVERRIDE_INCLUDE_PATH freaks out the
syntax highlighting of editors like emacs. It causes the whole file to be
highlighted like it is part of the include string.

To work around this, this patch creates a separate file called
CompatibilityOverrideIncludePath.h that just includes
COMPATIBILITY_OVERRIDE_INCLUDE_PATH. So its syntax highlighting is borked, but
at least in the actual files that contain real code, the syntax highlighting is
restored.
2024-10-01 16:17:16 -07:00
Evan Wilde
f023bdeee9 Base override section names on swift version
This patch automates maintaining the right compatibility override
section names so we don't need to remember to update them by hand with
each version.

The expansions look like
'"__swift" "5" "9" "_hooks"' and
'"__s" "5" "9" "async_hook"'.

Note: The section names can only grow to be 16 characters long. If we
      see explosions regarding these names, that could be why.
2023-02-15 19:43:57 -08:00
John McCall
7f737d235d Synchronize with cancellation when removing a task from a task group
We were detaching the child by just modifying the list, but the cancellation path was assuming that that would not be done without holding the task status lock.

This patch just fixes the current runtime; the back-deployment side is complicated.

Fixes rdar://88398824
2022-10-29 00:10:28 -04:00
Doug Gregor
3c892a153c Update runtime compatibility hooks to version 5.8 2022-07-05 10:07:52 -07:00
Joey
74eccd3b3d Fix typo in CompatibilityOverride.h 2022-01-30 20:38:03 +08:00
Kuba Mracek
d441f85358 Rename SWIFT_ENABLE_COMPATIBILITY_OVERRIDES -> SWIFT_STDLIB_SUPPORT_BACK_DEPLOYMENT and avoid building more back-deployment stdlib parts when not set 2021-12-14 09:59:44 -08:00
Mishal Shah
afdae45cd2 Update the Swift runtime hooks version to 5.6 2021-10-05 16:46:31 -07:00
Mike Ash
6aab257c33 [Concurrency] Add compatibility overrides to Concurrency library.
Take the existing CompatibilityOverride mechanism and generalize it so it can be used in both the runtime and Concurrency libraries. The mechanism is preprocessor-heavy, so this requires some tricks. Use the SWIFT_TARGET_LIBRARY_NAME define to distinguish the libraries, and use a different .def file and mach-o section name accordingly.

We want the global/main executor functions to be a little more flexible. Instead of using the override mechanism, we expose function pointers that can be set by the compatibility library, or by any other code that wants to use a custom implementation.

rdar://73726764
2021-03-22 11:09:06 -04:00