3 ms·
setjmp/longjmp works in emscripten, it does prevent some optimizations in functions where it is called though. But luckily it doesn't seem like it is called in
by azakai 13y ago
setjmp/longjmp works in emscripten, it does prevent some optimizations in functions where it is called though. But luckily it doesn't seem like it is called in anything performance-sensitive in the benchmarks I've tested.
- alayne 13y agoNot sure if this is related, but you often have to declare local variables volatile when using setjmp/longjmp because they do not preserve registers. It's one case where unoptimized C code will run fine, then -O will push variables into registers and break it. I wonder how difficult it would be to convert Lua to C++ with exceptions.
- yoklov 13y agoThis isn't an issue for Lua, because so much effort has gone into making it extremely portable. Regardless, a port to C++ would be possible, though I'd (without thinking about it much) guess it would take a performance hit due to the increased code size from to the EH tables causing icache misses.