diff options
author | Alon Zakai <alonzakai@gmail.com> | 2014-02-17 18:14:59 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2014-02-17 18:14:59 -0800 |
commit | 722a1704537f5407dfda7d3821c608c3f62287c7 (patch) | |
tree | f8819b87a2f25ffc37b9477ae357cef12d1b3c91 | |
parent | 775bd44ac40f4546fb912dcdf21c7a7f6e880d25 (diff) |
support reserved function pointers in fastcomp
-rwxr-xr-x | emcc | 1 | ||||
-rwxr-xr-x | emscripten.py | 6 | ||||
-rw-r--r-- | tests/test_core.py | 1 |
3 files changed, 5 insertions, 3 deletions
@@ -1207,7 +1207,6 @@ try: assert shared.Settings.UNALIGNED_MEMORY == 0, 'forced unaligned memory not supported in fastcomp' assert shared.Settings.CHECK_HEAP_ALIGN == 0, 'check heap align not supported in fastcomp yet' assert shared.Settings.SAFE_DYNCALLS == 0, 'safe dyncalls not supported in fastcomp' - assert shared.Settings.RESERVED_FUNCTION_POINTERS == 0, 'reserved function pointers not supported in fastcomp' assert shared.Settings.ASM_HEAP_LOG == 0, 'asm heap log not supported in fastcomp' assert shared.Settings.LABEL_DEBUG == 0, 'label debug not supported in fastcomp' assert shared.Settings.EXECUTION_TIMEOUT == -1, 'execution timeout not supported in fastcomp' diff --git a/emscripten.py b/emscripten.py index a1b6a606..e90cce2a 100755 --- a/emscripten.py +++ b/emscripten.py @@ -744,6 +744,8 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, backend_args += ['-emscripten-precise-f32'] if settings['WARN_UNALIGNED']: backend_args += ['-emscripten-warn-unaligned'] + if settings['RESERVED_FUNCTION_POINTERS'] > 0: + backend_args += ['-emscripten-reserved-function-pointers=%d' % settings['RESERVED_FUNCTION_POINTERS']] if DEBUG: logging.debug('emscript: llvm backend: ' + ' '.join(backend_args)) t = time.time() @@ -932,7 +934,9 @@ def emscript_fast(infile, settings, outfile, libraries=[], compiler_engine=None, end = raw.rindex(']') body = raw[start+1:end].split(',') for j in range(settings['RESERVED_FUNCTION_POINTERS']): - body[settings['FUNCTION_POINTER_ALIGNMENT'] * (1 + j)] = 'jsCall_%s_%s' % (sig, j) + curr = 'jsCall_%s_%s' % (sig, j) + body[settings['FUNCTION_POINTER_ALIGNMENT'] * (1 + j)] = curr + implemented_functions.add(curr) Counter.j = 0 def fix_item(item): Counter.j += 1 diff --git a/tests/test_core.py b/tests/test_core.py index 949afd1b..c3361bcb 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -5492,7 +5492,6 @@ def process(filename): def test_add_function(self): if self.emcc_args is None: return self.skip('requires emcc') - if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp') Settings.INVOKE_RUN = 0 Settings.RESERVED_FUNCTION_POINTERS = 1 |