From f622b8e47c69dcbdf2666c795fb3658dc4da52af Mon Sep 17 00:00:00 2001 From: Thomas Lively Date: Wed, 29 May 2024 10:35:25 -0700 Subject: Use new wast parser in wasm2js (#6606) When generating assertions, traverse the `WASTScript` data structure rather than interleaving assertion parsing with emitting. --- test/wasm2js/func_ptrs.2asm.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'test/wasm2js/func_ptrs.2asm.js') diff --git a/test/wasm2js/func_ptrs.2asm.js b/test/wasm2js/func_ptrs.2asm.js index 4b7c4fd44..3e5c82e78 100644 --- a/test/wasm2js/func_ptrs.2asm.js +++ b/test/wasm2js/func_ptrs.2asm.js @@ -13,30 +13,30 @@ function asmFunc(imports) { var Math_sqrt = Math.sqrt; var spectest = imports.spectest; var print = spectest.print_i32; - function $3() { + function $2() { return 13 | 0; } - function $4($0) { + function $3($0) { $0 = $0 | 0; return $0 + 1 | 0 | 0; } - function $5(a) { + function $4(a) { a = a | 0; return a - 2 | 0 | 0; } - function $6($0) { + function $5($0) { $0 = $0 | 0; print($0 | 0); } return { - "one": $3, - "two": $4, - "three": $5, - "four": $6 + "one": $2, + "two": $3, + "three": $4, + "four": $5 }; } @@ -79,20 +79,20 @@ function asmFunc(imports) { return 5 | 0; } - function $5(i) { + function $0(i) { i = i | 0; return FUNCTION_TABLE[i | 0]() | 0 | 0; } - function $6(i) { + function $1(i) { i = i | 0; return FUNCTION_TABLE[i | 0]() | 0 | 0; } var FUNCTION_TABLE = [t1, t2, t3, u1, u2, t1, t3]; return { - "callt": $5, - "callu": $6 + "callt": $0, + "callu": $1 }; } @@ -120,14 +120,14 @@ function asmFunc(imports) { return 2 | 0; } - function $2(i) { + function $0(i) { i = i | 0; return FUNCTION_TABLE[i | 0]() | 0 | 0; } var FUNCTION_TABLE = [t1, t2]; return { - "callt": $2 + "callt": $0 }; } -- cgit v1.2.3