aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-02 17:07:37 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-02-02 17:07:37 -0800
commita3632a129dad24511ecbd5694637d592c301a142 (patch)
treea06b23ce45178d3b893b7013b294279cb7b67159
parent23892d22563257494710bb81179d306db4b9fe10 (diff)
support EXCEPTION_CATCHING_WHITELIST in fastcomp
-rwxr-xr-xemcc4
-rw-r--r--src/settings.js4
-rw-r--r--tests/test_core.py5
3 files changed, 5 insertions, 8 deletions
diff --git a/emcc b/emcc
index d30966cd..3c427677 100755
--- a/emcc
+++ b/emcc
@@ -1206,8 +1206,10 @@ try:
jcache = False
fastcomp_opts = ['-pnacl-abi-simplify-preopt', '-pnacl-abi-simplify-postopt']
- if not shared.Settings.DISABLE_EXCEPTION_CATCHING:
+ if shared.Settings.DISABLE_EXCEPTION_CATCHING != 1:
fastcomp_opts += ['-enable-emscripten-cxx-exceptions']
+ if len(shared.Settings.EXCEPTION_CATCHING_WHITELIST) > 0:
+ fastcomp_opts += ['-emscripten-cxx-exceptions-whitelist=' + ','.join(shared.Settings.EXCEPTION_CATCHING_WHITELIST)]
if shared.Settings.ASM_JS:
assert opt_level >= 1 or fastcomp, 'asm.js requires -O1 or above'
diff --git a/src/settings.js b/src/settings.js
index 720fb53f..1cfb4030 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -251,8 +251,8 @@ var DISABLE_EXCEPTION_CATCHING = 0; // Disables generating code to actually catc
// TODO: Make this also remove cxa_begin_catch etc., optimize relooper
// for it, etc. (perhaps do all of this as preprocessing on .ll?)
-var EXCEPTION_CATCHING_WHITELIST = []; // Enables catching exception in listed functions if
- // DISABLE_EXCEPTION_CATCHING = 2 set
+var EXCEPTION_CATCHING_WHITELIST = []; // Enables catching exception in the listed functions only, if
+ // DISABLE_EXCEPTION_CATCHING = 2 is set
var EXECUTION_TIMEOUT = -1; // Throw an exception after X seconds - useful to debug infinite loops
var CHECK_OVERFLOWS = 0; // Add code that checks for overflows in integer math operations.
diff --git a/tests/test_core.py b/tests/test_core.py
index 74295e6f..979cda74 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -1288,20 +1288,15 @@ class T(RunnerCore): # Short name, to make it more fun to use manually on the co
self.do_run_from_file(src, output)
def test_exceptions_white_list(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
Settings.DISABLE_EXCEPTION_CATCHING = 2
Settings.EXCEPTION_CATCHING_WHITELIST = ["__Z12somefunctionv"]
Settings.INLINING_LIMIT = 50 # otherwise it is inlined and not identified
test_path = path_from_root('tests', 'core', 'test_exceptions_white_list')
src, output = (test_path + s for s in ('.in', '.out'))
-
self.do_run_from_file(src, output)
def test_exceptions_white_list_2(self):
- if os.environ.get('EMCC_FAST_COMPILER') == '1': return self.skip('todo in fastcomp')
-
Settings.DISABLE_EXCEPTION_CATCHING = 2
Settings.EXCEPTION_CATCHING_WHITELIST = ["_main"]
Settings.INLINING_LIMIT = 50 # otherwise it is inlined and not identified