Skip to content

Commit 0e03f1e

Browse files
committed
[Distributed] IRGen: Switch to use InvocationDecoder instead of argument value buffer
1 parent 8bff147 commit 0e03f1e

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

lib/IRGen/GenDistributed.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,17 @@ static CanSILFunctionType getAccessorType(IRGenModule &IGM,
144144
SILFunction *Target) {
145145
auto &Context = IGM.Context;
146146

147+
auto getInvocationDecoderParameter = [&]() {
148+
auto *actor = Target->getDeclContext()
149+
->getInnermostTypeContext()
150+
->getSelfNominalTypeDecl();
151+
auto *decoder = Context.getDistributedActorInvocationDecoder(actor);
152+
auto decoderTy = decoder->getInterfaceType()->getMetatypeInstanceType();
153+
auto paramType = IGM.getLoweredType(decoderTy);
154+
return SILParameterInfo(paramType.getASTType(),
155+
ParameterConvention::Direct_Guaranteed);
156+
};
157+
147158
auto getRawPointerParameter = [&]() {
148159
auto ptrType = Context.getUnsafeRawPointerType();
149160
return SILParameterInfo(ptrType->getCanonicalType(),
@@ -173,7 +184,7 @@ static CanSILFunctionType getAccessorType(IRGenModule &IGM,
173184
return SILFunctionType::get(
174185
/*genericSignature=*/nullptr, extInfo, SILCoroutineKind::None,
175186
ParameterConvention::Direct_Guaranteed,
176-
{/*argumentBuffer=*/getRawPointerParameter(),
187+
{/*argumentDecoder=*/getInvocationDecoderParameter(),
177188
/*argumentTypes=*/getRawPointerParameter(),
178189
/*resultBuffer=*/getRawPointerParameter(),
179190
/*substitutions=*/getRawPointerParameter(),
@@ -497,8 +508,9 @@ void DistributedAccessor::emit() {
497508
(unsigned)AsyncFunctionArgumentIndex::Context + 1;
498509
(void)params.claim(numAsyncContextParams);
499510

500-
// UnsafeRawPointer that holds all of the argument values.
501-
auto *argBuffer = params.claimNext();
511+
// A container that produces argument values based on the given set of
512+
// argument types (supplied as a next argument).
513+
auto *argDecoder = params.claimNext();
502514
// `swift.type**` that holds the argument types that correspond to values.
503515
auto *argTypes = params.claimNext();
504516
// UnsafeRawPointer that is used to store the result.

0 commit comments

Comments
 (0)