Skip to content

Commit ebd6ee8

Browse files
committed
Review feedback.
1 parent 64973e8 commit ebd6ee8

File tree

5 files changed

+8
-32
lines changed

5 files changed

+8
-32
lines changed

crates/environ/src/gc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ impl GcExceptionLayout {
455455
/// VMGcKind::EqRef`.
456456
///
457457
/// Furthermore, this type only uses the highest 6 bits of its `u32`
458-
/// representation, allowing the lower 27 bytes to be bitpacked with other stuff
458+
/// representation, allowing the lower 26 bits to be bitpacked with other stuff
459459
/// as users see fit.
460460
#[repr(u32)]
461461
#[derive(Clone, Copy, Debug, PartialEq, Eq)]

crates/environ/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ impl TypeTrace for WasmContType {
883883
/// type-level *signature*. When a particular *exception object* is
884884
/// created in a store, it can be associated with a particular *tag
885885
/// instance* also in that store, and the compatibility is checked
886-
/// (the tag's function type must match teh function type in the
886+
/// (the tag's function type must match the function type in the
887887
/// associated WasmExnType).
888888
#[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)]
889889
pub struct WasmExnType {

crates/wasmtime/src/runtime/coredump.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,10 @@ impl WasmCoreDump {
205205
wasm_encoder::ConstExpr::ref_null(wasm_encoder::HeapType::ANY)
206206
}
207207
Val::ExnRef(_) => {
208-
todo!(
209-
"Cannot encode a core dump with an exception object global because the wasm_encoder::HeapType does not exist"
210-
)
208+
wasm_encoder::ConstExpr::ref_null(wasm_encoder::HeapType::Abstract {
209+
shared: false,
210+
ty: wasm_encoder::AbstractHeapType::Exn,
211+
})
211212
}
212213
};
213214
globals.global(

crates/wasmtime/src/runtime/externals/tag.rs

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -33,29 +33,7 @@ impl Tag {
3333
/// When using an async resource limiter, use [`Tag::new_async`]
3434
/// instead.
3535
pub fn new(mut store: impl AsContextMut, ty: &TagType) -> Result<Tag> {
36-
Tag::_new(store.as_context_mut().0, ty)
37-
}
38-
39-
/// Async variant of [`Tag::new`]. You must use this variant with
40-
/// [`Store`](`crate::Store`)s which have a
41-
/// [`ResourceLimiterAsync`](`crate::ResourceLimiterAsync`).
42-
///
43-
/// # Panics
44-
///
45-
/// This function will panic when used with a non-async
46-
/// [`Store`](`crate::Store`).
47-
#[cfg(feature = "async")]
48-
pub async fn new_async(mut store: impl AsContextMut<Data: Send>, ty: &TagType) -> Result<Tag> {
49-
let mut store = store.as_context_mut();
50-
assert!(
51-
store.0.async_support(),
52-
"cannot use `new_async` without enabling async support on the config"
53-
);
54-
store.on_fiber(|store| Tag::_new(store.0, ty)).await?
55-
}
56-
57-
fn _new(store: &mut StoreOpaque, ty: &TagType) -> Result<Tag> {
58-
generate_tag_export(store, ty)
36+
generate_tag_export(store.as_context_mut().0, ty)
5937
}
6038

6139
/// Returns the underlying type of this `tag`.

crates/wasmtime/src/runtime/vm/instance.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ impl Instance {
10041004
VMGcRef::from_raw_u32(raw.get_externref())
10051005
}),
10061006
)?,
1007-
WasmHeapTopType::Any => table.init_gc_refs(
1007+
WasmHeapTopType::Any | WasmHeapTopType::Exn => table.init_gc_refs(
10081008
dst,
10091009
exprs.iter().map(|expr| unsafe {
10101010
let raw = const_evaluator
@@ -1025,9 +1025,6 @@ impl Instance {
10251025
)
10261026
}),
10271027
)?,
1028-
WasmHeapTopType::Exn => {
1029-
unreachable!("Cannot initialize exception objects from an element segment")
1030-
}
10311028
WasmHeapTopType::Cont => todo!(), // FIXME: #10248 stack switching support.
10321029
}
10331030
}

0 commit comments

Comments
 (0)