Compile a simple function (#2)
* Implement basics. * Execute code * Add wasm2wat test cases. * abi_loc_for_arg for stack. * Assert that sp_depth is 0 at the epilogue * Do 32bit add. * Assert that RAX can be used as a scratch register * Reuse assembler. * Align stack slots.
This commit is contained in:
committed by
Dan Gohman
parent
d3bc26bc93
commit
08240761d5
@@ -21,7 +21,10 @@ fn read_to_end<P: AsRef<Path>>(path: P) -> io::Result<Vec<u8>> {
|
||||
|
||||
fn maybe_main() -> Result<(), String> {
|
||||
let data = read_to_end("test.wasm").map_err(|e| e.to_string())?;
|
||||
translate(&data).map_err(|e| e.to_string())?;
|
||||
let translated = translate(&data).map_err(|e| e.to_string())?;
|
||||
let result = translated.execute_func(0, 5, 3);
|
||||
println!("f(5, 3) = {}", result);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user