aboutsummaryrefslogtreecommitdiff
path: root/src/analyzer.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/analyzer.js')
-rw-r--r--src/analyzer.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/analyzer.js b/src/analyzer.js
index 26def9c4..1e03a1d6 100644
--- a/src/analyzer.js
+++ b/src/analyzer.js
@@ -1061,8 +1061,8 @@ function analyzer(data) {
// by hoisting labels into the loop.
if (externalsEntries.length > 1) {
(function() {
- // If an external entry would double the size of the loop, that is too much
- var maxHoist = sum(internals.map(function(internal) { return internal.lines.length }));
+ // If an external entry would make the loop too big, don't hoist
+ var maxHoist = Infinity; //sum(internals.map(function(internal) { return internal.lines.length }));
var avoid = externalsEntries.map(function(l) { return labelsDict[l] });
var totalNewEntries = {};
for (var i = 0; i < externalsEntries.length; i++) {
@@ -1070,8 +1070,7 @@ function analyzer(data) {
// Check if hoisting this external entry is worthwhile. We first do a dry run, aborting on
// loops (which we never hoist, to avoid over-nesting) or on seeing too many labels would be hoisted
// (to avoid enlarging loops too much). If the dry run succeeded, it will stop when it reaches
- // places where we rejoin other external entries. Hoisting removes one entry, so if we add more than
- // one this would be a net loss, and we do not hoist.
+ // places where we rejoin other external entries.
var seen, newEntries;
function prepare() {
seen = {};
@@ -1102,7 +1101,8 @@ function analyzer(data) {
if (hoist(exitLabel, true)) {
var seenList = unset(seen);
var num = sum(seenList.map(function(seen) { return labelsDict[seen].lines.length }));
- if (seenList.length > 1 && num <= maxHoist) {
+ // Only hoist if the sizes make sense
+ if (seenList.length >= 1 && num <= maxHoist) { // && unset(newEntries).length <= 1) {
prepare();
hoist(exitLabel);
mergeInto(totalNewEntries, newEntries);