aboutsummaryrefslogtreecommitdiff
path: root/snapshots
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-07-14 22:10:03 +0100
committerMichael Williamson <mike@zwobble.org>2023-07-14 22:10:14 +0100
commit3dfd0c6534584206d2f0bb6a88b56f7201d18197 (patch)
treee311694d0796f56ff88265f263eca9a6af405bea /snapshots
parent2e9b821350221fc2defa89e9c4ecefc1c273855b (diff)
Handle params when defining functions in WASM backend
Diffstat (limited to 'snapshots')
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:positionalAndNamedParamsAreDefined(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected87
1 files changed, 87 insertions, 0 deletions
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 <shed__runtime__alloc> <- env.shed__runtime__alloc
+ - memory[0] pages: initial=0 <- env.__linear_memory
+Function[2]:
+ - func[1] sig=0 <shed__function__f__0>
+ - func[2] sig=1 <f>
+Code[2]:
+ - func[1] size=37 <shed__function__f__0>
+ - func[2] size=47 <f>
+Custom:
+ - name: "linking"
+ - symbol table [count=3]
+ - 0: F <shed__runtime__alloc> func=0 [ undefined explicit_name binding=global vis=default ]
+ - 1: F <shed__function__f__0> func=1 [ binding=global vis=default ]
+ - 2: F <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 <shed__runtime__alloc>
+ - R_WASM_TABLE_INDEX_SLEB offset=0x000046(file=0x0000c7) symbol=1 <shed__function__f__0>
+Custom:
+ - name: "name"
+ - func[0] <shed__runtime__alloc>
+ - func[1] <shed__function__f__0>
+ - func[2] <f>
+ - func[1] local[0] <closurePointer__0>
+ - func[1] local[1] <local__param1__0>
+ - func[1] local[2] <local__param2__0>
+ - func[1] local[3] <local__paramA__0>
+ - func[1] local[4] <local__paramB__0>
+ - func[1] local[5] <local__a__0>
+ - func[1] local[6] <local__b__0>
+ - func[2] local[0] <local__b__0>
+ - func[2] local[1] <local__c__0>
+ - func[2] local[2] <local__a__0>
+ - func[2] local[3] <closurePointer__0>
+
+Code Disassembly:
+
+000087 func[1] <shed__function__f__0>:
+ 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 <closurePointer__0>
+ 000096: 28 02 04 | i32.load 2 4
+ 000099: 21 05 | local.set 5 <local__a__0>
+ 00009b: 20 00 | local.get 0 <closurePointer__0>
+ 00009d: 28 02 08 | i32.load 2 8
+ 0000a0: 21 06 | local.set 6 <local__b__0>
+ 0000a2: 20 05 | local.get 5 <local__a__0>
+ 0000a4: 20 01 | local.get 1 <local__param1__0>
+ 0000a6: 6a | i32.add
+ 0000a7: 20 03 | local.get 3 <local__paramA__0>
+ 0000a9: 6a | i32.add
+ 0000aa: 0f | return
+ 0000ab: 0b | end
+0000b1 func[2] <f>:
+ 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 <shed__runtime__alloc>
+ 0000c2: 21 03 | local.set 3 <closurePointer__0>
+ 0000c4: 20 03 | local.get 3 <closurePointer__0>
+ 0000c6: 41 80 80 80 80 00 | i32.const 0
+ 0000cc: 36 02 00 | i32.store 2 0
+ 0000cf: 20 03 | local.get 3 <closurePointer__0>
+ 0000d1: 20 02 | local.get 2 <local__a__0>
+ 0000d3: 36 02 04 | i32.store 2 4
+ 0000d6: 20 03 | local.get 3 <closurePointer__0>
+ 0000d8: 20 00 | local.get 0 <local__b__0>
+ 0000da: 36 02 08 | i32.store 2 8
+ 0000dd: 20 03 | local.get 3 <closurePointer__0>
+ 0000df: 0b | end \ No newline at end of file