aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/analyzer.js6
-rw-r--r--src/jsifier.js1
2 files changed, 5 insertions, 2 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index d2d5103e..f771392d 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -593,7 +593,7 @@ function analyzer(data) {
if (externals.length > 0) {
// outer
- ret.outer = makeBlock(externals, enteredExitLabels, labelsDict);
+ ret.next = makeBlock(externals, enteredExitLabels, labelsDict);
}
return ret;
@@ -710,6 +710,7 @@ function analyzer(data) {
if (!RELOOP) return finish();
function walkBlock(block) {
+ if (!block) return;
dprint('relooping', "// loopOptimizing block: " + block.type + ' : ' + block.entries);
if (block.type == 'emulated') {
if (block.labels.length == 1 && block.next) {
@@ -721,10 +722,13 @@ function analyzer(data) {
}
}
} else if (block.type == 'reloop') {
+ walkBlock(block.inner);
} else if (block.type == 'multiple') {
+ block.entryLabels.forEach(function(entryLabel) { walkBlock(entryLabel.block) });
} else {
throw "Walked into an invalid block type: " + block.type;
}
+ walkBlock(block.next);
}
item.functions.forEach(function(func) {
diff --git a/src/jsifier.js b/src/jsifier.js
index 239792de..597b0c31 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -339,7 +339,6 @@ function JSify(data) {
ret += indent + block.entry + ': while(1) { // ' + block.entry + '\n';
ret += walkBlock(block.inner, indent + ' ');
ret += indent + '}\n';
- ret += walkBlock(block.outer, indent);
} else if (block.type == 'multiple') {
// TODO: Remove the loop here
var first = true;