Move start_index out of TranslationResult and into the WasmRuntime.
This makes it more consistent with how all the rest of the content of a wasm module is handled. And, now TranslationResult just has a Vec of translated functions, which will make it easier to refactor further.
This commit is contained in:
@@ -22,6 +22,9 @@ pub struct DummyRuntime {
|
||||
|
||||
// Compilation setting flags.
|
||||
flags: settings::Flags,
|
||||
|
||||
// The start function.
|
||||
start_func: Option<FunctionIndex>,
|
||||
}
|
||||
|
||||
impl DummyRuntime {
|
||||
@@ -38,6 +41,7 @@ impl DummyRuntime {
|
||||
func_types: Vec::new(),
|
||||
imported_funcs: Vec::new(),
|
||||
flags,
|
||||
start_func: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,6 +181,11 @@ impl WasmRuntime for DummyRuntime {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn declare_start_func(&mut self, func_index: FunctionIndex) {
|
||||
debug_assert!(self.start_func.is_none());
|
||||
self.start_func = Some(func_index);
|
||||
}
|
||||
|
||||
fn begin_translation(&mut self) {
|
||||
// We do nothing
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user