diff --git a/src/function_body.rs b/src/function_body.rs index 1796f2b77f..52efc81df1 100644 --- a/src/function_body.rs +++ b/src/function_body.rs @@ -26,6 +26,8 @@ impl Block { } } +const DISASSEMBLE: bool = false; + pub fn translate_wasm( session: &mut CodeGenSession, func_idx: u32, @@ -36,7 +38,7 @@ where { let ty = session.module_context.func_type(func_idx); - if false { + if DISASSEMBLE { let mut microwasm = vec![]; let microwasm_conv = MicrowasmConv::new( diff --git a/src/translate_sections.rs b/src/translate_sections.rs index effe78568e..a163e1980f 100644 --- a/src/translate_sections.rs +++ b/src/translate_sections.rs @@ -112,40 +112,17 @@ pub fn code( ) -> Result { let func_count = code.get_count(); let mut session = CodeGenSession::new(func_count, translation_ctx); + for (idx, body) in code.into_iter().enumerate() { let body = body?; - if true { - let mut microwasm = vec![]; - - let mut microwasm_conv = MicrowasmConv::new( - translation_ctx, - translation_ctx - .func_type(idx as _) - .params - .iter() - .map(|t| MWType::from_wasm(*t).unwrap()), - translation_ctx - .func_type(idx as _) - .returns - .iter() - .map(|t| MWType::from_wasm(*t).unwrap()), - &body, - ); - - for ops in microwasm_conv { - microwasm.extend(ops?); - } - - println!("{}", crate::microwasm::dis(idx, µwasm)); - } - function_body::translate_wasm( &mut session, idx as u32, &body, )?; } + Ok(session.into_translated_code_section()?) }