diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-01-15 17:01:19 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-01-15 17:01:19 -0800 |
commit | c42b937808924f6b922b29d2e0fd1fe1d1b0411c (patch) | |
tree | 4027d435b6638a7e72b9519990298fb9314ecc96 /emscripten.py | |
parent | 8478d6aee54d6c52de16d8c58309534afbf5bf9e (diff) | |
parent | e5ccf17e84e7a5102bf9e05ffef01e6672b4c15a (diff) |
Merge branch 'incoming'
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/emscripten.py b/emscripten.py index 42db0803..befad8d5 100755 --- a/emscripten.py +++ b/emscripten.py @@ -804,6 +804,9 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, map(lambda x: x[1:], metadata['implementedFunctions']) ) ) + map(lambda x: x[1:], metadata['externs']) + if metadata['simd']: + settings['SIMD'] = 1 + settings['ASM_JS'] = 2 # Save settings to a file to work around v8 issue 1579 settings_file = temp_files.get('.txt').name @@ -869,6 +872,11 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, for key in metadata['implementedFunctions'] + forwarded_json['Functions']['implementedFunctions'].keys(): # XXX perf if key in all_exported_functions or export_all or (export_bindings and key.startswith('_emscripten_bind')): exported_implemented_functions.add(key) + implemented_functions = set(metadata['implementedFunctions']) + + # Add named globals + named_globals = '\n'.join(['var %s = %s;' % (k, v) for k, v in metadata['namedGlobals'].iteritems()]) + pre = pre.replace('// === Body ===', '// === Body ===\n' + named_globals + '\n') #if DEBUG: outfile.write('// pre\n') outfile.write(pre) @@ -918,7 +926,7 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, Counter.j += 1 newline = Counter.j % 30 == 29 if item == '0': return bad if not newline else (bad + '\n') - if item not in metadata['implementedFunctions']: + if item not in implemented_functions: # this is imported into asm, we must wrap it call_ident = item if call_ident in metadata['redirects']: call_ident = metadata['redirects'][call_ident] @@ -1018,7 +1026,7 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, pass # If no named globals, only need externals global_vars = metadata['externs'] #+ forwarded_json['Variables']['globals'] - global_funcs = list(set(['_' + key for key, value in forwarded_json['Functions']['libraryFunctions'].iteritems() if value != 2]).difference(set(global_vars)).difference(set(metadata['implementedFunctions']))) + global_funcs = list(set(['_' + key for key, value in forwarded_json['Functions']['libraryFunctions'].iteritems() if value != 2]).difference(set(global_vars)).difference(implemented_functions)) def math_fix(g): return g if not g.startswith('Math_') else g.split('_')[1] asm_global_funcs = ''.join([' var ' + g.replace('.', '_') + '=global.' + g + ';\n' for g in maths]) + \ |