mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 07:14:46 +00:00
wasm_interp: implement WASI random_get & refactor default imports
This commit is contained in:
parent
eaa3f14fb0
commit
b7fef386ee
8 changed files with 112 additions and 31 deletions
|
@ -1,7 +1,7 @@
|
|||
#![cfg(test)]
|
||||
|
||||
use super::{const_value, create_exported_function_no_locals, default_state};
|
||||
use crate::{instance::Action, ImportDispatcher, Instance, ValueStack, DEFAULT_IMPORTS};
|
||||
use crate::{instance::Action, DefaultImportDispatcher, ImportDispatcher, Instance, ValueStack};
|
||||
use bumpalo::{collections::Vec, Bump};
|
||||
use roc_wasm_module::sections::{Import, ImportDesc};
|
||||
use roc_wasm_module::{
|
||||
|
@ -623,7 +623,8 @@ fn test_call_return_no_args() {
|
|||
println!("Wrote to {}", filename);
|
||||
}
|
||||
|
||||
let mut inst = Instance::for_module(&arena, &module, DEFAULT_IMPORTS, true).unwrap();
|
||||
let mut inst =
|
||||
Instance::for_module(&arena, &module, DefaultImportDispatcher::default(), true).unwrap();
|
||||
|
||||
let return_val = inst
|
||||
.call_export(&module, start_fn_name, [])
|
||||
|
@ -762,7 +763,13 @@ fn test_call_indirect_help(table_index: u32, elem_index: u32) -> Value {
|
|||
.unwrap();
|
||||
}
|
||||
|
||||
let mut inst = Instance::for_module(&arena, &module, DEFAULT_IMPORTS, is_debug_mode).unwrap();
|
||||
let mut inst = Instance::for_module(
|
||||
&arena,
|
||||
&module,
|
||||
DefaultImportDispatcher::default(),
|
||||
is_debug_mode,
|
||||
)
|
||||
.unwrap();
|
||||
inst.call_export(&module, start_fn_name, [])
|
||||
.unwrap()
|
||||
.unwrap()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue