Clean up, everything works

This commit is contained in:
Mark McCaskey
2020-02-12 17:09:30 -08:00
parent 5e3c5f703f
commit e34e0bb897
27 changed files with 179 additions and 4189 deletions

View File

@ -678,6 +678,7 @@ impl ModuleCodeGenerator<X64FunctionCode, X64ExecutionContext, CodegenError>
fn next_function(
&mut self,
_module_info: Arc<RwLock<ModuleInfo>>,
_loc: (u32, u32),
) -> Result<&mut X64FunctionCode, CodegenError> {
let (mut assembler, mut function_labels, breakpoints, exception_table) =
match self.functions.last_mut() {
@ -736,7 +737,16 @@ impl ModuleCodeGenerator<X64FunctionCode, X64ExecutionContext, CodegenError>
fn finalize(
mut self,
_: &ModuleInfo,
) -> Result<(X64ExecutionContext, Box<dyn CacheGen>), CodegenError> {
) -> Result<
(
(
X64ExecutionContext,
Option<wasmer_runtime_core::codegen::DebugMetadata>,
),
Box<dyn CacheGen>,
),
CodegenError,
> {
let (assembler, function_labels, breakpoints, exception_table) =
match self.functions.last_mut() {
Some(x) => (
@ -829,16 +839,19 @@ impl ModuleCodeGenerator<X64FunctionCode, X64ExecutionContext, CodegenError>
};
Ok((
X64ExecutionContext {
code: output,
signatures: self.signatures.as_ref().unwrap().clone(),
breakpoints: breakpoints,
func_import_count: self.func_import_count,
function_pointers: out_labels,
function_offsets: out_offsets,
msm: msm,
exception_table,
},
(
X64ExecutionContext {
code: output,
signatures: self.signatures.as_ref().unwrap().clone(),
breakpoints: breakpoints,
func_import_count: self.func_import_count,
function_pointers: out_labels,
function_offsets: out_offsets,
msm: msm,
exception_table,
},
None,
),
Box::new(cache),
))
}
@ -2405,7 +2418,7 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
Ok(())
}
fn feed_local(&mut self, _ty: WpType, n: usize) -> Result<(), CodegenError> {
fn feed_local(&mut self, _ty: WpType, n: usize, _loc: u32) -> Result<(), CodegenError> {
self.num_locals += n;
Ok(())
}
@ -2515,7 +2528,12 @@ impl FunctionCodeGenerator<CodegenError> for X64FunctionCode {
Ok(())
}
fn feed_event(&mut self, ev: Event, module_info: &ModuleInfo) -> Result<(), CodegenError> {
fn feed_event(
&mut self,
ev: Event,
module_info: &ModuleInfo,
_loc: u32,
) -> Result<(), CodegenError> {
let a = self.assembler.as_mut().unwrap();
match ev {