Skip to content

Commit c7451c0

Browse files
committed
Update CM async future and stream names
"Drop" instead of "close".
1 parent 0969650 commit c7451c0

File tree

8 files changed

+60
-60
lines changed

8 files changed

+60
-60
lines changed

crates/cranelift/src/compiler/component.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,16 @@ impl<'a> TrampolineCompiler<'a> {
175175
Trampoline::StreamCancelWrite { ty, async_ } => {
176176
self.translate_cancel_call(ty.as_u32(), *async_, host::stream_cancel_write)
177177
}
178-
Trampoline::StreamCloseReadable { ty } => self.translate_future_or_stream_call(
178+
Trampoline::StreamDropReadable { ty } => self.translate_future_or_stream_call(
179179
&[ty.as_u32()],
180180
None,
181-
host::stream_close_readable,
181+
host::stream_drop_readable,
182182
TrapSentinel::Falsy,
183183
),
184-
Trampoline::StreamCloseWritable { ty } => self.translate_future_or_stream_call(
184+
Trampoline::StreamDropWritable { ty } => self.translate_future_or_stream_call(
185185
&[ty.as_u32()],
186186
None,
187-
host::stream_close_writable,
187+
host::stream_drop_writable,
188188
TrapSentinel::Falsy,
189189
),
190190
Trampoline::FutureNew { ty } => self.translate_future_or_stream_call(
@@ -211,16 +211,16 @@ impl<'a> TrampolineCompiler<'a> {
211211
Trampoline::FutureCancelWrite { ty, async_ } => {
212212
self.translate_cancel_call(ty.as_u32(), *async_, host::future_cancel_write)
213213
}
214-
Trampoline::FutureCloseReadable { ty } => self.translate_future_or_stream_call(
214+
Trampoline::FutureDropReadable { ty } => self.translate_future_or_stream_call(
215215
&[ty.as_u32()],
216216
None,
217-
host::future_close_readable,
217+
host::future_drop_readable,
218218
TrapSentinel::Falsy,
219219
),
220-
Trampoline::FutureCloseWritable { ty } => self.translate_future_or_stream_call(
220+
Trampoline::FutureDropWritable { ty } => self.translate_future_or_stream_call(
221221
&[ty.as_u32()],
222222
None,
223-
host::future_close_writable,
223+
host::future_drop_writable,
224224
TrapSentinel::Falsy,
225225
),
226226
Trampoline::ErrorContextNew { ty, options } => self.translate_error_context_call(

crates/environ/src/component.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,9 @@ macro_rules! foreach_builtin_component_function {
149149
#[cfg(feature = "component-model-async")]
150150
future_cancel_read(vmctx: vmctx, ty: u32, async_: u8, reader: u32) -> u64;
151151
#[cfg(feature = "component-model-async")]
152-
future_close_writable(vmctx: vmctx, ty: u32, writer: u32) -> bool;
152+
future_drop_writable(vmctx: vmctx, ty: u32, writer: u32) -> bool;
153153
#[cfg(feature = "component-model-async")]
154-
future_close_readable(vmctx: vmctx, ty: u32, reader: u32) -> bool;
154+
future_drop_readable(vmctx: vmctx, ty: u32, reader: u32) -> bool;
155155
#[cfg(feature = "component-model-async")]
156156
stream_new(vmctx: vmctx, ty: u32) -> u64;
157157
#[cfg(feature = "component-model-async")]
@@ -163,9 +163,9 @@ macro_rules! foreach_builtin_component_function {
163163
#[cfg(feature = "component-model-async")]
164164
stream_cancel_read(vmctx: vmctx, ty: u32, async_: u8, reader: u32) -> u64;
165165
#[cfg(feature = "component-model-async")]
166-
stream_close_writable(vmctx: vmctx, ty: u32, writer: u32) -> bool;
166+
stream_drop_writable(vmctx: vmctx, ty: u32, writer: u32) -> bool;
167167
#[cfg(feature = "component-model-async")]
168-
stream_close_readable(vmctx: vmctx, ty: u32, reader: u32) -> bool;
168+
stream_drop_readable(vmctx: vmctx, ty: u32, reader: u32) -> bool;
169169
#[cfg(feature = "component-model-async")]
170170
flat_stream_write(vmctx: vmctx, memory: ptr_u8, realloc: ptr_u8, async_: u8, ty: u32, payload_size: u32, payload_align: u32, stream: u32, address: u32, count: u32) -> u64;
171171
#[cfg(feature = "component-model-async")]

crates/environ/src/component/dfg.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,10 @@ pub enum Trampoline {
337337
ty: TypeStreamTableIndex,
338338
async_: bool,
339339
},
340-
StreamCloseReadable {
340+
StreamDropReadable {
341341
ty: TypeStreamTableIndex,
342342
},
343-
StreamCloseWritable {
343+
StreamDropWritable {
344344
ty: TypeStreamTableIndex,
345345
},
346346
FutureNew {
@@ -362,10 +362,10 @@ pub enum Trampoline {
362362
ty: TypeFutureTableIndex,
363363
async_: bool,
364364
},
365-
FutureCloseReadable {
365+
FutureDropReadable {
366366
ty: TypeFutureTableIndex,
367367
},
368-
FutureCloseWritable {
368+
FutureDropWritable {
369369
ty: TypeFutureTableIndex,
370370
},
371371
ErrorContextNew {
@@ -848,11 +848,11 @@ impl LinearizeDfg<'_> {
848848
ty: *ty,
849849
async_: *async_,
850850
},
851-
Trampoline::StreamCloseReadable { ty } => {
852-
info::Trampoline::StreamCloseReadable { ty: *ty }
851+
Trampoline::StreamDropReadable { ty } => {
852+
info::Trampoline::StreamDropReadable { ty: *ty }
853853
}
854-
Trampoline::StreamCloseWritable { ty } => {
855-
info::Trampoline::StreamCloseWritable { ty: *ty }
854+
Trampoline::StreamDropWritable { ty } => {
855+
info::Trampoline::StreamDropWritable { ty: *ty }
856856
}
857857
Trampoline::FutureNew { ty } => info::Trampoline::FutureNew { ty: *ty },
858858
Trampoline::FutureRead { ty, options } => info::Trampoline::FutureRead {
@@ -871,11 +871,11 @@ impl LinearizeDfg<'_> {
871871
ty: *ty,
872872
async_: *async_,
873873
},
874-
Trampoline::FutureCloseReadable { ty } => {
875-
info::Trampoline::FutureCloseReadable { ty: *ty }
874+
Trampoline::FutureDropReadable { ty } => {
875+
info::Trampoline::FutureDropReadable { ty: *ty }
876876
}
877-
Trampoline::FutureCloseWritable { ty } => {
878-
info::Trampoline::FutureCloseWritable { ty: *ty }
877+
Trampoline::FutureDropWritable { ty } => {
878+
info::Trampoline::FutureDropWritable { ty: *ty }
879879
}
880880
Trampoline::ErrorContextNew { ty, options } => info::Trampoline::ErrorContextNew {
881881
ty: *ty,

crates/environ/src/component/info.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -838,14 +838,14 @@ pub enum Trampoline {
838838

839839
/// A `stream.close-readable` intrinsic to close the readable end of a
840840
/// `stream` of the specified type.
841-
StreamCloseReadable {
841+
StreamDropReadable {
842842
/// The table index for the specific `stream` type and caller instance.
843843
ty: TypeStreamTableIndex,
844844
},
845845

846846
/// A `stream.close-writable` intrinsic to close the writable end of a
847847
/// `stream` of the specified type.
848-
StreamCloseWritable {
848+
StreamDropWritable {
849849
/// The table index for the specific `stream` type and caller instance.
850850
ty: TypeStreamTableIndex,
851851
},
@@ -899,14 +899,14 @@ pub enum Trampoline {
899899

900900
/// A `future.close-readable` intrinsic to close the readable end of a
901901
/// `future` of the specified type.
902-
FutureCloseReadable {
902+
FutureDropReadable {
903903
/// The table index for the specific `future` type and caller instance.
904904
ty: TypeFutureTableIndex,
905905
},
906906

907907
/// A `future.close-writable` intrinsic to close the writable end of a
908908
/// `future` of the specified type.
909-
FutureCloseWritable {
909+
FutureDropWritable {
910910
/// The table index for the specific `future` type and caller instance.
911911
ty: TypeFutureTableIndex,
912912
},
@@ -1061,15 +1061,15 @@ impl Trampoline {
10611061
StreamWrite { .. } => format!("stream-write"),
10621062
StreamCancelRead { .. } => format!("stream-cancel-read"),
10631063
StreamCancelWrite { .. } => format!("stream-cancel-write"),
1064-
StreamCloseReadable { .. } => format!("stream-close-readable"),
1065-
StreamCloseWritable { .. } => format!("stream-close-writable"),
1064+
StreamDropReadable { .. } => format!("stream-close-readable"),
1065+
StreamDropWritable { .. } => format!("stream-close-writable"),
10661066
FutureNew { .. } => format!("future-new"),
10671067
FutureRead { .. } => format!("future-read"),
10681068
FutureWrite { .. } => format!("future-write"),
10691069
FutureCancelRead { .. } => format!("future-cancel-read"),
10701070
FutureCancelWrite { .. } => format!("future-cancel-write"),
1071-
FutureCloseReadable { .. } => format!("future-close-readable"),
1072-
FutureCloseWritable { .. } => format!("future-close-writable"),
1071+
FutureDropReadable { .. } => format!("future-close-readable"),
1072+
FutureDropWritable { .. } => format!("future-close-writable"),
10731073
ErrorContextNew { .. } => format!("error-context-new"),
10741074
ErrorContextDebugMessage { .. } => format!("error-context-debug-message"),
10751075
ErrorContextDrop { .. } => format!("error-context-drop"),

crates/environ/src/component/translate.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ enum LocalInitializer<'data> {
253253
func: ModuleInternedTypeIndex,
254254
async_: bool,
255255
},
256-
StreamCloseReadable {
256+
StreamDropReadable {
257257
ty: ComponentDefinedTypeId,
258258
func: ModuleInternedTypeIndex,
259259
},
260-
StreamCloseWritable {
260+
StreamDropWritable {
261261
ty: ComponentDefinedTypeId,
262262
func: ModuleInternedTypeIndex,
263263
},
@@ -285,11 +285,11 @@ enum LocalInitializer<'data> {
285285
func: ModuleInternedTypeIndex,
286286
async_: bool,
287287
},
288-
FutureCloseReadable {
288+
FutureDropReadable {
289289
ty: ComponentDefinedTypeId,
290290
func: ModuleInternedTypeIndex,
291291
},
292-
FutureCloseWritable {
292+
FutureDropWritable {
293293
ty: ComponentDefinedTypeId,
294294
func: ModuleInternedTypeIndex,
295295
},
@@ -771,13 +771,13 @@ impl<'a, 'data> Translator<'a, 'data> {
771771
let ty = types.component_defined_type_at(ty);
772772
let func = self.core_func_signature(core_func_index)?;
773773
core_func_index += 1;
774-
LocalInitializer::StreamCloseReadable { ty, func }
774+
LocalInitializer::StreamDropReadable { ty, func }
775775
}
776776
wasmparser::CanonicalFunction::StreamDropWritable { ty } => {
777777
let ty = types.component_defined_type_at(ty);
778778
let func = self.core_func_signature(core_func_index)?;
779779
core_func_index += 1;
780-
LocalInitializer::StreamCloseWritable { ty, func }
780+
LocalInitializer::StreamDropWritable { ty, func }
781781
}
782782
wasmparser::CanonicalFunction::FutureNew { ty } => {
783783
let ty = types.component_defined_type_at(ty);
@@ -815,13 +815,13 @@ impl<'a, 'data> Translator<'a, 'data> {
815815
let ty = types.component_defined_type_at(ty);
816816
let func = self.core_func_signature(core_func_index)?;
817817
core_func_index += 1;
818-
LocalInitializer::FutureCloseReadable { ty, func }
818+
LocalInitializer::FutureDropReadable { ty, func }
819819
}
820820
wasmparser::CanonicalFunction::FutureDropWritable { ty } => {
821821
let ty = types.component_defined_type_at(ty);
822822
let func = self.core_func_signature(core_func_index)?;
823823
core_func_index += 1;
824-
LocalInitializer::FutureCloseWritable { ty, func }
824+
LocalInitializer::FutureDropWritable { ty, func }
825825
}
826826
wasmparser::CanonicalFunction::ErrorContextNew { options } => {
827827
let options = self.canonical_options(&options);

crates/environ/src/component/translate/inline.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ impl<'a> Inliner<'a> {
863863
));
864864
frame.funcs.push(dfg::CoreDef::Trampoline(index));
865865
}
866-
StreamCloseReadable { ty, func } => {
866+
StreamDropReadable { ty, func } => {
867867
let InterfaceType::Stream(ty) =
868868
types.defined_type(frame.translation.types_ref(), *ty)?
869869
else {
@@ -872,10 +872,10 @@ impl<'a> Inliner<'a> {
872872
let index = self
873873
.result
874874
.trampolines
875-
.push((*func, dfg::Trampoline::StreamCloseReadable { ty }));
875+
.push((*func, dfg::Trampoline::StreamDropReadable { ty }));
876876
frame.funcs.push(dfg::CoreDef::Trampoline(index));
877877
}
878-
StreamCloseWritable { ty, func } => {
878+
StreamDropWritable { ty, func } => {
879879
let InterfaceType::Stream(ty) =
880880
types.defined_type(frame.translation.types_ref(), *ty)?
881881
else {
@@ -884,7 +884,7 @@ impl<'a> Inliner<'a> {
884884
let index = self
885885
.result
886886
.trampolines
887-
.push((*func, dfg::Trampoline::StreamCloseWritable { ty }));
887+
.push((*func, dfg::Trampoline::StreamDropWritable { ty }));
888888
frame.funcs.push(dfg::CoreDef::Trampoline(index));
889889
}
890890
FutureNew { ty, func } => {
@@ -957,7 +957,7 @@ impl<'a> Inliner<'a> {
957957
));
958958
frame.funcs.push(dfg::CoreDef::Trampoline(index));
959959
}
960-
FutureCloseReadable { ty, func } => {
960+
FutureDropReadable { ty, func } => {
961961
let InterfaceType::Future(ty) =
962962
types.defined_type(frame.translation.types_ref(), *ty)?
963963
else {
@@ -966,10 +966,10 @@ impl<'a> Inliner<'a> {
966966
let index = self
967967
.result
968968
.trampolines
969-
.push((*func, dfg::Trampoline::FutureCloseReadable { ty }));
969+
.push((*func, dfg::Trampoline::FutureDropReadable { ty }));
970970
frame.funcs.push(dfg::CoreDef::Trampoline(index));
971971
}
972-
FutureCloseWritable { ty, func } => {
972+
FutureDropWritable { ty, func } => {
973973
let InterfaceType::Future(ty) =
974974
types.defined_type(frame.translation.types_ref(), *ty)?
975975
else {
@@ -978,7 +978,7 @@ impl<'a> Inliner<'a> {
978978
let index = self
979979
.result
980980
.trampolines
981-
.push((*func, dfg::Trampoline::FutureCloseWritable { ty }));
981+
.push((*func, dfg::Trampoline::FutureDropWritable { ty }));
982982
frame.funcs.push(dfg::CoreDef::Trampoline(index));
983983
}
984984
ErrorContextNew { func, options } => {

crates/wasmtime/src/runtime/component/concurrent.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -294,15 +294,15 @@ pub unsafe trait VMComponentAsyncStore {
294294
) -> Result<u32>;
295295

296296
/// The `future.close-writable` intrinsic.
297-
fn future_close_writable(
297+
fn future_drop_writable(
298298
&mut self,
299299
instance: &mut ComponentInstance,
300300
ty: TypeFutureTableIndex,
301301
writer: u32,
302302
) -> Result<()>;
303303

304304
/// The `future.close-readable` intrinsic.
305-
fn future_close_readable(
305+
fn future_drop_readable(
306306
&mut self,
307307
instance: &mut ComponentInstance,
308308
ty: TypeFutureTableIndex,
@@ -361,15 +361,15 @@ pub unsafe trait VMComponentAsyncStore {
361361
) -> Result<u32>;
362362

363363
/// The `stream.close-writable` intrinsic.
364-
fn stream_close_writable(
364+
fn stream_drop_writable(
365365
&mut self,
366366
instance: &mut ComponentInstance,
367367
ty: TypeStreamTableIndex,
368368
writer: u32,
369369
) -> Result<()>;
370370

371371
/// The `stream.close-readable` intrinsic.
372-
fn stream_close_readable(
372+
fn stream_drop_readable(
373373
&mut self,
374374
instance: &mut ComponentInstance,
375375
ty: TypeStreamTableIndex,
@@ -698,7 +698,7 @@ unsafe impl<T> VMComponentAsyncStore for StoreInner<T> {
698698
todo!()
699699
}
700700

701-
fn future_close_writable(
701+
fn future_drop_writable(
702702
&mut self,
703703
instance: &mut ComponentInstance,
704704
ty: TypeFutureTableIndex,
@@ -708,7 +708,7 @@ unsafe impl<T> VMComponentAsyncStore for StoreInner<T> {
708708
todo!()
709709
}
710710

711-
fn future_close_readable(
711+
fn future_drop_readable(
712712
&mut self,
713713
instance: &mut ComponentInstance,
714714
ty: TypeFutureTableIndex,
@@ -797,7 +797,7 @@ unsafe impl<T> VMComponentAsyncStore for StoreInner<T> {
797797
todo!()
798798
}
799799

800-
fn stream_close_writable(
800+
fn stream_drop_writable(
801801
&mut self,
802802
instance: &mut ComponentInstance,
803803
ty: TypeStreamTableIndex,
@@ -807,7 +807,7 @@ unsafe impl<T> VMComponentAsyncStore for StoreInner<T> {
807807
todo!()
808808
}
809809

810-
fn stream_close_readable(
810+
fn stream_drop_readable(
811811
&mut self,
812812
instance: &mut ComponentInstance,
813813
ty: TypeStreamTableIndex,

0 commit comments

Comments
 (0)