diff options
author | Jukka Jylänki <jujjyl@gmail.com> | 2014-04-12 22:43:35 +0300 |
---|---|---|
committer | Chad Austin <chad@chadaustin.me> | 2014-04-13 09:21:00 -0700 |
commit | 50bcf89f21c098aa54033733b33cb66c6c56d7ce (patch) | |
tree | cfdceb0eb343888252a712a392328e2a5d711a27 | |
parent | ce58885c11947bc4fb511646989c7d88212f69fa (diff) |
Export FUNCTION_TABLE_xxx entries to the global asm object for direct access. See issue #2249.
-rwxr-xr-x | emscripten.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/emscripten.py b/emscripten.py index c8122cb9..3d75335f 100755 --- a/emscripten.py +++ b/emscripten.py @@ -480,6 +480,7 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None, asm_runtime_funcs = ['stackAlloc', 'stackSave', 'stackRestore', 'setThrew'] + ['setTempRet%d' % i for i in range(10)] # function tables function_tables = ['dynCall_' + table for table in last_forwarded_json['Functions']['tables']] + function_tables_arrays = ['FUNCTION_TABLE_' + table for table in last_forwarded_json['Functions']['tables']] function_tables_impls = [] for sig in last_forwarded_json['Functions']['tables'].iterkeys(): @@ -516,7 +517,7 @@ def emscript(infile, settings, outfile, libraries=[], compiler_engine=None, exported_implemented_functions.append('runPostSets') exports = [] if not simple: - for export in exported_implemented_functions + asm_runtime_funcs + function_tables: + for export in exported_implemented_functions + asm_runtime_funcs + function_tables + function_tables_arrays: exports.append("%s: %s" % (export, export)) exports = '{ ' + ', '.join(exports) + ' }' else: @@ -1059,6 +1060,7 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, asm_runtime_funcs = ['stackAlloc', 'stackSave', 'stackRestore', 'setThrew'] + ['setTempRet%d' % i for i in range(10)] # function tables function_tables = ['dynCall_' + table for table in last_forwarded_json['Functions']['tables']] + function_tables_arrays = ['FUNCTION_TABLE_' + table for table in last_forwarded_json['Functions']['tables']] function_tables_impls = [] for sig in last_forwarded_json['Functions']['tables'].iterkeys(): @@ -1095,7 +1097,7 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, exported_implemented_functions.append('runPostSets') exports = [] if not simple: - for export in exported_implemented_functions + asm_runtime_funcs + function_tables: + for export in exported_implemented_functions + asm_runtime_funcs + function_tables + function_tables_arrays: exports.append("%s: %s" % (export, export)) exports = '{ ' + ', '.join(exports) + ' }' else: |