aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 56e49788..b93cdf9a 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -969,7 +969,16 @@ function JSify(data, functionsOnly, givenFunctions) {
+ 'if (typeof e != "number") throw e; '
+ 'if (ABORT) throw e; __THREW__ = true; '
+ (EXCEPTION_DEBUG ? 'print("Exception: " + e + ", currently at: " + (new Error().stack)); ' : '')
- + 'return null } })(); if (!__THREW__) { ' + getPhiSetsForLabel(phiSets, item.toLabel) + makeBranch(item.toLabel, item.currLabelId)
+ + 'return null } })();';
+ if (item.assignTo) {
+ ret = 'var ' + item.assignTo + ' = ' + ret;
+ if (isIllegalType(item.type)) {
+ assert(item.type == 'i64', 'Can only handle i64 invoke among illegal invokes');
+ ret += 'var ' + item.assignTo + '$0 = ' + item.assignTo + '[0], ' + item.assignTo + '$1 = ' + item.assignTo + '[1];';
+ }
+ item.assignTo = null;
+ }
+ ret += 'if (!__THREW__) { ' + getPhiSetsForLabel(phiSets, item.toLabel) + makeBranch(item.toLabel, item.currLabelId)
+ ' } else { ' + getPhiSetsForLabel(phiSets, item.unwindLabel) + makeBranch(item.unwindLabel, item.currLabelId) + ' }';
return ret;
});