@@ -767,12 +767,30 @@ impl<'a> TrampolineCompiler<'a> {
767767 } ,
768768 ) ;
769769 }
770- Trampoline :: ThreadSwitchTo {
770+ Trampoline :: ThreadSuspendToSuspended {
771771 instance,
772772 cancellable,
773773 } => {
774774 self . translate_libcall (
775- host:: thread_switch_to,
775+ host:: thread_suspend_to_suspended,
776+ TrapSentinel :: NegativeOne ,
777+ WasmArgs :: InRegisters ,
778+ |me, params| {
779+ params. push ( me. index_value ( * instance) ) ;
780+ params. push (
781+ me. builder
782+ . ins ( )
783+ . iconst ( ir:: types:: I8 , i64:: from ( * cancellable) ) ,
784+ ) ;
785+ } ,
786+ ) ;
787+ }
788+ Trampoline :: ThreadSuspendTo {
789+ instance,
790+ cancellable,
791+ } => {
792+ self . translate_libcall (
793+ host:: thread_suspend_to,
776794 TrapSentinel :: NegativeOne ,
777795 WasmArgs :: InRegisters ,
778796 |me, params| {
@@ -803,22 +821,22 @@ impl<'a> TrampolineCompiler<'a> {
803821 } ,
804822 ) ;
805823 }
806- Trampoline :: ThreadResumeLater { instance } => {
824+ Trampoline :: ThreadUnsuspend { instance } => {
807825 self . translate_libcall (
808- host:: thread_resume_later ,
826+ host:: thread_unsuspend ,
809827 TrapSentinel :: Falsy ,
810828 WasmArgs :: InRegisters ,
811829 |me, params| {
812830 params. push ( me. index_value ( * instance) ) ;
813831 } ,
814832 ) ;
815833 }
816- Trampoline :: ThreadYieldTo {
834+ Trampoline :: ThreadYieldToSuspended {
817835 instance,
818836 cancellable,
819837 } => {
820838 self . translate_libcall (
821- host:: thread_yield_to ,
839+ host:: thread_yield_to_suspended ,
822840 TrapSentinel :: NegativeOne ,
823841 WasmArgs :: InRegisters ,
824842 |me, params| {
@@ -1472,11 +1490,12 @@ impl<'a> TrampolineCompiler<'a> {
14721490 | Trampoline :: WaitableSetDrop { instance }
14731491 | Trampoline :: WaitableJoin { instance }
14741492 | Trampoline :: ThreadYield { instance, .. }
1475- | Trampoline :: ThreadSwitchTo { instance, .. }
14761493 | Trampoline :: ThreadNewIndirect { instance, .. }
14771494 | Trampoline :: ThreadSuspend { instance, .. }
1478- | Trampoline :: ThreadResumeLater { instance }
1479- | Trampoline :: ThreadYieldTo { instance, .. }
1495+ | Trampoline :: ThreadSuspendToSuspended { instance, .. }
1496+ | Trampoline :: ThreadSuspendTo { instance, .. }
1497+ | Trampoline :: ThreadUnsuspend { instance, .. }
1498+ | Trampoline :: ThreadYieldToSuspended { instance, .. }
14801499 | Trampoline :: SubtaskDrop { instance }
14811500 | Trampoline :: SubtaskCancel { instance, .. }
14821501 | Trampoline :: ErrorContextNew { instance, .. }
0 commit comments