Skip to content

[pull] swiftwasm from main #4211

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

Merged
merged 21 commits into from
Feb 4, 2022
Merged

[pull] swiftwasm from main #4211

merged 21 commits into from
Feb 4, 2022

Conversation

pull[bot]
Copy link

@pull pull bot commented Feb 3, 2022

See Commits and Changes for more details.


Created by pull[bot]

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

al45tair and others added 21 commits February 1, 2022 19:21
Not only does this give us a huge speed-up, it also works around a problem
where sftp doesn't always update the modification time, which causes random
test failures.

rdar://88179140
…om the static mirror

This commit adds new entry-points to `libSwiftScan` that operate on the new BinaryScanningTool, which reads out Swift type information from object files, starting with a query of all protocol conformances.
Flow-isolation is a diagnostic SIL pass that finds
unsafe accesses to properties in initializers and
deinitializers that cannot gain isolation to otherwise
protect those accesses from concurrent modifications.
See SE-327 for more details about how and why it exists.

This commit includes changes and features like:

- The removal of the escaping-use restriction
- Flow-isolation that works properly with `defer` statements
- Flow-isolation with an emphasis on helpful diagnostics.

It also includes known issues like:

- Local / nonescaping functions are not analyzed by
  flow-isolation, despite it being technically possible.
  The main challenge in supporting it efficiently is that
  such functions do not have a single exit-point, like
  a `defer`. In particular, arbitrary functions can throw
  so there are points where nonisolation should _not_ flow
  out of the function at a call-site in the initializer, etc.

- The implementation of the flow-isolation pass is not
  particularly memory efficient; it relies on BitDataflow
  even though the particular flow problem is simple.
  So, a more efficient implementation would be specialized for
  this particular problem, etc.

There are also some changes to the Swift language itself: defer
will respect its context when deciding its property access kind.

Previously, a defer in an initializer would always access a stored
property through its accessor methods, instead of doing so directly
like its enclosing function might. This inconsistency is unfortunate,
so for Swift 6+ we make this consistent. For Swift 5, only a defer
in a function that is a member of the following kinds of types
will gain this consistency:

- an actor type
- any nominal type that is actor-isolated, excluding UnsafeGlobalActor.

These types are still rather new, so there is much less of a chance of
breaking expected behaviors around defer. In particular, the danger is
that users are relying on the behavior of defer triggering a property
observer within an init or deinit, when it would not be triggering it
without the defer.
…ts of an actor type.

For global-actor isolated async inits within an actor, we will have separate restrictions
on access to self's differently-isolated stored properties to prevent data races. But,
we also must be on the global actor while in such initializers. The problem was only
that the prologue was missing a hop because of a bad conditional check. Previously
the check assumed that actors cannot have global-actor isolated initializers, but they
can currently.
This is a combination of fixes:

- inject hops in self-isolated delegating actor initializers
  after self becomes initialized.

- fix sendable and isolation for convenience inits

- fix bug in distributed actor inits that I introduced when
  implementing flow-isolation.

- fix / add test coverage.
these updates primarily are to account for the new generic executor
that is being used for nonisolated / unspecified async functions.
A scoped-down version of swiftlang#39307. Implement extension of bound generic types. The important bit here is in TypeCheckGeneric where we now use the underlying type of a typealias and its associated nominal type decl when we're generating substitutions for the extended type.

Put this behind a new experimental flag

-enable-experimental-bound-generic-extensions

Resolves SR-4875
Resolves rdar://17434633
…on metadata but does not link them from runtime data structures (swiftlang#40853)
[LibSwiftScan] Add entry-points for querying protocol conformances from the static mirror
Fix SR-15785 by adding a cached reference to the last linked list node, avoiding n^2 append scaling
`--enable-experimental-string-processing` argument was missing. `args.enable_experimental_string_processing` is being read at the bottom of the script.

Resolves rdar://88420489.
@MaxDesiatov MaxDesiatov enabled auto-merge February 3, 2022 20:38
@MaxDesiatov MaxDesiatov merged commit 15b30e3 into swiftwasm Feb 4, 2022
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.

10 participants