This function is used by the executor to help schedule the async job.
While not currently available on Windows on main, this allows correctly
handling the presence of the symbol for static linking.
This ranges between parity (for very small strings) and 5x faster (for
32-63B strings) in benchmarking on M1 MBP. For largeish strings it
delivers a roughly 2x speedup; further increase in blocksize nets a
small win in microbenchmarks that I do not expect would translate to
real world usage due to codesize impact and the fact that most strings
are smallish.
There's some opportunity for further work here; in particular, if people
start building Swift for a baseline of AVX2 or AVX512, we should have
paths for that (and we should also implement them if/when we get better
multiversioning dispatch machinery in the language). Span adoption would
be interesting. It's likely we should have a dedicated "small core"
implementation that uses only aligned accesses. Still, this is a
significant improvement as-is, and we should land it.

This change adds a new type of cache (cache by type descriptor) to the protocol conformance lookup system. This optimization is beneficial for generic types, where the
same conformance can be reused across different instantiations of the generic type.
Key changes:
- Add a `GetOrInsertManyScope` class to `ConcurrentReadableHashMap` for performing
multiple insertions under a single lock
- Add type descriptor-based caching for protocol conformances
- Add environment variables for controlling and debugging the conformance cache
- Add tests to verify the behavior of the conformance cache
- Fix for https://github.com/swiftlang/swift/issues/82889
The implementation is controlled by the `SWIFT_DEBUG_ENABLE_CACHE_PROTOCOL_CONFORMANCES_BY_TYPE_DESCRIPTOR`
environment variable, which is enabled by default.
In preparation for removal. This spelling of Task.immediate was before
SE-review and was NOT accepted and therefore we should try to remove it
entirely.
Add an extra opaque field to AddressSpace, which can be used by clients
of RemoteInspection to distinguish between different address spaces.
LLDB employs an optimization where it reads memory from files instead of
the running process whenever it can to speed up memory reads (these can
be slow when debugging something over a network). To do this, it needs
to keep track whether an address originated from a process or a file. It
currently distinguishes addresses by setting an unused high bit on the
address, but because of pointer authentication this is not a reliable
solution. In order to keep this optimization working, this patch adds an
extra opaque AddressSpace field to RemoteAddress, which LLDB can use on
its own implementation of MemoryReader to distinguish between addresses.
This patch is NFC for the other RemoteInspection clients, as it adds
extra information to RemoteAddress, which is entirely optional and if
unused should not change the behavior of the library.
Although this patch is quite big the changes are largely mechanical,
replacing threading StoredPointer with RemoteAddress.
rdar://148361743
Although we would like these to be dynamic, we currently cannot build
them properly due to limitations of the build system. Adjust the build
to pass in additional flags to properly build the runtimes for that
environment as a temporary measure.
- Move the definition of 'structured concurrency' to the beginning of
the section.
- Avoid future tense. Fix some mixed future+present tense errors.
- Write bullet points as individual sentences, not as the clauses of one
long sentence.
- Apple Style: Use 'since' only in the sense of 'after'.
- Apple Style: Use 'you' instead of 'one'.
- Apple Style: Close up 'non-' except when ambiguous.
- DevPubs style: Avoid bare 'this' for clarity. Here, 'this guarantee'
tells the reader what 'this' refers to.
- DevPubs style: Avoid 'may' which can be ambiguous between possibility
and permission.