pub struct WasmExnType {
pub func_ty: EngineOrModuleTypeIndex,
pub fields: Box<[WasmFieldType]>,
}
Expand description
WebAssembly exception type.
This “exception type” is not a Wasm language-level concept. Instead, it denotes an exception object signature – the types of the payload values.
In contrast, at the Wasm language level, exception objects are associated with specific tags, and these tags refer to their signatures (function types). However, tags are nominal: like memories and tables, a separate instance of a tag exists for every instance of the defining module, and these tag instances can be imported and exported. At runtime we handle tags like we do memories and tables, but these runtime instances do not exist in the type system here.
Because the Wasm type system does not have concrete exn
types
(i.e., the heap-type lattice has only top exn
and bottom
noexn
), we are free to decide what we mean by “concrete type”
here. Thus, we define an “exception type” to refer to the
type-level signature. When a particular exception object is
created in a store, it can be associated with a particular tag
instance also in that store, and the compatibility is checked
(the tag’s function type must match the function type in the
associated WasmExnType).
Fields§
§func_ty: EngineOrModuleTypeIndex
The function type from which we get our signature. We hold this directly so that we can efficiently derive a FuncType without re-interning the field types.
fields: Box<[WasmFieldType]>
The fields (payload values) that make up this exception type.
While we could obtain these by looking up the func_ty
above,
we also need to be able to derive a GC object layout from this
type descriptor without referencing other type descriptors; so
we directly inline the information here.
Trait Implementations§
Source§impl Clone for WasmExnType
impl Clone for WasmExnType
Source§fn clone(&self) -> WasmExnType
fn clone(&self) -> WasmExnType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for WasmExnType
impl Debug for WasmExnType
Source§impl<'de> Deserialize<'de> for WasmExnType
impl<'de> Deserialize<'de> for WasmExnType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for WasmExnType
impl Display for WasmExnType
Source§impl Hash for WasmExnType
impl Hash for WasmExnType
Source§impl PartialEq for WasmExnType
impl PartialEq for WasmExnType
Source§impl Serialize for WasmExnType
impl Serialize for WasmExnType
Source§impl TypeTrace for WasmExnType
impl TypeTrace for WasmExnType
Source§fn trace_mut<F, E>(&mut self, func: &mut F) -> Result<(), E>
fn trace_mut<F, E>(&mut self, func: &mut F) -> Result<(), E>
Source§fn trace_engine_indices<F, E>(&self, func: &mut F) -> Result<(), E>
fn trace_engine_indices<F, E>(&self, func: &mut F) -> Result<(), E>
VMSharedTypeIndex
edges, ignoring other edges.Source§fn canonicalize_for_runtime_usage<F>(&mut self, module_to_engine: &mut F)
fn canonicalize_for_runtime_usage<F>(&mut self, module_to_engine: &mut F)
self
by rewriting all type references inside self
from
module-level interned type indices to engine-level interned type
indices. Read moreSource§fn is_canonicalized_for_runtime_usage(&self) -> bool
fn is_canonicalized_for_runtime_usage(&self) -> bool
Source§fn canonicalize_for_hash_consing<F>(
&mut self,
rec_group_range: Range<ModuleInternedTypeIndex>,
module_to_engine: &mut F,
)
fn canonicalize_for_hash_consing<F>( &mut self, rec_group_range: Range<ModuleInternedTypeIndex>, module_to_engine: &mut F, )
self
by rewriting all type references inside self
from
module-level interned type indices to either engine-level interned type
indices or recgroup-relative indices. Read moreSource§fn is_canonicalized_for_hash_consing(&self) -> bool
fn is_canonicalized_for_hash_consing(&self) -> bool
impl Eq for WasmExnType
impl StructuralPartialEq for WasmExnType
Auto Trait Implementations§
impl Freeze for WasmExnType
impl RefUnwindSafe for WasmExnType
impl Send for WasmExnType
impl Sync for WasmExnType
impl Unpin for WasmExnType
impl UnwindSafe for WasmExnType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.