diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-02-05 18:26:02 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-02-05 18:26:02 -0800 |
commit | 5a99d2567e76f257309cfd225876f3a5402e5f46 (patch) | |
tree | 4017c62d53033d3cdfb1cdeb26529190d58784b2 /emscripten.py | |
parent | ac0972ebf6cb8ff17f1bbbf01526d29fd2d2f420 (diff) | |
parent | 9aa7bbf6987cad3cff53906c5d6a6e77b6bd5b9c (diff) |
Merge branch 'incoming'
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py index 2ceb5e13..af762a21 100755 --- a/emscripten.py +++ b/emscripten.py @@ -321,12 +321,14 @@ def emscript(infile, settings, outfile, libraries=[]): infos = [make_table(sig, raw) for sig, raw in last_forwarded_json['Functions']['tables'].iteritems()] function_tables_defs = '\n'.join([info[0] for info in infos] + [info[1] for info in infos]) + asm_setup = '' maths = ['Math.' + func for func in ['floor', 'abs', 'sqrt', 'pow', 'cos', 'sin', 'tan', 'acos', 'asin', 'atan', 'atan2', 'exp', 'log', 'ceil']] if settings['USE_MATH_IMUL']: maths += ['Math.imul'] + asm_setup += 'if (!Math.imul) Math.imul = function(x, y) { return (x*y)|0 }; // # not a real polyfill since semantics not identical, but close and fairly fast\n' fundamentals = ['Math', 'Int8Array', 'Int16Array', 'Int32Array', 'Uint8Array', 'Uint16Array', 'Uint32Array', 'Float32Array', 'Float64Array'] math_envs = ['Runtime.bitshift64', 'Math.min'] # TODO: move min to maths - asm_setup = '\n'.join(['var %s = %s;' % (f.replace('.', '_'), f) for f in math_envs]) + asm_setup += '\n'.join(['var %s = %s;' % (f.replace('.', '_'), f) for f in math_envs]) basic_funcs = ['abort', 'assert', 'asmPrintInt', 'asmPrintFloat', 'copyTempDouble', 'copyTempFloat'] + [m.replace('.', '_') for m in math_envs] if settings['SAFE_HEAP']: basic_funcs += ['SAFE_HEAP_LOAD', 'SAFE_HEAP_STORE', 'SAFE_HEAP_CLEAR'] basic_vars = ['STACKTOP', 'STACK_MAX', 'tempDoublePtr', 'ABORT'] |