Skip to content

[pull] swiftwasm from main #1875

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 29 commits into from
Oct 1, 2020
Merged

[pull] swiftwasm from main #1875

merged 29 commits into from
Oct 1, 2020

Conversation

pull[bot]
Copy link

@pull pull bot commented Sep 30, 2020

See Commits and Changes for more details.


Created by pull[bot]. Want to support this open source service? Please star it : )

beccadax and others added 26 commits September 28, 2020 16:27
In swiftlang/llvm-project#1860, the diagnostic for a missing import in an umbrella header was improved by moving it to the end of the file and including a fix-it suggesting the import that would be needed. This breaks two things on the Swift side:

• One Swift test assumes the old source location will be used.
• The `ClangSourceBufferImporter` doesn’t work correctly when a diagnostic is emitted at EOF. It tries to create a virtual file covering EOF..<EOF, but it’s not actually valid to start a virtual file at EOF—it would always be empty.

This commit corrects these issues, which should unblock the automerger.

Fixes rdar://69707827.
…form.

Introduce a new Actor protocol, which is a class-bound protocol with only
one requirement:

    func enqueue(partialTask: PartialAsyncTask)

All actor classes implicitly conform to this protocol, and will synthesize
a (currently empty) definition of `enqueue(partialTask:)` unless a suitable
one is provided explicitly.
When an actor class has its `enqueue(partialTask:)` implicitly
synthesized, also synthesize a stored property for the actor's queue.
The type of the property is defined by the _Concurrency library
(`_DefaultActorQueue`), and it will be initialized with a call to
`_defaultActorQueueCreate` (also provided by the _Concurrency
library).

Also synthesize the body of the implicitly-generated
`enqueue(partialTask:)`, which will be a call to
`_defaultActorQueueEnqueuePartialTask(actor:queue:partialTask:)`.
Together, all of these allow us to experiment with the form of the
queue and the queue operation without affecting the type checker.

When `enqueue(partialTask:)` is not implicitly synthesized, the queue
storage is not synthesized either. In such cases, the user has taken
over the execution of tasks for the actor, rather than using the
default implementation.
…bles.

Actor classes never have non-actor superclasses, so we can ensure that
all actor classes have a common vtable prefix for the
`enqueue(partialTask:)` operation. This allows us to treat all actor
classes uniformly, without having to go through the Actor witness
table every time.
…minator.

For actor class's implementations of `enqueue(partialTask:)`, use a
fixed ptrauth discriminator. Paired with the fixed vtable location,
this allows one to invoke this operation on any native actor instance
without knowing the specific type.
Actor-isolated operations must not be directly accessible from anywhere
that is not already guaranteed to be running within the actor context.
Prevent such operations from being `@objc`, because that would allow
Objective-C code to violate actor isolation.
NSObject is guaranteed to have no state and no Swift vtable, and is
necessary for Swift classes to implement the NSObject protocol. Allow
it (and only it) as the superclass of an actor class, so that actor
classes can be exposed to Objective-C.
When eliminating an enum from an alloc_stack, accept "dead" inject_enum_addr instructions, which inject different enum cases.
…ons.

If the branch-block injects a certain enum case and the destination switches on that enum, it's worth jump threading. E.g.

  inject_enum_addr %enum : $*Optional<T>, #Optional.some
  ... // no memory writes here
  br DestBB
DestBB:
  ... // no memory writes here
  switch_enum_addr %enum : $*Optional<T>, case #Optional.some ...

This enables removing all code with optionals in a loop, which iterates over an array of address-only elements, e.g.

  func test<T>(_ items: [T]) {
    for i in items {
      print(i)
    }
  }
…leanup

AST: Move GenericParamList and friends to GenericParamList.{h,cpp}
…ention-demangling

[Demangler] Print convention attributes consistently.
…483b31000e466a446562218

[ownership] Move ownership passed TempLValueOpt for the stdlib and add an ossa test case.
SILOptimizer: two optimization improvements for address-only enums
…lla-corporation

[ClangImporter] Update umbrella header diagnostic handling
…protocol

[Concurrency] Introduce Actor protocol to which actor classes all conform
gottesmm and others added 3 commits September 30, 2020 16:05
…5e3ad4de714847cf43d0439

[ownership] Move ownership elimination on the stdlib passed lower aggregate instrs.
I already updated SROA for this and we already have tests/etc. We have just been
waiting on some other passes to be moved afterwards.
…0993211cdbc57fd7024a93e

[ownership] Move ownership lowering past SROA.
@pull pull bot merged commit ba77543 into swiftwasm Oct 1, 2020
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