Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] swiftwasm from main #5272

Merged
merged 67 commits into from
Feb 8, 2023
Merged

[pull] swiftwasm from main #5272

merged 67 commits into from
Feb 8, 2023

Conversation

pull[bot]
Copy link

@pull pull bot commented Feb 8, 2023

See Commits and Changes for more details.


Created by pull[bot]

Can you help keep this open source service alive? 💖 Please sponsor : )

etcwilde and others added 30 commits January 19, 2023 14:37
This patch replaces the platform version check with a dlsym to grab the
symbol we need. If we're on a new enough platform, the symbol should be
available and we can use it. Otherwise, it will be empty and we should
return true. This breaks the link requirement for the platform version
symbol.
I seem to have copied over the wrong version of Task.h. There is an ABI
mismatch in the size of AsyncContext due to the removal of Flags. This
resulted in programs crashing when running against the backdeploy
library and should have crashed when running on the swift 5.6 runtime.

The successResultPointer pointer was set in AsyncTask::waitFuture, but
with the wrong layout. When the pointer was read in the concurrency
backdeploy library, it was at a different offset, and thus contained a
nullptr.

I pulled the AsyncContextKind and AsyncContextFlags from the old
MetadataValues.h into Task.h as they were removed in commit
aca744b, but are necessary with the
flags included.
The 5.5/5.6 concurrency runtime in the concurrency backdeploy library
just doesn't have the pieces necessary to emit the desired error
message. Disabling it in that environment.
Commit afc5116 added the support to track re-used continuations.
The threading library changed in the BackDeployConcurrency library
resulting in the `SWIFT_TASK_DEBUG_LOG` macro not compiling. Fixing
that. Also adding the logging pieces to the Compatibility 56 library.
Apparently `-fvisibility=hidden` is not sufficient to hide some of the
symbols in this library. I've explicitly marked the symbols that were
flagged as being incorrectly exported as "hidden" so hopefully no one
drags them out again.

This is a statically linked library, so the symbols shouldn't need to be
exported for this work work. To ensure that this is the case and that
we're still hitting the overridden API with all of the hidden symbols, I
added a debug log line to the fixed `AsyncTask::waitFuture`
implementation and have verified that we see the compat56 log message
emitted from executables that need the compat56 library.
…mporting class templates syntactically but not semantically
This ensures that our interface do not reference already instantiated and imported specializations.
This PR changes the casting machinery to avoid casting `__SwiftValue` boxes
directly.  This forces the caster to instead unwrap `__SwiftValue` boxes and
retry with the inner content.  This results in boxed values being cast like the
inner content.

This fixes the behavior in situations like the following:
```
   let t = ...
   let s = t as Any as! AnyObject
   // `s` is now a `__SwiftValue` box
   // Next line should be true iff t conforms to NSCopying
   // Prior to this change, it always succeeds
   s is NSCopying
```

After this change, the above cast succeeds only if `t` actually
conforms to `NSCopying`.

This is a follow-on to PR#37683.
Related to: SR-14635
so the new behavior is always enabled by default on all OSes.

(This may change depending on whether anyone is actually depending
on this behavior.)
…from a Swift module

This allows us to produce an interface for libc++ again
…on SDKs with Foundation broken in C++ interop mode"

This reverts commit be0f25d.
Record uses even when they escape a pointer. This is more consistent
and helps avoids corner cases involving dead address producers.
…y splitting it into two to avoid SDK dependency for one of them
`isAccessibleFrom` has special handling for `@_objcImplementation`
members, which causes the definition in Swift to be missed. Use access
level directly rather than passing `nullptr` into `isAccessibleFrom`.
A cache lookup is done at the beginning of emitArchetypeWitnessTableRef
but the result is never cached.
The runtime compat 5.6 library is not available in current toolchains.
The stage-0 compiler builds fine since the builder compiler is not aware
of the 5.6 library, but the stage-1 compiler will not link since the
builder libraries don't have the compat 5.6 library, while the stage-0
compiler is aware of the library and attempts to link it into the built
products. The issue is that the bootstrap goes and uses the libraries
off of the builder instead of the things that actually match the
compiler.

This is currently safe because the 5.6 compat library only contains
concurrency runtime fixes and the compiler frontend does not use
concurrency yet. If this changes, we will need to re-enable this and
make the bootstrap use the libraries correctly.
Otherwise we don't actually accept this syntax in function signatures
and value pack parameters aren't testable.
This API is the inverse of visitEnclosingDefs when called on a phi.

This replaces the visitAdjacentReborrowsOfPhi algorithm with a small
loop that simply checks all the phis in the current block.

This should all be fairly efficient once SILArgument has a "reborrow"
flag.
nate-chandler and others added 28 commits February 7, 2023 10:29
This mostly mirrors what's already implemented for metadata pack emission.
Add visitInnerAdjacentPhis OSSA helper
And shuffled generic parameters.
To allow for better compiler optimizations, the
runtime should guarantee that AnyHashable does
not get boxed unnecessarily.

In particular, there was a concern that casting
an `AnyHashable` containing a class reference
to `AnyObject` would box the AnyHashable instead
of unwrapping it.

Further testing shows that the runtime is NOT
doing this unnecessary boxing at current.

Resolves rdar://90269352
…stead

[Index] Use access level to check decls to include
Call out to the infrastructure for emitting witness table packs to emit
references to individual witness tables when binding opened archetypes
during open_pack_element.
[Serialization] Evaluate the safety of opaque types
…iveSwiftValueBoxing-Part2

SR-14635: __SwiftValue should be transparent to casting
…t-sgf

don't print the "not inherited" mark in SGF declarations
It appears that conditional casts require a check of the
type's metadata at runtime. There's no reason for us to
permit that at this time, since all such conditional
casts are going to fail, unless its the identity cast.

That is, a move-only type is currently only a subtype
of itself.

So for now, `is`, `as?`, `as!` casts from or to a
move-only type are now an error. The `as` casts
are permitted only if the two move-only types are
equal.
…nyHashable

Add a test to verify that AnyHashable gets eagerly unwrapped
…rgen/witness-table-packs

[IRGen] Emit witness table packs.
…only

prevent move-only types from being cast incorrectly
[AST] NFC: Move `VarDecl::getPointerAuthQualifier` implementation to …
[interop] Emit symbolic interfaces while indexing
…rgen/open_pack_element_witnesses

[IRGen] Bind wtables at open_pack_element.
Misc changes to support import of structs with ptrauth qualified field function ptrs
…ectly-on-actor

[CustomExecutors] unownedExecutor can be declared not directly on actor
@kateinoigakukun kateinoigakukun merged commit 1597d04 into swiftwasm Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet