-
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.
- Loading branch information
1 parent
f70a2e7
commit c8cdf29
Showing
3 changed files
with
114 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
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 wasm_bytecode: &'r [u8], | ||
pub wasm_reader: WasmReader<'r>, | ||
pub fn_types: &'r [FuncType], | ||
pub store: &'r mut Store, | ||
} | ||
|
||
impl<'r> ExecutionInfo<'r> { | ||
pub fn new(wasm_bytecode: &'r [u8], fn_types: &'r [FuncType], store: &'r mut Store) -> Self { | ||
ExecutionInfo { | ||
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
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