diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-04-21 19:01:47 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-04-21 19:01:47 -0700 |
commit | a180c863ac4b6882f47e5e05ceeebe94b1208a7d (patch) | |
tree | d1e5591a6075f67359f792438f848cd15e834bc9 /scripts/spidermonkify.py | |
parent | 7b180b286a3df1a231454399869516ae8571d9bb (diff) | |
parent | 171668684ad91dc8d397ef411ce5fd337bc7a976 (diff) | |
download | binaryen-a180c863ac4b6882f47e5e05ceeebe94b1208a7d.tar.gz binaryen-a180c863ac4b6882f47e5e05ceeebe94b1208a7d.tar.bz2 binaryen-a180c863ac4b6882f47e5e05ceeebe94b1208a7d.zip |
Merge pull request #377 from WebAssembly/zero_x_b
More 0xb work
Diffstat (limited to 'scripts/spidermonkify.py')
-rw-r--r-- | scripts/spidermonkify.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/spidermonkify.py b/scripts/spidermonkify.py index d7b2ea138..9c99b4087 100644 --- a/scripts/spidermonkify.py +++ b/scripts/spidermonkify.py @@ -52,6 +52,16 @@ open(js_target, 'w').write(js) shutil.copyfile(wast_target + '.mappedGlobals', wasm_target + '.mappedGlobals') # convert to binary using spidermonkey +''' +using something like +mozjs -e 'os.file.writeTypedArrayToFile("moz.wasm", +new Uint8Array(wasmTextToBinary(os.file.readFile("test/hello_world.wast"))))' +investigate with +>>> map(chr, map(ord, open('moz.wasm').read())) +or +import json; print json.dumps(map(chr, +map(ord, open('moz.wasm').read()))).replace(',', '\n') +''' subprocess.check_call( emscripten.shared.SPIDERMONKEY_ENGINE + ['-e', 'os.file.writeTypedArrayToFile("' + wasm_target + |