From 722a1704537f5407dfda7d3821c608c3f62287c7 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 17 Feb 2014 18:14:59 -0800 Subject: support reserved function pointers in fastcomp --- emcc | 1 - emscripten.py | 6 +++++- tests/test_core.py | 1 - 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/emcc b/emcc index f62e820c..491e8dff 100755 --- a/emcc +++ b/emcc @@ -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 -- cgit v1.2.3-18-g5258