@@ -720,6 +720,22 @@ swift::swift_task_create_group_future(
720
720
initialContextSize);
721
721
}
722
722
723
+ #ifdef __ARM_ARCH_7K__
724
+ __attribute__ ((noinline))
725
+ SWIFT_CC(swiftasync) static void workaround_function_swift_task_future_waitImpl(
726
+ OpaqueValue *result, SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
727
+ AsyncTask *task, TaskContinuationFunction resumeFunction,
728
+ AsyncContext *callContext) {
729
+ // Make sure we don't eliminate calls to this function.
730
+ asm volatile (" " // Do nothing.
731
+ : // Output list, empty.
732
+ : " r" (result), " r" (callerContext), " r" (task) // Input list.
733
+ : // Clobber list, empty.
734
+ );
735
+ return ;
736
+ }
737
+ #endif
738
+
723
739
SWIFT_CC (swiftasync)
724
740
static void swift_task_future_waitImpl(
725
741
OpaqueValue *result,
@@ -739,7 +755,12 @@ static void swift_task_future_waitImpl(
739
755
result)) {
740
756
case FutureFragment::Status::Executing:
741
757
// The waiting task has been queued on the future.
758
+ #ifdef __ARM_ARCH_7K__
759
+ return workaround_function_swift_task_future_waitImpl (
760
+ result, callerContext, task, resumeFn, callContext);
761
+ #else
742
762
return ;
763
+ #endif
743
764
744
765
case FutureFragment::Status::Success: {
745
766
// Run the task with a successful result.
@@ -754,6 +775,22 @@ static void swift_task_future_waitImpl(
754
775
}
755
776
}
756
777
778
+ #ifdef __ARM_ARCH_7K__
779
+ __attribute__ ((noinline))
780
+ SWIFT_CC(swiftasync) static void workaround_function_swift_task_future_wait_throwingImpl(
781
+ OpaqueValue *result, SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
782
+ AsyncTask *task, ThrowingTaskFutureWaitContinuationFunction resumeFunction,
783
+ AsyncContext *callContext) {
784
+ // Make sure we don't eliminate calls to this function.
785
+ asm volatile (" " // Do nothing.
786
+ : // Output list, empty.
787
+ : " r" (result), " r" (callerContext), " r" (task) // Input list.
788
+ : // Clobber list, empty.
789
+ );
790
+ return ;
791
+ }
792
+ #endif
793
+
757
794
SWIFT_CC (swiftasync)
758
795
void swift_task_future_wait_throwingImpl(
759
796
OpaqueValue *result, SWIFT_ASYNC_CONTEXT AsyncContext *callerContext,
@@ -774,7 +811,12 @@ void swift_task_future_wait_throwingImpl(
774
811
result)) {
775
812
case FutureFragment::Status::Executing:
776
813
// The waiting task has been queued on the future.
814
+ #ifdef __ARM_ARCH_7K__
815
+ return workaround_function_swift_task_future_wait_throwingImpl (
816
+ result, callerContext, task, resumeFunction, callContext);
817
+ #else
777
818
return ;
819
+ #endif
778
820
779
821
case FutureFragment::Status::Success: {
780
822
auto future = task->futureFragment ();
0 commit comments