aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-12-03 20:48:03 -0500
committerAlon Zakai <alonzakai@gmail.com>2013-12-03 20:48:03 -0500
commit442caa6c9509da663b601e9a5053c98f3cf8da15 (patch)
tree98c2a2f18813ab1c2c1e45549eb6becb6c76cf5b /emscripten.py
parent132ab0f5905209c33a9c6e8615e0a6dc197cca1d (diff)
finalize function table masks for fastcomp
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/emscripten.py b/emscripten.py
index f2081af7..8936aa3e 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -793,6 +793,15 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
#if DEBUG: print >> sys.stderr, "META", metadata
#if DEBUG: print >> sys.stderr, "meminit", mem_init
+ # function table masks
+
+ table_sizes = {}
+ for k, v in metadata['tables'].iteritems():
+ table_sizes[k] = str(v.count(',')) # undercounts by one, but that is what we want
+ funcs = re.sub(r"#FM_(\w+)#", lambda m: table_sizes[m.groups(0)[0]], funcs)
+
+ # js compiler
+
if DEBUG: logging.debug('emscript: js compiler glue')
# Integrate info from backend