summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-10-11 11:51:19 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-10-11 15:01:01 -0700
commit5e3f26285100854cead459effe409e250a6b4d2f (patch)
tree7dbc1e24c04d36a4da50bc6a7ff769f3665d3899
parent717bbe620aa36bc7b85040eade18b1a0300bcec4 (diff)
downloadbinaryen-5e3f26285100854cead459effe409e250a6b4d2f.tar.gz
binaryen-5e3f26285100854cead459effe409e250a6b4d2f.tar.bz2
binaryen-5e3f26285100854cead459effe409e250a6b4d2f.zip
update spidermonkify.py
-rw-r--r--scripts/spidermonkify.py19
1 files changed, 1 insertions, 18 deletions
diff --git a/scripts/spidermonkify.py b/scripts/spidermonkify.py
index b199faafc..69ad437f1 100644
--- a/scripts/spidermonkify.py
+++ b/scripts/spidermonkify.py
@@ -22,7 +22,6 @@ This is meant to be run using BINARYEN_SCRIPTS in emcc, and not standalone.
'''
import os
-import shutil
import subprocess
import sys
@@ -35,27 +34,11 @@ wast_target = sys.argv[2]
wasm_target = wast_target[:-5] + '.wasm'
-base_wast_target = os.path.basename(wast_target)
-base_wasm_target = os.path.basename(wasm_target)
-
-
-def fix(js, before, after):
- assert js.count(before) == 1
- return js.replace(before, after)
-
-# fix up js
-js = open(js_target).read()
-# use the wasm, not wast
-js = js.replace('"' + base_wast_target + '"', '"' + base_wasm_target + '"')
-js = js.replace("'" + base_wast_target + "'", "'" + base_wasm_target + "'")
-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"))))'
+new Uint8Array(wasmTextToBinary(os.file.readFile("a.out.wast"))))'
investigate with
>>> map(chr, map(ord, open('moz.wasm').read()))
or