From 3dfd0c6534584206d2f0bb6a88b56f7201d18197 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Fri, 14 Jul 2023 22:10:03 +0100 Subject: Handle params when defining functions in WASM backend --- ...mpiler.testing.snapshots.Snapshotter)].expected | 87 ++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected (limited to 'snapshots') diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected new file mode 100644 index 00000000..062f345e --- /dev/null +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -0,0 +1,87 @@ + +module.wasm: file format wasm 0x1 + +Section Details: + +Type[2]: + - type[0] (i32) -> i32 + - type[1] () -> nil +Import[3]: + - table[0] type=funcref initial=0 <- env.__indirect_function_table + - func[0] sig=0 <- env.shed__runtime__alloc + - memory[0] pages: initial=0 <- env.__linear_memory +Function[2]: + - func[1] sig=0 + - func[2] sig=1 +Code[2]: + - func[1] size=37 + - func[2] size=47 +Custom: + - name: "linking" + - symbol table [count=3] + - 0: F func=0 [ undefined explicit_name binding=global vis=default ] + - 1: F func=1 [ binding=global vis=default ] + - 2: F func=2 [ binding=global vis=default ] +Custom: + - name: "reloc.CODE" + - relocations for section: 3 (Code) [2] + - R_WASM_FUNCTION_INDEX_LEB offset=0x00003c(file=0x0000bd) symbol=0 + - R_WASM_TABLE_INDEX_SLEB offset=0x000046(file=0x0000c7) symbol=1 +Custom: + - name: "name" + - func[0] + - func[1] + - func[2] + - func[1] local[0] + - func[1] local[1] + - func[1] local[2] + - func[1] local[3] + - func[1] local[4] + - func[1] local[5] + - func[1] local[6] + - func[2] local[0] + - func[2] local[1] + - func[2] local[2] + - func[2] local[3] + +Code Disassembly: + +000087 func[1] : + 000088: 01 7f | local[0] type=i32 + 00008a: 01 7f | local[1] type=i32 + 00008c: 01 7f | local[2] type=i32 + 00008e: 01 7f | local[3] type=i32 + 000090: 01 7f | local[4] type=i32 + 000092: 01 7f | local[5] type=i32 + 000094: 20 00 | local.get 0 + 000096: 28 02 04 | i32.load 2 4 + 000099: 21 05 | local.set 5 + 00009b: 20 00 | local.get 0 + 00009d: 28 02 08 | i32.load 2 8 + 0000a0: 21 06 | local.set 6 + 0000a2: 20 05 | local.get 5 + 0000a4: 20 01 | local.get 1 + 0000a6: 6a | i32.add + 0000a7: 20 03 | local.get 3 + 0000a9: 6a | i32.add + 0000aa: 0f | return + 0000ab: 0b | end +0000b1 func[2] : + 0000b2: 01 7f | local[0] type=i32 + 0000b4: 01 7f | local[1] type=i32 + 0000b6: 01 7f | local[2] type=i32 + 0000b8: 01 7f | local[3] type=i32 + 0000ba: 41 0c | i32.const 12 + 0000bc: 10 80 80 80 80 00 | call 0 + 0000c2: 21 03 | local.set 3 + 0000c4: 20 03 | local.get 3 + 0000c6: 41 80 80 80 80 00 | i32.const 0 + 0000cc: 36 02 00 | i32.store 2 0 + 0000cf: 20 03 | local.get 3 + 0000d1: 20 02 | local.get 2 + 0000d3: 36 02 04 | i32.store 2 4 + 0000d6: 20 03 | local.get 3 + 0000d8: 20 00 | local.get 0 + 0000da: 36 02 08 | i32.store 2 8 + 0000dd: 20 03 | local.get 3 + 0000df: 0b | end \ No newline at end of file -- cgit v1.2.3