From a88d9b83a4629f4bf4c3b210b07d11d2396c594d Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 28 Apr 2017 14:34:25 -0700 Subject: ctor evaller (#982) Add wasm-ctor-eval, which evaluates functions at compile time - typically static constructor functions - and applies their effects into memory, saving work at startup. If we encounter something we can't evaluate at compile time in our interpreter, stop there. This is similar to ctor_evaller.py in emscripten (which was for asm.js). --- auto_update_tests.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'auto_update_tests.py') diff --git a/auto_update_tests.py b/auto_update_tests.py index 76cd02cbb..9eb0fb50c 100755 --- a/auto_update_tests.py +++ b/auto_update_tests.py @@ -226,4 +226,17 @@ for s in sorted(os.listdir(os.path.join('test', 'binaryen.js'))): out = run_command(cmd, stderr=subprocess.STDOUT) open(os.path.join('test', 'binaryen.js', s + '.txt'), 'w').write(out) +print '\n[ checking wasm-ctor-eval... ]\n' + +for t in os.listdir(os.path.join('test', 'ctor-eval')): + if t.endswith(('.wast', '.wasm')): + print '..', t + t = os.path.join('test', 'ctor-eval', t) + ctors = open(t + '.ctors').read().strip() + cmd = [os.path.join('bin', 'wasm-ctor-eval'), t, '-o', 'a.wast', '-S', '--ctors', ctors] + stdout = run_command(cmd) + actual = open('a.wast').read() + out = t + '.out' + with open(out, 'w') as o: o.write(actual) + print '\n[ success! ]' -- cgit v1.2.3