Home
last modified time | relevance | path

Searched refs:ExternRef (Results 1 – 25 of 58) sorted by relevance

123

/wasmtime-44.0.1/crates/wasmtime/src/runtime/gc/enabled/
H A Dexternref.rs120 pub struct ExternRef { struct
124 unsafe impl GcRefImpl for ExternRef { argument
141 impl ExternRef { impl
321 ) -> Result<Rooted<ExternRef>> in _new_async()
395 ) -> Result<Rooted<ExternRef>> { in convert_any() argument
403 ) -> Result<Rooted<ExternRef>> { in _convert_any() argument
601 unsafe impl WasmTy for Rooted<ExternRef> {
652 <Rooted<ExternRef>>::wasm_ty_option_load( in load()
655 ExternRef::from_cloned_gc_ref, in load()
660 unsafe impl WasmTy for OwnedRooted<ExternRef> {
[all …]
H A Danyref.rs3 use super::{ExternRef, RootedGcRefImpl};
230 externref: Rooted<ExternRef>, in convert_extern() argument
238 externref: Rooted<ExternRef>, in _convert_extern() argument
307 .matches(VMGcKind::ExternRef) in from_cloned_gc_ref()
365 if header.kind().matches(VMGcKind::ExternRef) { in _ty()
/wasmtime-44.0.1/crates/wast/src/
H A Dcore.rs20 ExternRef { in val()
21 value: None | Some(json_from_wast::ExternRef::Null), in val()
22 } => Val::ExternRef(None), in val()
23 ExternRef { in val()
24 value: Some(json_from_wast::ExternRef::Host(x)), in val()
93 | (Val::ExternRef(_), CoreConst::ExternRef { value: None }) in match_val()
96 | (Val::ExternRef(None), CoreConst::NullExternRef) in match_val()
111 Val::ExternRef(None), in match_val()
112 CoreConst::ExternRef { in match_val()
133 Val::ExternRef(Some(x)), in match_val()
[all …]
/wasmtime-44.0.1/crates/c-api/include/wasmtime/
H A Dval.hh33 class ExternRef { class
47 ExternRef(const ExternRef &other) { in ExternRef() function in wasmtime::ExternRef
52 ExternRef &operator=(const ExternRef &other) { in operator =()
59 ExternRef(ExternRef &&other) { in ExternRef() function in wasmtime::ExternRef
65 ExternRef &operator=(ExternRef &&other) { in operator =()
72 ~ExternRef() { wasmtime_externref_unroot(&val); } in ~ExternRef()
281 Val(std::optional<ExternRef> ptr) : val{} { in Val()
302 Val(ExternRef ptr);
350 return ValKind::ExternRef; in kind()
411 std::optional<ExternRef> externref() const { in externref()
[all …]
H A Dfunc.hh86 template <> struct WasmType<std::optional<ExternRef>> {
88 static const ValKind kind = ValKind::ExternRef;
90 std::optional<ExternRef> &&ref) { in store()
98 const std::optional<ExternRef> &ref) { in store()
105 static std::optional<ExternRef> load(Store::Context cx, in load()
112 return ExternRef(val); in load()
646 inline Val::Val(ExternRef ptr) : Val(std::optional(ptr)) {} in Val()
/wasmtime-44.0.1/crates/c-api/tests/
H A Dval.cc37 val = std::optional<ExternRef>(std::nullopt); in TEST()
38 EXPECT_EQ(val.kind(), ValKind::ExternRef); in TEST()
41 val = std::optional<ExternRef>(ExternRef(store, 5)); in TEST()
42 EXPECT_EQ(val.kind(), ValKind::ExternRef); in TEST()
45 val = ExternRef(store, 5); in TEST()
46 EXPECT_EQ(val.kind(), ValKind::ExternRef); in TEST()
111 ExternRef r(store, std::make_shared<SetOnDrop>(std::move(guard))); in TEST()
124 ExternRef r(store, std::make_shared<SetOnDrop>(std::move(guard))); in TEST()
138 ExternRef r(store, std::make_shared<SetOnDrop>(std::move(guard))); in TEST()
139 ExternRef r2 = r; in TEST()
[all …]
H A Dfunc.cc87 FuncType ty({ValKind::ExternRef, ValKind::ExternRef}, in TEST()
88 {ValKind::ExternRef, ValKind::ExternRef}); in TEST()
94 results[0] = ExternRef(caller, int(3)); in TEST()
95 results[1] = std::optional<ExternRef>(std::nullopt); in TEST()
101 std::tuple<std::optional<ExternRef>, std::optional<ExternRef>>; in TEST()
104 func.call(store, {ExternRef(store, int(100)), std::nullopt}).unwrap(); in TEST()
207 []() { return std::optional<ExternRef>(std::nullopt); }); in TEST()
208 assert_func_type(f.type(store), {}, {ValKind::ExternRef}); in TEST()
233 f = Func::wrap(store, [](std::optional<ExternRef> a) {}); in TEST()
234 assert_func_type(f.type(store), {ValKind::ExternRef}, {}); in TEST()
H A Dtable_type.cc13 ty = TableType(ValKind::ExternRef, 2, 3); in TEST()
16 EXPECT_EQ(ty->element().kind(), ValKind::ExternRef); in TEST()
H A Dval_type.cc17 ty = ValKind::ExternRef; in TEST()
18 EXPECT_EQ(ty->kind(), ValKind::ExternRef); in TEST()
/wasmtime-44.0.1/tests/all/
H A Dgc.rs113 let args = [Val::ExternRef(Some(r))]; in wasm_dropping_refs()
169 Ok(Some(ExternRef::new( in many_live_refs()
435 a: Option<Rooted<ExternRef>>, in no_gc_middle_of_args()
436 b: Option<Rooted<ExternRef>>, in no_gc_middle_of_args()
437 c: Option<Rooted<ExternRef>>| { in no_gc_middle_of_args()
607 a: Option<Rooted<ExternRef>>, in gc_and_tail_calls_and_stack_arguments()
608 b: Option<Rooted<ExternRef>>, in gc_and_tail_calls_and_stack_arguments()
609 c: Option<Rooted<ExternRef>>| { in gc_and_tail_calls_and_stack_arguments()
786 .get_typed_func::<Option<Rooted<ExternRef>>, Option<Rooted<ExternRef>>>(&mut store, "f")?; in round_trip_gc_ref_through_typed_wasm_func()
787 let x1 = ExternRef::new(&mut store, 1234)?; in round_trip_gc_ref_through_typed_wasm_func()
[all …]
H A Dfunc.rs400 Func::wrap(&mut store, || -> Rooted<ExternRef> { in func_constructors()
404 Func::wrap(&mut store, || -> OwnedRooted<ExternRef> { in func_constructors()
602 _: Option<Rooted<ExternRef>>, in signatures_match()
603 _: Option<OwnedRooted<ExternRef>>, in signatures_match()
699 f: Option<Rooted<ExternRef>>, in import_works()
700 g: Option<OwnedRooted<ExternRef>>, in import_works()
753 let hello = Val::ExternRef(Some(ExternRef::new(&mut store, "hello".to_string())?)); in import_works()
754 let goodbye = Val::ExternRef(Some(ExternRef::new(&mut store, "goodbye".to_string())?)); in import_works()
1597 ….get_typed_func::<(Option<Func>, Option<Rooted<ExternRef>>), (Option<Rooted<ExternRef>>, Option<Fu… in calls_with_funcref_and_externref()
1630 &[Val::FuncRef(None), Val::ExternRef(None)], in calls_with_funcref_and_externref()
[all …]
/wasmtime-44.0.1/crates/wasmtime/src/runtime/
H A Dvalues.rs53 ExternRef(Option<Rooted<ExternRef>>), enumerator
116 Val::ExternRef(None) in null_extern_ref()
236 | (Val::ExternRef(_), _) in _matches_ty()
378 (ExternRef(Option<&Rooted<ExternRef>>) extern_ref unwrap_extern_ref e.as_ref())
527 Val::ExternRef(None) => true, in comes_from_same_store()
586 impl From<Rooted<ExternRef>> for Val {
589 Val::ExternRef(Some(val)) in from()
596 Val::ExternRef(val) in from()
757 Extern(Option<Rooted<ExternRef>>),
792 impl From<Rooted<ExternRef>> for Ref {
[all …]
/wasmtime-44.0.1/examples/
H A Dexternref.rs21 let externref = match ExternRef::new(&mut store, "Hello, World!") { in main()
27 ExternRef::new(&mut store, inner)? in main()
65 let func = instance.get_typed_func::<Option<Rooted<ExternRef>>, Option<Rooted<ExternRef>>>( in main()
H A Dexternref.cc27 ExternRef externref(store, std::string("Hello, world!")); in main()
34 ExternRef val = *table.get(store, 3)->externref(); in main()
/wasmtime-44.0.1/crates/wasmtime/src/runtime/gc/disabled/
H A Dexternref.rs9 pub enum ExternRef {} enum
11 impl GcRefImpl for ExternRef {} implementation
13 impl ExternRef { implementation
/wasmtime-44.0.1/crates/fuzzing/src/generators/
H A Dvalue.rs18 ExternRef { null: bool }, enumerator
33 DiffValue::ExternRef { .. } => DiffValueType::ExternRef, in ty()
191 ExternRef => DiffValue::ExternRef { null: true }, in arbitrary_of_type()
238 DiffValue::ExternRef { null } => null.hash(state), in hash()
277 (Self::ExternRef { null: a }, Self::ExternRef { null: b }) => a == b, in eq()
296 ExternRef, enumerator
314 (true, HeapType::Extern) => Ok(Self::ExternRef), in try_from()
/wasmtime-44.0.1/crates/fuzzing/src/generators/gc_ops/
H A Dops.rs428 #[results([ExternRef, ExternRef, ExternRef])]
432 #[results([ExternRef, ExternRef, ExternRef])]
435 #[operands([Some(ExternRef), Some(ExternRef), Some(ExternRef)])]
440 #[results([ExternRef])]
448 #[operands([Some(ExternRef)])]
458 #[results([ExternRef])]
464 #[operands([Some(ExternRef)])]
472 #[results([ExternRef])]
478 #[operands([Some(ExternRef)])]
590 #[results([ExternRef])]
/wasmtime-44.0.1/crates/wasmtime/src/runtime/vm/gc/enabled/
H A Dexternref.rs39 if gc_heap.header(&self).kind() == VMGcKind::ExternRef { in into_externref()
65 if gc_heap.header(&self).kind() == VMGcKind::ExternRef { in as_externref()
H A Darrayref.rs3 AnyRef, ExnRef, ExternRef, Func, HeapType, RootedGcRefImpl, StorageType, Val, ValType,
161 Val::ExternRef(ExternRef::_from_raw(store, raw)) in read_elem()
231 Val::ExternRef(e) => { in write_elem()
350 Val::ExternRef(x) => { in initialize_elem()
H A Dstructref.rs3 AnyRef, ExnRef, ExternRef, Func, HeapType, RootedGcRefImpl, StorageType, Val, ValType,
191 Val::ExternRef(e) => { in write_field()
306 Val::ExternRef(ExternRef::_from_raw(store, raw)) in read_field_impl()
356 Val::ExternRef(x) => { in initialize_field_impl()
/wasmtime-44.0.1/crates/environ/src/
H A Dgc.rs470 ExternRef = 0b010000 << 26, enumerator
534 _ if x == Self::ExternRef.as_u32() => Some(Self::ExternRef), in try_from_u32()
552 let all = [ExternRef, AnyRef, EqRef, ArrayRef, StructRef, ExnRef]; in kind_matches()
555 (ExternRef, vec![]), in kind_matches()
/wasmtime-44.0.1/crates/fuzzing/src/oracles/
H A Ddiff_wasmi.rs181 DiffValue::ExternRef { null } => { in from()
183 WasmiValue::default(wasmi::ValType::ExternRef) in from()
202 WasmiValue::ExternRef(e) => DiffValue::ExternRef { null: e.is_null() }, in from()
H A Ddiff_wasmtime.rs219 DiffValue::ExternRef { null } => { in from()
221 Val::ExternRef(None) in from()
247 Val::ExternRef(r) => DiffValue::ExternRef { null: r.is_none() }, in from()
/wasmtime-44.0.1/crates/c-api/include/wasmtime/types/
H A Dval.hh28 ExternRef, enumerator
44 X(ExternRef, "externref", WASM_EXTERNREF) \
/wasmtime-44.0.1/crates/fuzzing/src/
H A Doracles.rs824 let a = ExternRef::new( in gc_ops()
828 let b = ExternRef::new( in gc_ops()
832 let c = ExternRef::new( in gc_ops()
850 a: Option<Rooted<ExternRef>>, in gc_ops()
851 b: Option<Rooted<ExternRef>>, in gc_ops()
852 c: Option<Rooted<ExternRef>>| in gc_ops()
900 let a = ExternRef::new( in gc_ops()
904 let b = ExternRef::new( in gc_ops()
908 let c = ExternRef::new( in gc_ops()
968 Ok(Val::ExternRef(Some(ExternRef::new( in gc_ops()

123