diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-05-03 12:09:37 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-05-03 12:29:23 -0700 |
commit | 77aa2a72f38d73e71eef48cacfe72cce33fc7201 (patch) | |
tree | 6dd3e801732e0aa3307e2af370eabd1c8570e207 /emscripten.py | |
parent | 2308587a85de571844e71e574fcc63c7955d6012 (diff) |
emit a global const for Math_fround(0) to avoid function call overheads in the fround polyfill
Diffstat (limited to 'emscripten.py')
-rwxr-xr-x | emscripten.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/emscripten.py b/emscripten.py index bf55ee43..16f9eb33 100755 --- a/emscripten.py +++ b/emscripten.py @@ -1165,7 +1165,7 @@ var asm = (function(global, env, buffer) { var nan = +env.NaN, inf = +env.Infinity; var tempInt = 0, tempBigInt = 0, tempBigIntP = 0, tempBigIntS = 0, tempBigIntR = 0.0, tempBigIntI = 0, tempBigIntD = 0, tempValue = 0, tempDouble = 0.0; ''' + ''.join([''' - var tempRet%d = 0;''' % i for i in range(10)]) + '\n' + asm_global_funcs] + [' var tempFloat = %s;\n' % ('Math_fround(0)' if settings.get('PRECISE_F32') else '0.0')] + [''' + var tempRet%d = 0;''' % i for i in range(10)]) + '\n' + asm_global_funcs] + [' var tempFloat = %s;\n' % ('Math_fround(0)' if settings.get('PRECISE_F32') else '0.0')] + ([' const f0 = Math_fround(0);\n'] if settings.get('PRECISE_F32') else []) + [''' // EMSCRIPTEN_START_FUNCS function stackAlloc(size) { size = size|0; |