From 2ac63745004d385fd47599d658b03dcfbbc7b17d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Wed, 28 Jun 2023 00:18:06 +0100 Subject: Put linking section before name section --- ...mpiler.testing.snapshots.Snapshotter)].expected | 16 ++++++++-------- ...mpiler.testing.snapshots.Snapshotter)].expected | 8 ++++---- ...mpiler.testing.snapshots.Snapshotter)].expected | 14 +++++++------- ...mpiler.testing.snapshots.Snapshotter)].expected | 22 +++++++++++----------- ...mpiler.testing.snapshots.Snapshotter)].expected | 6 +++--- ...mpiler.testing.snapshots.Snapshotter)].expected | 8 ++++---- ...mpiler.testing.snapshots.Snapshotter)].expected | 8 ++++---- ...mpiler.testing.snapshots.Snapshotter)].expected | 8 ++++---- ...mpiler.testing.snapshots.Snapshotter)].expected | 6 +++--- ...mpiler.testing.snapshots.Snapshotter)].expected | 6 +++--- ...mpiler.testing.snapshots.Snapshotter)].expected | 6 +++--- ...mpiler.testing.snapshots.Snapshotter)].expected | 6 +++--- ...mpiler.testing.snapshots.Snapshotter)].expected | 6 +++--- ...mpiler.testing.snapshots.Snapshotter)].expected | 6 +++--- ...mpiler.testing.snapshots.Snapshotter)].expected | 6 +++--- ...mpiler.testing.snapshots.Snapshotter)].expected | 4 ++-- ...mpiler.testing.snapshots.Snapshotter)].expected | 4 ++-- ...mpiler.testing.snapshots.Snapshotter)].expected | 10 +++++----- ...mpiler.testing.snapshots.Snapshotter)].expected | 8 ++++---- ...mpiler.testing.snapshots.Snapshotter)].expected | 10 +++++----- ...mpiler.testing.snapshots.Snapshotter)].expected | 8 ++++---- ...mpiler.testing.snapshots.Snapshotter)].expected | 8 ++++---- ...mpiler.testing.snapshots.Snapshotter)].expected | 10 +++++----- ...mpiler.testing.snapshots.Snapshotter)].expected | 4 ++-- ...mpiler.testing.snapshots.Snapshotter)].expected | 4 ++-- ...mpiler.testing.snapshots.Snapshotter)].expected | 4 ++-- ...mpiler.testing.snapshots.Snapshotter)].expected | 4 ++-- ...mpiler.testing.snapshots.Snapshotter)].expected | 4 ++-- ...mpiler.testing.snapshots.Snapshotter)].expected | 10 +++++----- .../structure/binary/WasmBinaryFormatModules.java | 2 +- 30 files changed, 113 insertions(+), 113 deletions(-) diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 1a62ea62..045732f0 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenCallTests]/[method:canCallFunctionWithArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -13,14 +13,6 @@ Function[1]: - func[0] sig=1 Code[1]: - func[0] size=44 -Custom: - - name: "name" - - func[0] - - func[0] local[0] - - func[0] local[1] - - func[0] local[2] - - func[0] local[3] - - func[0] local[4] Custom: - name: "linking" - symbol table [count=1] @@ -29,6 +21,14 @@ Custom: - name: "reloc.CODE" - relocations for section: 3 (Code) [1] - R_WASM_TYPE_INDEX_LEB offset=0x00002b(file=0x000090) type=0 +Custom: + - name: "name" + - func[0] + - func[0] local[0] + - func[0] local[1] + - func[0] local[2] + - func[0] local[3] + - func[0] local[4] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index bdeb7cec..8e41f9b3 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenCallTests]/[method:canCallFunctionWithNoArgs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -13,10 +13,6 @@ Function[1]: - func[0] sig=1 Code[1]: - func[0] size=20 -Custom: - - name: "name" - - func[0] - - func[0] local[0] Custom: - name: "linking" - symbol table [count=1] @@ -25,6 +21,10 @@ Custom: - name: "reloc.CODE" - relocations for section: 3 (Code) [1] - R_WASM_TYPE_INDEX_LEB offset=0x000013(file=0x000078) type=0 +Custom: + - name: "name" + - func[0] + - func[0] local[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index e0f30646..2b159ad8 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:canDefineMinimalFunction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -16,13 +16,6 @@ Function[2]: Code[2]: - func[1] size=5 - func[2] size=27 -Custom: - - name: "name" - - func[0] - - func[1] - - func[2] - - func[1] local[0] - - func[2] local[0] Custom: - name: "linking" - symbol table [count=3] @@ -34,6 +27,13 @@ Custom: - relocations for section: 3 (Code) [2] - R_WASM_FUNCTION_INDEX_LEB offset=0x000016(file=0x000097) symbol=0 - R_WASM_TABLE_INDEX_SLEB offset=0x000020(file=0x0000a1) symbol=1 +Custom: + - name: "name" + - func[0] + - func[1] + - func[2] + - func[1] local[0] + - func[2] local[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:freeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:freeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index f0e26329..ec34c83b 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:freeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDefineFunctionTests]/[method:freeVariablesAreStoredInAndLoadedFromEnvironment(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -16,6 +16,17 @@ Function[2]: Code[2]: - func[1] size=23 - 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=0x00002e(file=0x0000af) symbol=0 + - R_WASM_TABLE_INDEX_SLEB offset=0x000038(file=0x0000b9) symbol=1 Custom: - name: "name" - func[0] @@ -28,17 +39,6 @@ Custom: - func[2] local[1] - func[2] local[2] - func[2] local[3] -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=0x00002e(file=0x0000af) symbol=0 - - R_WASM_TABLE_INDEX_SLEB offset=0x000038(file=0x0000b9) symbol=1 Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDiscardTests]/[method:discardCompilesToDrop(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDiscardTests]/[method:discardCompilesToDrop(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 2b68d4b9..6aac3c72 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDiscardTests]/[method:discardCompilesToDrop(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenDiscardTests]/[method:discardCompilesToDrop(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,13 +12,13 @@ Function[1]: - func[0] sig=0 Code[1]: - func[0] size=3 -Custom: - - name: "name" - - func[0] Custom: - name: "linking" - symbol table [count=1] - 0: F func=0 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenLocalLoadTests]/[method:localLoadCompilesToLocalGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenLocalLoadTests]/[method:localLoadCompilesToLocalGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index da1552f0..285fad62 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenLocalLoadTests]/[method:localLoadCompilesToLocalGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenLocalLoadTests]/[method:localLoadCompilesToLocalGet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,16 +12,16 @@ Function[1]: - func[0] sig=0 Code[1]: - func[0] size=10 +Custom: + - name: "linking" + - symbol table [count=1] + - 0: F func=0 [ binding=global vis=default ] Custom: - name: "name" - func[0] - func[0] local[0] - func[0] local[1] - func[0] local[2] -Custom: - - name: "linking" - - symbol table [count=1] - - 0: F func=0 [ binding=global vis=default ] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenLocalStoreTests]/[method:localStoreCompilesToLocalSet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenLocalStoreTests]/[method:localStoreCompilesToLocalSet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 55650ae8..6a1ead86 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenLocalStoreTests]/[method:localStoreCompilesToLocalSet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenLocalStoreTests]/[method:localStoreCompilesToLocalSet(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,14 +12,14 @@ Function[1]: - func[0] sig=0 Code[1]: - func[0] size=6 -Custom: - - name: "name" - - func[0] - - func[0] local[0] Custom: - name: "linking" - symbol table [count=1] - 0: F func=0 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] + - func[0] local[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenNamespaceFieldStoreTests]/[method:namespaceFieldStorePopsFromStackAndUpdatesFieldOnNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenNamespaceFieldStoreTests]/[method:namespaceFieldStorePopsFromStackAndUpdatesFieldOnNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 141c48ad..60eb3352 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenNamespaceFieldStoreTests]/[method:namespaceFieldStorePopsFromStackAndUpdatesFieldOnNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenNamespaceFieldStoreTests]/[method:namespaceFieldStorePopsFromStackAndUpdatesFieldOnNamespace(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -15,10 +15,6 @@ Code[1]: Data[1]: - segment[0] <.data> memory=0 size=12 - init i32=0 - 0000000: 0000 0000 0000 0000 0000 0000 ............ -Custom: - - name: "name" - - func[0] - - func[0] local[0] Custom: - name: "linking" - segment info [count=1] @@ -30,6 +26,10 @@ Custom: - name: "reloc.CODE" - relocations for section: 3 (Code) [1] - R_WASM_MEMORY_ADDR_SLEB offset=0x00000c(file=0x00006c) symbol=1 +Custom: + - name: "name" + - func[0] + - func[0] local[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushBoolTests]/[method:pushFalseIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushBoolTests]/[method:pushFalseIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 0606bd55..e7b90dc6 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushBoolTests]/[method:pushFalseIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushBoolTests]/[method:pushFalseIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,13 +12,13 @@ Function[1]: - func[0] sig=0 Code[1]: - func[0] size=4 -Custom: - - name: "name" - - func[0] Custom: - name: "linking" - symbol table [count=1] - 0: F func=0 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushBoolTests]/[method:pushTrueIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushBoolTests]/[method:pushTrueIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 677cb60f..a9266337 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushBoolTests]/[method:pushTrueIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushBoolTests]/[method:pushTrueIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,13 +12,13 @@ Function[1]: - func[0] sig=0 Code[1]: - func[0] size=4 -Custom: - - name: "name" - - func[0] Custom: - name: "linking" - symbol table [count=1] - 0: F func=0 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushIntTests]/[method:pushIntIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushIntTests]/[method:pushIntIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 403f3c05..9f89e279 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushIntTests]/[method:pushIntIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushIntTests]/[method:pushIntIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,13 +12,13 @@ Function[1]: - func[0] sig=0 Code[1]: - func[0] size=4 -Custom: - - name: "name" - - func[0] Custom: - name: "linking" - symbol table [count=1] - 0: F func=0 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushStringTests]/[method:canHaveMultipleStrings(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushStringTests]/[method:canHaveMultipleStrings(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index b23c9e83..0bc8c636 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushStringTests]/[method:canHaveMultipleStrings(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushStringTests]/[method:canHaveMultipleStrings(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -16,9 +16,6 @@ Data[1]: - segment[0] <.data> memory=0 size=21 - init i32=0 - 0000000: 0000 0005 6865 6c6c 6f00 0000 0000 0005 ....hello....... - 0000010: 776f 726c 64 world -Custom: - - name: "name" - - func[0] Custom: - name: "linking" - segment info [count=1] @@ -32,6 +29,9 @@ Custom: - relocations for section: 3 (Code) [2] - R_WASM_MEMORY_ADDR_SLEB offset=0x000008(file=0x000068) symbol=1 - R_WASM_MEMORY_ADDR_SLEB offset=0x00000e(file=0x00006e) symbol=2 +Custom: + - name: "name" + - func[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushStringTests]/[method:pushStringIsCompiledToDataAndIndexToData(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushStringTests]/[method:pushStringIsCompiledToDataAndIndexToData(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 8b897e0d..914b6ce4 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushStringTests]/[method:pushStringIsCompiledToDataAndIndexToData(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushStringTests]/[method:pushStringIsCompiledToDataAndIndexToData(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -15,9 +15,6 @@ Code[1]: Data[1]: - segment[0] <.data> memory=0 size=9 - init i32=0 - 0000000: 0000 0005 6865 6c6c 6f ....hello -Custom: - - name: "name" - - func[0] Custom: - name: "linking" - segment info [count=1] @@ -29,6 +26,9 @@ Custom: - name: "reloc.CODE" - relocations for section: 3 (Code) [1] - R_WASM_MEMORY_ADDR_SLEB offset=0x000008(file=0x000068) symbol=1 +Custom: + - name: "name" + - func[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushUnitTests]/[method:pushUnitIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushUnitTests]/[method:pushUnitIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 0606bd55..e7b90dc6 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushUnitTests]/[method:pushUnitIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenPushUnitTests]/[method:pushUnitIsCompiledToOperandInStack(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,13 +12,13 @@ Function[1]: - func[0] sig=0 Code[1]: - func[0] size=4 -Custom: - - name: "name" - - func[0] Custom: - name: "linking" - symbol table [count=1] - 0: F func=0 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenReturnTests]/[method:returnCompilesToReturnInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenReturnTests]/[method:returnCompilesToReturnInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 86ad8060..4ceb9ac1 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenReturnTests]/[method:returnCompilesToReturnInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.WasmCodeGenReturnTests]/[method:returnCompilesToReturnInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,13 +12,13 @@ Function[1]: - func[0] sig=0 Code[1]: - func[0] size=3 -Custom: - - name: "name" - - func[0] Custom: - name: "linking" - symbol table [count=1] - 0: F func=0 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeEmptyModule(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeEmptyModule(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 340b1609..cb06a6f7 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeEmptyModule(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeEmptyModule(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -3,9 +3,9 @@ module.wasm: file format wasm 0x1 Section Details: -Custom: - - name: "name" Custom: - name: "linking" +Custom: + - name: "name" Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithDataSegments(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithDataSegments(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index eadaac30..131f4676 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithDataSegments(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithDataSegments(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -10,8 +10,6 @@ Data[2]: - 0000000: 0102 0304 .... - segment[1] <.rodata> memory=0 size=4 - init i32=4 - 0000004: 0405 0607 .... -Custom: - - name: "name" Custom: - name: "linking" - segment info [count=2] @@ -21,5 +19,7 @@ Custom: - 0: D segment=0 offset=0 size=2 [ binding=global vis=default ] - 1: D segment=0 offset=2 size=2 [ binding=global vis=default ] - 2: D segment=1 offset=0 size=4 [ binding=global vis=default ] +Custom: + - name: "name" Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithElementSegments(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithElementSegments(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 659781e1..e807b3e9 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithElementSegments(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithElementSegments(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -19,17 +19,17 @@ Code[3]: - func[0] size=2 - func[1] size=2 - func[2] size=2 -Custom: - - name: "name" - - func[0] - - func[1] - - func[2] Custom: - name: "linking" - symbol table [count=3] - 0: F func=0 [ binding=global vis=default ] - 1: F func=1 [ binding=global vis=default ] - 2: F func=2 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] + - func[1] + - func[2] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithFunctionImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithFunctionImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 640d7d80..41e847fc 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithFunctionImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithFunctionImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -9,14 +9,14 @@ Type[2]: Import[2]: - func[0] sig=0 <- ModuleName1.EntityName1 - func[1] sig=1 <- ModuleName2.EntityName2 -Custom: - - name: "name" - - func[0] - - func[1] Custom: - name: "linking" - symbol table [count=2] - 0: F func=0 [ undefined explicit_name binding=global vis=default ] - 1: F func=1 [ undefined explicit_name binding=global vis=default ] +Custom: + - name: "name" + - func[0] + - func[1] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithFunctions(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithFunctions(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 6cc896e6..a846fad6 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithFunctions(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithFunctions(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,6 +12,11 @@ Function[2]: Code[2]: - func[0] size=8 - func[1] size=6 +Custom: + - name: "linking" + - symbol table [count=2] + - 0: F func=0 [ binding=global vis=default ] + - 1: F func=1 [ binding=global vis=default ] Custom: - name: "name" - func[0] @@ -22,11 +27,6 @@ Custom: - func[0] local[3] - func[1] local[0] - func[1] local[1] -Custom: - - name: "linking" - - symbol table [count=2] - - 0: F func=0 [ binding=global vis=default ] - - 1: F func=1 [ binding=global vis=default ] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithGlobalImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithGlobalImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 95cb2134..ef15199b 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithGlobalImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithGlobalImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -6,14 +6,14 @@ Section Details: Import[2]: - global[0] i32 mutable=1 <- ModuleName1.EntityName1 - global[1] i64 mutable=0 <- ModuleName2.EntityName2 -Custom: - - name: "name" - - global[0] - - global[1] Custom: - name: "linking" - symbol table [count=2] - 0: G global=0 [ undefined explicit_name binding=global vis=default ] - 1: G global=1 [ undefined explicit_name binding=global vis=default ] +Custom: + - name: "name" + - global[0] + - global[1] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithGlobals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithGlobals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 6e1ab2a7..c5d8ef4c 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithGlobals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithGlobals(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -6,14 +6,14 @@ Section Details: Global[2]: - global[0] i32 mutable=1 - init i32=7 - global[1] i64 mutable=0 - init i64=9 -Custom: - - name: "name" - - global[0] - - global[1] Custom: - name: "linking" - symbol table [count=2] - 0: G global=0 [ binding=global vis=default ] - 1: G global=1 [ binding=global vis=default ] +Custom: + - name: "name" + - global[0] + - global[1] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithInitFuncs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithInitFuncs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 3a116975..1acd85c1 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithInitFuncs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithInitFuncs(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -13,11 +13,6 @@ Code[3]: - func[0] size=2 - func[1] size=2 - func[2] size=2 -Custom: - - name: "name" - - func[0] - - func[1] - - func[2] Custom: - name: "linking" - symbol table [count=3] @@ -27,6 +22,11 @@ Custom: - init functions [count=2] - 2: priority=0 - 0: priority=4 +Custom: + - name: "name" + - func[0] + - func[1] + - func[2] Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithMemories(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithMemories(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 8b870190..219d44b4 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithMemories(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithMemories(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -5,9 +5,9 @@ Section Details: Memory[1]: - memory[0] pages: initial=1 -Custom: - - name: "name" Custom: - name: "linking" +Custom: + - name: "name" Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithMemoryImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithMemoryImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 6a59736f..1056e9f6 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithMemoryImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithMemoryImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -5,9 +5,9 @@ Section Details: Import[1]: - memory[0] pages: initial=1 <- ModuleName1.EntityName1 -Custom: - - name: "name" Custom: - name: "linking" +Custom: + - name: "name" Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTableImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTableImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 67836ea0..81acd316 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTableImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTableImports(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -6,9 +6,9 @@ Section Details: Import[2]: - table[0] type=externref initial=1 <- ModuleName1.EntityName1 - table[1] type=funcref initial=2 max=5 <- ModuleName2.EntityName2 -Custom: - - name: "name" Custom: - name: "linking" +Custom: + - name: "name" Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTables(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTables(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index cf945e0d..5d8e2af5 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTables(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTables(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -6,9 +6,9 @@ Section Details: Table[2]: - table[0] type=funcref initial=1 - table[1] type=externref initial=2 max=3 -Custom: - - name: "name" Custom: - name: "linking" +Custom: + - name: "name" Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTypes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTypes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 9434e657..0bac0740 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTypes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:canSerializeModuleWithTypes(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -6,9 +6,9 @@ Section Details: Type[2]: - type[0] () -> nil - type[1] (i32, i64) -> (f32, f64) -Custom: - - name: "name" Custom: - name: "linking" +Custom: + - name: "name" Code Disassembly: diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:localNamesHaveCorrectFuncIndexWhenThereAreImportedFunctions(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:localNamesHaveCorrectFuncIndexWhenThereAreImportedFunctions(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected index 1104ee19..f76a0a68 100644 --- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:localNamesHaveCorrectFuncIndexWhenThereAreImportedFunctions(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected +++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.backends.wasm.structure.WasmBinaryFormatModuleTests]/[method:localNamesHaveCorrectFuncIndexWhenThereAreImportedFunctions(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected @@ -12,16 +12,16 @@ Function[1]: - func[1] sig=0 Code[1]: - func[1] size=4 -Custom: - - name: "name" - - func[0] - - func[1] - - func[1] local[0] Custom: - name: "linking" - symbol table [count=2] - 0: F func=0 [ undefined explicit_name binding=global vis=default ] - 1: F func=1 [ binding=global vis=default ] +Custom: + - name: "name" + - func[0] + - func[1] + - func[1] local[0] Code Disassembly: diff --git a/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatModules.java b/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatModules.java index da479ca9..1709f78d 100644 --- a/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatModules.java +++ b/src/main/java/org/shedlang/compiler/backends/wasm/structure/binary/WasmBinaryFormatModules.java @@ -339,8 +339,8 @@ public class WasmBinaryFormatModules { writeElementSection(module, writer); writeCodeSection(module, writer); writeDataSection(module, writer); - writeNameSection(module, indexTable, writer); writeLinkingSections(module, writer); + writeNameSection(module, indexTable, writer); outputStream.write(writer.toBytes()); } -- cgit v1.2.3