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.
This commit is contained in:
Kavon Farvardin
2022-03-15 18:20:00 -07:00
parent 13cbe0dd15
commit af683dc271
25 changed files with 290 additions and 117 deletions

View File

@@ -76,6 +76,10 @@ static VarDecl *addImplicitDistributedActorIDProperty(
// mark as nonisolated, allowing access to it from everywhere
propDecl->getAttrs().add(
new (C) NonisolatedAttr(/*IsImplicit=*/true));
// mark as @_compilerInitialized, since we synthesize the initializing
// assignment during SILGen.
propDecl->getAttrs().add(
new (C) CompilerInitializedAttr(/*IsImplicit=*/true));
nominal->addMember(propDecl);
nominal->addMember(pbDecl);