@@ -6,7 +6,7 @@ use cranelift_codegen::ir::condcodes::IntCC;
66use cranelift_codegen:: ir:: { self , InstBuilder , MemFlags , Value } ;
77use cranelift_codegen:: isa:: { CallConv , TargetIsa } ;
88use cranelift_frontend:: FunctionBuilder ;
9- use wasmtime_environ:: fact:: SYNC_ENTER_FIXED_PARAMS ;
9+ use wasmtime_environ:: fact:: SYNC_PREPARE_FIXED_PARAMS ;
1010use wasmtime_environ:: { component:: * , CompiledFunctionBody } ;
1111use wasmtime_environ:: {
1212 HostCall , ModuleInternedTypeIndex , PtrSize , TrapSentinel , Tunables , WasmFuncType , WasmValType ,
@@ -255,13 +255,13 @@ impl<'a> TrampolineCompiler<'a> {
255255 me. raise_if_host_trapped ( rets. pop ( ) . unwrap ( ) ) ;
256256 } )
257257 }
258- Trampoline :: SyncEnterCall { memory } => self . translate_sync_enter ( * memory) ,
259- Trampoline :: SyncExitCall { callback } => self . translate_sync_exit ( * callback) ,
260- Trampoline :: AsyncEnterCall { memory } => self . translate_async_enter ( * memory) ,
261- Trampoline :: AsyncExitCall {
258+ Trampoline :: SyncPrepareCall { memory } => self . translate_sync_prepare ( * memory) ,
259+ Trampoline :: SyncStartCall { callback } => self . translate_sync_start ( * callback) ,
260+ Trampoline :: AsyncPrepareCall { memory } => self . translate_async_prepare ( * memory) ,
261+ Trampoline :: AsyncStartCall {
262262 callback,
263263 post_return,
264- } => self . translate_async_exit ( * callback, * post_return) ,
264+ } => self . translate_async_start ( * callback, * post_return) ,
265265 Trampoline :: FutureTransfer => {
266266 self . translate_host_libcall ( host:: future_transfer, |me, rets| {
267267 rets[ 0 ] = me. raise_if_negative_one_and_truncate ( rets[ 0 ] ) ;
@@ -349,9 +349,10 @@ impl<'a> TrampolineCompiler<'a> {
349349 Abi :: Array => {
350350 // TODO: A guest could hypothetically export the same intrinsic
351351 // it imported, allowing the host to call it directly. We need
352- // to support that here (except for `sync-enter`, `sync-exit`,
353- // `async-enter`, and `async-exit`, which are only ever called
354- // from FACT-generated Wasm code and never exported).
352+ // to support that here (except for `sync-prepare`,
353+ // `sync-start`, `async-prepare`, and `async-start`, which are
354+ // only ever called from FACT-generated Wasm code and never
355+ // exported).
355356 //
356357 // https://github.com/bytecodealliance/wasmtime/issues/10143
357358 self . builder . ins ( ) . trap ( TRAP_INTERNAL_ASSERT ) ;
@@ -470,7 +471,7 @@ impl<'a> TrampolineCompiler<'a> {
470471 ) ;
471472 }
472473
473- fn translate_sync_enter ( & mut self , memory : Option < RuntimeMemoryIndex > ) {
474+ fn translate_sync_prepare ( & mut self , memory : Option < RuntimeMemoryIndex > ) {
474475 match self . abi {
475476 Abi :: Wasm => { }
476477
@@ -488,7 +489,7 @@ impl<'a> TrampolineCompiler<'a> {
488489 let pointer_type = self . isa . pointer_type ( ) ;
489490 let wasm_func_ty = & self . types [ self . signature ] . unwrap_func ( ) ;
490491
491- let param_offset = SYNC_ENTER_FIXED_PARAMS . len ( ) ;
492+ let param_offset = SYNC_PREPARE_FIXED_PARAMS . len ( ) ;
492493 let spill_offset = param_offset + 2 ;
493494
494495 let ( values_vec_ptr, len) = self . compiler . allocate_stack_array_and_spill_args (
@@ -516,13 +517,13 @@ impl<'a> TrampolineCompiler<'a> {
516517
517518 self . translate_intrinsic_libcall (
518519 vmctx,
519- host:: sync_enter ,
520+ host:: sync_prepare ,
520521 & callee_args,
521522 TrapSentinel :: Falsy ,
522523 ) ;
523524 }
524525
525- fn translate_sync_exit ( & mut self , callback : Option < RuntimeCallbackIndex > ) {
526+ fn translate_sync_start ( & mut self , callback : Option < RuntimeCallbackIndex > ) {
526527 match self . abi {
527528 Abi :: Wasm => { }
528529
@@ -556,7 +557,7 @@ impl<'a> TrampolineCompiler<'a> {
556557 callee_args. push ( values_vec_ptr) ;
557558 callee_args. push ( values_vec_len) ;
558559
559- let call = self . call_libcall ( vmctx, host:: sync_exit , & callee_args) ;
560+ let call = self . call_libcall ( vmctx, host:: sync_start , & callee_args) ;
560561
561562 let succeeded = self . builder . func . dfg . inst_results ( call) [ 0 ] ;
562563 self . raise_if_host_trapped ( succeeded) ;
@@ -571,7 +572,7 @@ impl<'a> TrampolineCompiler<'a> {
571572 self . builder . ins ( ) . return_ ( & results) ;
572573 }
573574
574- fn translate_async_enter ( & mut self , memory : Option < RuntimeMemoryIndex > ) {
575+ fn translate_async_prepare ( & mut self , memory : Option < RuntimeMemoryIndex > ) {
575576 match self . abi {
576577 Abi :: Wasm => { }
577578
@@ -593,13 +594,13 @@ impl<'a> TrampolineCompiler<'a> {
593594
594595 self . translate_intrinsic_libcall (
595596 vmctx,
596- host:: async_enter ,
597+ host:: async_prepare ,
597598 & callee_args,
598599 TrapSentinel :: Falsy ,
599600 ) ;
600601 }
601602
602- fn translate_async_exit (
603+ fn translate_async_start (
603604 & mut self ,
604605 callback : Option < RuntimeCallbackIndex > ,
605606 post_return : Option < RuntimePostReturnIndex > ,
@@ -629,7 +630,7 @@ impl<'a> TrampolineCompiler<'a> {
629630
630631 self . translate_intrinsic_libcall (
631632 vmctx,
632- host:: async_exit ,
633+ host:: async_start ,
633634 & callee_args,
634635 TrapSentinel :: NegativeOne ,
635636 ) ;
0 commit comments