Commit Graph

83 Commits

Author SHA1 Message Date
Konrad `ktoso` Malawski
7d1ce789ad Revert "Revert "Isolated synchronous deinit"" 2024-09-17 17:35:38 +09:00
Alex Hoppen
c5aa49ba64 Revert "Isolated synchronous deinit" 2024-09-03 18:11:26 -07:00
Mykola Pokhylets
50b1313175 Merge branch 'main' into mpokhylets/isolated-deinit
# Conflicts:
#	lib/SILGen/SILGenDistributed.cpp
#	lib/Sema/TypeCheckConcurrency.cpp
2024-08-15 16:58:43 +02:00
Slava Pestov
375363a473 AST: Move global conformance lookup entry points to ConformanceLookup.h 2024-08-08 23:35:58 -04:00
Mykola Pokhylets
816d62c972 Merge remote-tracking branch 'upstream/main' into mpokhylets/isolated-deinit
# Conflicts:
#	include/swift/Basic/Features.def
#	lib/SILGen/SILGenDestructor.cpp
#	test/Concurrency/flow_isolation.swift
#	test/abi/macOS/arm64/concurrency.swift
#	test/abi/macOS/x86_64/concurrency.swift
2024-07-11 13:11:59 +02:00
Mykola Pokhylets
c28df0dc05 Don't isolate deinit of remote actor proxies 2024-07-11 13:09:07 +02:00
Mykola Pokhylets
9005e9b625 Removed some dead code 2024-07-11 13:09:06 +02:00
Slava Pestov
86d567f95a AST: ModuleDecl::lookupConformance() is a static method 2024-07-06 12:05:47 -04:00
Tim Kientzle
1d961ba22d Add #include "swift/Basic/Assertions.h" to a lot of source files
Although I don't plan to bring over new assertions wholesale
into the current qualification branch, it's entirely possible
that various minor changes in main will use the new assertions;
having this basic support in the release branch will simplify that.
(This is why I'm adding the includes as a separate pass from
rewriting the individual assertions)
2024-06-05 19:37:30 -07:00
Konrad `ktoso` Malawski
460a030860 [Distributed] Avoid infinite recursion in distributed thunk on protocol extensions (#73032) 2024-04-15 03:43:49 -07:00
Slava Pestov
4a46717325 Distributed: Fixes for non-copyable generics 2024-01-31 21:55:52 -05:00
Slava Pestov
079c5c4a1c SILGen: Support for 'throw' and 'try_apply' with indirect error result 2023-10-31 16:58:54 -04:00
Michael Gottesman
543063ef0e [silgen] Make ManagedValue::forUnmanaged private and change users to use other more specific APIs.
I have been doing this over the past couple of days in preparation for changing
ManagedValue to specify the type of scope its cleanup is connected to.
2023-08-19 14:11:44 -07:00
Konrad `ktoso` Malawski
7ecfc8292b [Distributed] correct take semantics for synthesized ID assignments
cleanup: no need to dump input always
2023-02-20 22:47:29 +09:00
Konrad `ktoso` Malawski
9f5c87ca7e Update lib/SILGen/SILGenDistributed.cpp
Co-authored-by: Kavon Farvardin <kfarvardin@apple.com>
2022-07-15 11:10:12 +09:00
Konrad `ktoso` Malawski
027c4a69c9 [Distributed] Prevent remote distributed actor from running deinit body 2022-07-14 17:56:03 +09:00
Konrad `ktoso` Malawski
febfef97d4 [Distributed] Skeleton implementation of distributed computed properties 2022-06-29 14:49:04 -07:00
Konrad `ktoso` Malawski
6a2778645f Revert "Merge pull request #59481 from xedin/distributed-computed-properties"
This reverts commit 8125a85a8f, reversing
changes made to 728971c5b7.
2022-06-25 08:49:00 +09:00
Konrad `ktoso` Malawski
079bbcf517 wip 2022-06-17 12:12:16 -07:00
Pavel Yaskevich
33f6c564a6 [Distributed/SILGen] NFC: Remove a couple of unused variables 2022-05-02 17:29:16 -07:00
swift-ci
605889b9f3 Merge pull request #42557 from kavon/fix-distactor-null-system
[Distributed] clean up some of the initialization code to be more robust
2022-04-22 21:01:42 -07:00
Konrad `ktoso` Malawski
e01bcc470f [Distributed] SILGen must consistently use prop get requests 2022-04-23 07:49:54 +09:00
Konrad `ktoso` Malawski
317fdd0740 [Distributed] Guard ID synthesis from synthesizing the property multiple times; e.g. during multi module builds 2022-04-22 23:18:16 +09:00
Kavon Farvardin
3243a87e47 clean up some of the initialization code to be more robust 2022-04-21 15:57:38 -07:00
Kavon Farvardin
ba9f627700 minor clean-ups 2022-03-25 20:07:45 +09:00
Konrad `ktoso` Malawski
466c6338d7 [Distributed] Also cover remote distributed call in test 2022-03-25 17:07:43 +09:00
Konrad `ktoso` Malawski
ef10cd016a [Distributed] Fix generic returning distributed funcs 2022-03-25 16:19:08 +09:00
Kavon Farvardin
af683dc271 basic implementation of performing an init of the id after an assign of the actorSystem.
The resignID call within the initializer moved into DI, because an assignment to
the actorSystem, and thus initialization of the id, is no longer guaranteed to happen.
Thus, while we previously could model the resignation as a clean-up emitted on all
unwind paths in an initializer, now it's conditional, based on whether the id was
initialized. This is exactly what DI is designed to do, so we inject the resignation
call just before we call the identity's deinit.
2022-03-24 16:20:01 -07:00
Kavon Farvardin
6c0cfac69a remove dependence on system parameter in SILGen/DefiniteInit 2022-03-24 16:18:49 -07:00
Konrad `ktoso` Malawski
8d3e7d91c0 [Distributed] ResultHandler.onReturn must be ad-hoc because SerializationRequirement (#41916)
* [Distributed] Invoke handler.onReturn ad hoc via ast synthesized func

* reformat and cleanup

* remove unused var
2022-03-24 21:44:37 +09:00
Konrad `ktoso` Malawski
8c13370242 [Distributed] rename _Distributed to underscoreless module 2022-03-16 08:35:35 +09:00
Konrad `ktoso` Malawski
14bbd27e83 [Distributed] remove a few warnings 2022-03-15 17:13:41 +09:00
Konrad `ktoso` Malawski
6d502fc042 [Distributed] Implicit Codable conformance for Dist Actors
[Witness] implement dump() on witness
2022-03-11 18:07:14 +09:00
Konrad `ktoso` Malawski
5ab8e0834d [Distributed] Reimplement distributed call thunks completely in AST (#41616)
* [Distributed] dist actor always has default executor (currently)

* [Distributed] extra test for missing makeEncoder

* [DistributedDecl] Add DistributedActorSystem to known SDK types

* [DistributedActor] ok progress on getting the system via witness

* [Distributed] allow hop-to `let any: any X` where X is DistActor

* [Distributed] AST: Add an accessor to determine whether type is distributed actor

- Classes have specialized method on their declarations
- Archetypes and existentials check their conformances for
  presence of `DistributedActor` protocol.

* [Distributed] AST: Account for distributed members declared in class extensions

`getConcreteReplacementForProtocolActorSystemType` should use `getSelfClassDecl`
otherwise it wouldn't be able to find actor if the member is declared in an extension.

* [Distributed] fix ad-hoc requirement checks for 'mutating'

[PreChecker] LookupDC might be null, so account for that

* [Distributed] Completed AST synthesis for dist thunk

* [Distributed][ASTDumper] print pretty distributed in right color in AST dumps

* wip on making the local/remote calls

* using the _local to mark the localCall as known local

* [Distributed] fix passing Never when not throwing

* fix lifetime of mangled string

* [Distributed] Implement recordGenericSubstitution

* [Distributed] Dont add .

* [Distributed] dont emit thunk when func broken

* [Distributed] fix tests; cleanups

* [Distributed] cleanup, move is... funcs to DistributedDecl

* [Distributed] Remove SILGen for distributed thunks, it is in Sema now!

* [Distributed]  no need to check stored props in protocols

* remote not used flag

* fix mangling test

* [Distributed] Synthesis: Don't re-use AST nodes for `decodeArgument` references

* [Distributed] Synthesis: Make sure that each thunk parameter has an internal name

* [Distributed/Synthesis] NFC: Add a comment regarding empty internal parameter names

* [Distributed] NFC: Adjust distributed thunk manglings in the accessor section test-cases

* cleanup

* [Distributed] NFC: Adjust distributed thunk manglings in the accessor thunk test-cases

* review follow ups

* xfail some linux tests for now so we can land the AST thunk

* Update distributed_actor_remote_functions.swift

Co-authored-by: Pavel Yaskevich <xedin@apache.org>
2022-03-10 23:58:23 +09:00
Konrad `ktoso` Malawski
005743c92c [Distributed] implement adhoc requirements properly for Encoder 2022-02-14 16:14:41 +09:00
Doug Gregor
a37f291c18 Remove ActorIsolation::DistributedActorInstance.
The distributed case is distinguishable from the non-distributed case
based on the actor type itself for those rare cases where we care. The
vast majority of code is simplified by treating this identically to
`ActorInstance`.
2022-02-09 11:16:23 -08:00
Konrad `ktoso` Malawski
f7c46746f6 formatting 2022-02-09 11:43:20 +09:00
Konrad `ktoso` Malawski
c57cb45eac [Distributed] Handle SerializationRequirement in dist get props
- reuse more code about getting the type and requirements
- handle protocols properly, including extensions with where clauses
- improve error messages
2022-02-08 23:08:59 +09:00
Konrad `ktoso` Malawski
ad14d02c9c cleanup 2022-02-03 06:25:45 +09:00
Konrad `ktoso` Malawski
48db739db0 [Distributed] Record generic substitution types for invocation 2022-02-02 18:12:32 +09:00
Konrad `ktoso` Malawski
e2c61d37ba [Distributed] Move dist funcdecl getters to ASTContext 2022-01-28 18:50:22 +09:00
Konrad `ktoso` Malawski
6da455e0fa [Distributed] cleanups: use more managed values and cleanups 2022-01-27 21:28:28 +09:00
Konrad `ktoso` Malawski
a5c2236535 [SGF][Distributed] emitStringLiteral and use it in distributed 2022-01-27 21:19:14 +09:00
Konrad `ktoso` Malawski
6622a3cc8d [Distributed] remove unused code 2022-01-27 20:02:08 +09:00
Konrad `ktoso` Malawski
4bf2a92bda [Distributed] Remove @_dynamic replacements; impl remoteCall ad-hoc reqs
Squashed commit of the following:

commit e5a05ffe44
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 17:45:31 2022 +0900

    cleanup

commit 1f751cea5a
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 14:50:33 2022 +0900

    cleanups

commit c632f3215d
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 14:01:09 2022 +0900

    add test for generic from actor decl

commit 09b8bd50a7
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 14:00:58 2022 +0900

    cleanups

commit 31f4d0cffd
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 27 11:40:51 2022 +0900

    fix test

commit ad4db2fb6c
Merge: 97227edcca 07e2dfda56
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 26 23:31:41 2022 +0900

    Merge branch 'main' into wip-zzz

commit 97227edcca
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 26 21:01:25 2022 +0900

    remove @_dynamic methods!

    fix tests

commit 1c79344dbb
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 19 12:51:09 2022 +0900

    cleanup

    wip

    stuck

    fixed the stack cleanups

    cleanups pretty good now

    weird load

    rki

    works

    remove hack

    add take + throw + return

    fix test

    more tests fixed

    more tests fixed

    more tests fixed

commit 3ed494c175
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Tue Jan 18 21:09:28 2022 +0900

    stack issues in SIL verification

commit 5cf43a7f86
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Tue Jan 18 09:19:51 2022 +0900

    about to call the remoteCall

    goot to return, but missing subs

commit df8e47122a
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 13 14:09:49 2022 +0900

    [Distributed] Refactor Invocation to Decoder/Encoder

    getting there

    done-recording

    working on the string init

    stuck trying to get String initializer SILFunction

    created the remote call target

commit fc7bd62f32
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 23:01:14 2022 +0900

    [Distributed] Pass arguments from Invocation to HBuffer

commit cafc2cc058
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 22:08:47 2022 +0900

    works

commit a7d01837ff
Author: Pavel Yaskevich <pyaskevich@apple.com>
Date:   Tue Jan 11 15:48:58 2022 -0800

    [Distributed] Adjust interface of `swift_distributed_execute_target`

    Since this is a special function, `calleeContext` doesn't point to
    a direct parent but instead both parent context (uninitialized)
    and resume function are passed as last arguments which means that
    `callContext` has to act as an intermediate context in call to accessor.

commit c1f830be27
Author: Pavel Yaskevich <pyaskevich@apple.com>
Date:   Tue Jan 11 17:00:08 2022 -0800

    [Distributed] Drop optionality from result buffer in `_executeDistributedTarget`

    `RawPointer?` is lowered into a two arguments since it's a struct,
    to make it easy let's just allocate an empty pointer for `Void` result.

commit c83c2c37b6
Author: Pavel Yaskevich <pyaskevich@apple.com>
Date:   Tue Jan 11 17:02:45 2022 -0800

    [Distributed] NFC: Update _remoteCall test-case to check multiple different result types

commit 29e7cf50e4
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 21:32:37 2022 +0900

    wip

commit 9128ecc6f8
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 20:46:20 2022 +0900

    wip

commit a6b2a62a67
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 20:38:22 2022 +0900

    wip

commit 8b188f0d43
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 16:55:10 2022 +0900

    wip

commit 3796bec2b9
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Jan 12 16:55:02 2022 +0900

    wip

commit 0ffc68b5ef
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Tue Jan 11 21:44:58 2022 +0900

    [Distributed] Implementing ad-hoc protocol requirements

commit 78862575e4
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 6 18:03:54 2022 +0900

    cleanup

commit 5f4ab89e25
Merge: 24a628e7c0 fdda6f2ee4
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 6 15:51:39 2022 +0900

    Merge branch 'main' into wip-impl-execute-swift

commit 24a628e7c0
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Thu Jan 6 15:33:21 2022 +0900

    wip

commit 69e7fed09d
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Dec 22 06:36:45 2021 +0900

    [Distributed] comment out distributed_actor_remoteCall for now

commit 376733a9f6
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Tue Dec 21 16:00:06 2021 +0900

    reimplement distributed get type info impls

commit 74ab47886a
Author: Konrad `ktoso` Malawski <konrad_malawski@apple.com>
Date:   Wed Dec 15 21:37:08 2021 +0900

    [Distributed] Implement func metadata and executeDistributedTarget

    dont expose new entrypoints

    able to get all the way to calling _execute
2022-01-27 17:51:43 +09:00
Konrad `ktoso` Malawski
cee89ec541 [Distributed] DistributedActorSystem renaming and redesign (#40387)
* [Distributed] towards DistributedActorSystem; synthesize the id earlier, since Identifiable.id

* Fix execute signature to what Pavel is working with

* funcs are ok in sil

* fixed lifetime of id in inits

* fix distributed_actor_deinit

* distributed_actor_local

* update more tests

fixing tests

fix TBD test

fix Serialization/distributed

fix irgen test

Fix null pointer crashes

* prevent issues with null func ptrs and fix Distributed prorotocol test

* fix deinit sil test
2021-12-13 11:29:25 +09:00
Konrad `ktoso` Malawski
f58b133a84 [Distributed] adjust conformance error messages a bit 2021-11-15 11:11:55 +09:00
swift-ci
65f09cce9d Merge pull request #39708 from kavon/actor-init-fixes 2021-11-05 15:52:33 -07:00
Doug Gregor
b37f77f350 Merge pull request #40033 from DougGregor/distributed-actors-without-existentials
Eliminate required type erasure from distributed actors
2021-11-04 22:31:51 -07:00
Kavon Farvardin
c5320c0206 express resignIdentity in SILGen as an unwind-only clean-up
turning it into a clean-up covers both failable and throwing initializers.

resolves rdar://84535066
2021-11-04 21:07:26 -07:00