aboutsummaryrefslogtreecommitdiff
path: root/emscripten.py
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-18 20:20:55 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-18 20:54:22 -0700
commitc0074e01ac06a66faf3e9d91f1cecb4ff02c7ee9 (patch)
tree0b8e70862b0a352ed5d58008b472c657057c6ad6 /emscripten.py
parentd9173c5dfb0c58a7d5be96f1e4615cefd77f6f43 (diff)
setjmp support for asm.js
Diffstat (limited to 'emscripten.py')
-rwxr-xr-xemscripten.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/emscripten.py b/emscripten.py
index 6e5f1e7c..0fa6ac30 100755
--- a/emscripten.py
+++ b/emscripten.py
@@ -426,7 +426,7 @@ function invoke_%s(%s) {
try {
%sModule.dynCall_%s(%s);
} catch(e) {
- asm.setThrew(1);
+ asm.setThrew(1, 0);
}
}
''' % (sig, args, 'return ' if sig[0] != 'v' else '', sig, args)
@@ -489,6 +489,8 @@ var asm = (function(global, env, buffer) {
var HEAPF64 = new global.Float64Array(buffer);
''' % (asm_setup,) + '\n' + asm_global_vars + '''
var __THREW__ = 0;
+ var threwValue = 0;
+ var setjmpId = 0;
var undef = 0;
var tempInt = 0, tempBigInt = 0, tempBigIntP = 0, tempBigIntS = 0, tempBigIntR = 0.0, tempBigIntI = 0, tempBigIntD = 0, tempValue = 0, tempDouble = 0.0;
''' + ''.join(['''
@@ -509,9 +511,11 @@ var asm = (function(global, env, buffer) {
top = top|0;
STACKTOP = top;
}
- function setThrew(threw) {
+ function setThrew(threw, value) {
threw = threw|0;
+ value = value|0;
__THREW__ = threw;
+ threwValue = value;
}
''' + ''.join(['''
function setTempRet%d(value) {