Skip to content

Commit 442caa6

Browse files
committed
finalize function table masks for fastcomp
1 parent 132ab0f commit 442caa6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

emscripten.py

+9
Original file line numberDiff line numberDiff line change
@@ -793,6 +793,15 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None,
793793
#if DEBUG: print >> sys.stderr, "META", metadata
794794
#if DEBUG: print >> sys.stderr, "meminit", mem_init
795795

796+
# function table masks
797+
798+
table_sizes = {}
799+
for k, v in metadata['tables'].iteritems():
800+
table_sizes[k] = str(v.count(',')) # undercounts by one, but that is what we want
801+
funcs = re.sub(r"#FM_(\w+)#", lambda m: table_sizes[m.groups(0)[0]], funcs)
802+
803+
# js compiler
804+
796805
if DEBUG: logging.debug('emscript: js compiler glue')
797806

798807
# Integrate info from backend

0 commit comments

Comments
 (0)