Currently enabling exception handling support lead to increase in size of 
optimized build (asm.js as well as wasm) by about 33% in our codebase.

(1) Will the planned Zero cost exception support in wasm shave off a 
significant size from the wasm file ?

(2) With regard to asm.js, are there ways to decrease the codesize bloat 
with regard to exception handling -

(a) One way could be to replace try, throw and catch in construct C++ code 
with equivalent sequential error handling construct. But then 
emscripten/clang toolchain would already be optimized to do the same in 
automated manner.

(b) Identifying the errors in applications which are gracefully handled and 
enable exception handling only for those workflows. This is generally 
error-prone and not maintainable way since sometimes fatal error like 
out_of_memory could be potentially handled (by freeing C++ memory or not 
performing a specific task). 
I looked at EXCEPTION_CATCHING_WHITELIST with disable exception catching = 
2 option but it appeared to be not working (throwing in try block)
em++ whitelist.cpp -O1 -s DISABLE_EXCEPTION_CATCHING=2 -s 
EXCEPTION_CATCHING_WHITELIST='["_main"]' -o whitelist.js 

> #include <stdio.h>
> int main(void) {
>  try {
>  throw 5;
>  }
>  catch (...) {
>  printf("SUCCESS\n"); //not printed
>  }
>  return 0;
> }
>
> I guess, even if it worked - it would not catch exceptions from nested 
function (or function pointer) calls. So it may not be that useful.

(c) Any other way to solve "this" size bloat ?

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to