diff options
author | alon@honor <none@none> | 2010-10-04 21:30:52 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-04 21:30:52 -0700 |
commit | af8eec1c682af409928f28e3a4176115d1c0870f (patch) | |
tree | 0efc0714cc27c0d003a1f3983a6f81d2eef975b3 /src/analyzer.js | |
parent | ccb8f47e51e20d0735f5478dd403309e43985a8a (diff) |
temporary hackish removal of unneeded breaks outside of complex emulated blocks
Diffstat (limited to 'src/analyzer.js')
-rw-r--r-- | src/analyzer.js | 10 |
1 files changed, 6 insertions, 4 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; } |