File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 27
27
28
28
#include " ../CompatibilityOverride/CompatibilityOverride.h"
29
29
#include " swift/Runtime/Atomic.h"
30
+ #include " swift/Runtime/AccessibleFunction.h"
30
31
#include " swift/Runtime/Casting.h"
31
32
#include " swift/Runtime/Once.h"
32
33
#include " swift/Runtime/Mutex.h"
@@ -2004,3 +2005,27 @@ bool DefaultActorImpl::isDistributedRemote() {
2004
2005
auto state = CurrentState.load (std::memory_order_relaxed);
2005
2006
return state.Flags .isDistributedRemote ();
2006
2007
}
2008
+
2009
+ static const AccessibleFunctionRecord *
2010
+ findDistributedAccessor (const char *targetNameStart, size_t targetNameLength) {
2011
+ if (auto *func = runtime::swift_findAccessibleFunction (targetNameStart,
2012
+ targetNameLength)) {
2013
+ assert (func->Flags .isDistributed ());
2014
+ return func;
2015
+ }
2016
+ return nullptr ;
2017
+ }
2018
+
2019
+ SWIFT_CC (swiftasync)
2020
+ void swift_distributed_execute_target(
2021
+ OpaqueValue *resultPointer,
2022
+ SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
2023
+ DefaultActor *actor,
2024
+ const char *targetNameStart, size_t targetNameLength,
2025
+ void *argumentBuffer,
2026
+ void *resultBuffer,
2027
+ ThrowingTaskFutureWaitContinuationFunction *resumeFn,
2028
+ AsyncContext *callContext) {
2029
+ auto *accessor = findDistributedAccessor (targetNameStart, targetNameLength);
2030
+ (void )accessor;
2031
+ }
Original file line number Diff line number Diff line change @@ -184,3 +184,13 @@ func __isLocalActor(_ actor: AnyObject) -> Bool {
184
184
185
185
@_silgen_name ( " swift_distributedActor_remote_initialize " )
186
186
func _distributedActorRemoteInitialize( _ actorType: Builtin . RawPointer ) -> Any
187
+
188
+ // ==== Remote target accesss -------------------------------------------------
189
+
190
+ @_silgen_name ( " swift_distributed_execute_target " )
191
+ func _executeDistributedTarget(
192
+ on: AnyObject ,
193
+ _ targetName: UnsafePointer < UInt8 > ,
194
+ _ targetNameLength: UInt ,
195
+ argumentBuffer: Builtin . RawPointer ,
196
+ resultBuffer: Builtin . RawPointer ) async throws
You can’t perform that action at this time.
0 commit comments