summaryrefslogtreecommitdiff
path: root/src/wasm.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@users.noreply.github.com>2016-08-11 21:02:33 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-08-11 21:02:33 -0700
commit1448c6bb26a60b26e70f7e913e56e0d0bf03b5da (patch)
tree6af5b7a0d34a7278a695112db41c1af1a45965c3 /src/wasm.cpp
parent8e8c311aaeecf9b5433e4a651585914465731f0c (diff)
downloadbinaryen-1448c6bb26a60b26e70f7e913e56e0d0bf03b5da.tar.gz
binaryen-1448c6bb26a60b26e70f7e913e56e0d0bf03b5da.tar.bz2
binaryen-1448c6bb26a60b26e70f7e913e56e0d0bf03b5da.zip
Implement asm.js style exception handling for Wasm (#664)
* Implement asm.js style exception handling for Wasm Converts invoke wrapper names generated by LLVM backend to real invoke wrapper names that are expected by JavaScript glue code. This is required to support wasm exception handling (asm.js style). LLVM backend lowers invoke @func(arg1, arg2) to label %invoke.cont unwind label %lpad into ... (some code) call @invoke_SIG(func, arg1, arg2) ... (some code) SIG is a mangled string generated based on the LLVM IR-level function signature. In LLVM IR, types are not lowered yet, so this mangling scheme simply takes LLVM's string representtion of parameter types and concatenate them with '_'. For example, the name of an invoke wrapper for function void foo(struct mystruct*, int) will be "__invoke_void_%struct.mystruct*_int". This function converts the names of invoke wrappers based on their lowered argument types and a return type. In the example above, the resulting new wrapper name becomes "invoke_vii". * Address comments Change variable names to camelcase Add a small (semi-)handwritten test case * Export malloc and free from wasm when available * Add a test case for exporting malloc/free feature + cosmetic 'file' name change in text_before_type.s * fixInvokeWrapper -> fixEmExceptionInvoke * Add a TODO
Diffstat (limited to 'src/wasm.cpp')
0 files changed, 0 insertions, 0 deletions