-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: George Cosma <[email protected]>
- Loading branch information
1 parent
ee05bf3
commit bf9202b
Showing
8 changed files
with
456 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
use alloc::string::{String, ToString}; | ||
use alloc::vec::Vec; | ||
|
||
use crate::core::reader::types::FuncType; | ||
use crate::core::reader::WasmReader; | ||
use crate::execution::Store; | ||
|
||
/// ExecutionInfo is a compilation of relevant information needed by the [interpreter loop]( | ||
/// crate::execution::interpreter_loop::run). The lifetime annotation `'r` represents that this structure needs to be | ||
/// valid at least as long as the [RuntimeInstance](crate::execution::RuntimeInstance) that creates it. | ||
pub struct ExecutionInfo<'r> { | ||
pub name: String, | ||
pub wasm_bytecode: &'r [u8], | ||
pub wasm_reader: WasmReader<'r>, | ||
pub fn_types: Vec<FuncType>, | ||
pub store: Store, | ||
} | ||
|
||
impl<'r> ExecutionInfo<'r> { | ||
pub fn new(name: &str, wasm_bytecode: &'r [u8], fn_types: Vec<FuncType>, store: Store) -> Self { | ||
ExecutionInfo { | ||
name: name.to_string(), | ||
wasm_bytecode, | ||
wasm_reader: WasmReader::new(wasm_bytecode), | ||
fn_types, | ||
store, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.