aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-04 21:30:52 -0700
committeralon@honor <none@none>2010-10-04 21:30:52 -0700
commitaf8eec1c682af409928f28e3a4176115d1c0870f (patch)
tree0efc0714cc27c0d003a1f3983a6f81d2eef975b3
parentccb8f47e51e20d0735f5478dd403309e43985a8a (diff)
temporary hackish removal of unneeded breaks outside of complex emulated blocks
-rw-r--r--src/analyzer.js10
-rw-r--r--src/settings.js2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 9032da3e..13602e32 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -476,13 +476,14 @@ function analyzer(data) {
var nextEntries = keys(entryLabel.outLabels);
dprint('relooping', ' Creating simple emulated, outlabels: ' + nextEntries);
-// if (nextEntries.length == 1) {
-// replaceLabelLabels([entryLabel], set(nextEntries), 'BNOPP'); // remove unneeded branch
-// } else {
+ if (nextEntries.length == 1) {
+ replaceLabelLabels([entryLabel], set(nextEntries), 'BNOPP'); // remove unneeded branch XXX - this is dangerous, as we may
+ // have 1 next entry, but 1 or more B-labels...
+ } else {
nextEntries.forEach(function(nextEntry) {
replaceLabelLabels([entryLabel], set(nextEntry), 'BJSET' + nextEntry); // Just SET __label__ - no break or continue or whatnot
});
- // }
+ }
return {
type: 'emulated',
labels: [entryLabel],
@@ -604,6 +605,7 @@ function analyzer(data) {
// spaghetti - cannot even find a single label to do before the rest. What a mess.
// TODO: try a loop, if possible?
dprint('relooping', ' WARNING: Creating complex emulated');
+ throw "Spaghetti encountered in relooping."
return emulated;
}
diff --git a/src/settings.js b/src/settings.js
index 27dbf7f4..9f6baa40 100644
--- a/src/settings.js
+++ b/src/settings.js
@@ -30,7 +30,7 @@ EXCEPTION_DEBUG = 1; // Print out exceptions in emscriptened code
EXECUTION_TIMEOUT = -1; // Throw an exception after X seconds - useful to debug infinite loops
// Compiler debugging options
-DEBUG_TAGS_SHOWING = ['enzymatic', 'relooping'];
+DEBUG_TAGS_SHOWING = ['enzymatic'];
// Some useful items:
// gconst
// types