Disconnects Store state fields from Compiler (#1761)

*  Moves CodeMemory, VMInterrupts and SignatureRegistry from Compiler
*  CompiledModule holds CodeMemory and GdbJitImageRegistration
*  Store keeps track of its JIT code
*  Makes "jit_int.rs" stuff Send+Sync
*  Adds the threads example.
This commit is contained in:
Yury Delendik
2020-06-02 13:44:39 -05:00
committed by GitHub
parent b41330393d
commit 15c68f2cc1
61 changed files with 982 additions and 663 deletions

View File

@@ -2,14 +2,14 @@ use wasmtime::*;
#[test]
fn test_module_no_name() -> anyhow::Result<()> {
let store = Store::default();
let engine = Engine::default();
let wat = r#"
(module
(func (export "run") (nop))
)
"#;
let module = Module::new(&store, wat)?;
let module = Module::new(&engine, wat)?;
assert_eq!(module.name(), None);
Ok(())
@@ -17,17 +17,17 @@ fn test_module_no_name() -> anyhow::Result<()> {
#[test]
fn test_module_name() -> anyhow::Result<()> {
let store = Store::default();
let engine = Engine::default();
let wat = r#"
(module $from_name_section
(func (export "run") (nop))
)
"#;
let module = Module::new(&store, wat)?;
let module = Module::new(&engine, wat)?;
assert_eq!(module.name(), Some("from_name_section"));
let module = Module::new_with_name(&store, wat, "override")?;
let module = Module::new_with_name(&engine, wat, "override")?;
assert_eq!(module.name(), Some("override"));
Ok(())