OK, I think I have a plan... I've never touched LLVM before though, so it's 
taking me a while to hack it.

Here are the changes I'm proposing for library_async.js (probably a bit 
early for a pull request):
  https://github.com/NWilson/emscripten/compare/kripken:incoming...asyncex

The main idea there is fairly simple: if an async_cb throws an exception, 
it can't bubble up normally to the catch in invoke_*, 
emscripten_async_resume needs to catch it and inject it into the parent 
async_cb. That callback will either re-throw it, or handle it from the 
"resume_point".

The proposed changes for emscripten-fastcomp are here (sketch only):
  
https://github.com/NWilson/emscripten-fastcomp/compare/kripken:incoming...asyncex

I've tried the writing the LLVM code for it, but it's giving me some 
assertion failures in the emscripten_postinvoke handler, so I think I've 
done it wrong; I've just committed a couple of comments to the schematic.

Hopefully once I've painfully stepped through the LLVM code some more, and 
worked out how it functions, I'll be able to fill in the blanks in 
LowerEmAsyncify.cpp. Any comments or help gratefully appreciated!

Nick

-- 
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