without relying on spare bit information in the reflection metadata
(which was added in #40906). As a result, we can remove the
code from #40906.
This is the first step in such removal. It removes the RemoteMirror
code for looking up such metadata. It leaves behind:
* Sufficient stubs for LLDB to continue to build. Once LLDB is updated, these stubs can be removed as well.
* The compiler code to emit such metadata. This allows new binaries to still reflect MPEs on older runtimes. This will need to be kept for a transitional period.
If the extension adds conformance to an invertible protocol, it's
confusing for people to also infer conditional requirements on the
generic parameters for those invertible protocols. This came up in the
review of SE-427.
And it is handled compatibly because all existing implementations must
have already implemented it before -- it was an ad-hoc requirement
before Swift 6.0, and now it has become a real requirement - the same as
all the other ad-hoc requirements relying on the Serialization
Requirement
It could be confusing to adopters who were led to believe by the types
that they should "just" implement the sharedUnownedExecutor property,
but insead they have to implement the unownedExecutor on the specific
actor type.
Adding documentation clarify this as well as a simple test that
exercises this explicitly; We seem to have much coverage of main actor,
but not so much of custom executor global actors.
Track the key argument index separately from the generic parameter index when performing the invertible protocol checking in _checkGenericRequirements. This keeps the indexing correct when a non-key argument is followed by a key argument.
rdar://128774651
Use of atomics instructions requires the support of threads proposal and
it's not widely supported yet. So we should enable actual atomic
operations only when targeting wasm32-uknown-wasip1-threads.
RemoteMirror gets called on lots of malformed type information,
due to memory corruption bugs or even clients that ask RemoteMirror
to decode a chunk of memory to test whether or not it might be
valid type data. In any case, we need to be a little cautious here.
In this case, I've chosen to ignore any enum whose in-memory size
(according to the metadata) is over 1 MiB. We can easily adjust
this limit up if experience shows there really are legitimate enums
this large in the wild.
If an Int type makes no sense (it has a nonsensical number
of extra inhabitants, for example), ignore it rather than
treating it as a non-Int type.
Rename `isIntType()` to `intTypeBitSize()` to better document
what this function actually returns.
MPE layout code to exclusively use the new code. The key observation: existing
reflection metadata seems to already provide enough information in all cases, so
we can abandon an earlier effort to add spare bitmask data.
Resolves rdar://129281368
This change fixes the following build error happening on Wasm:
```
error: referencing instance method '_wait(expected:)' on 'Atomic' requires the types '_MutexHandle.State' and 'UInt32' be equivalent
```