aboutsummaryrefslogtreecommitdiff
path: root/src/jsifier.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-21 12:03:35 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-21 17:09:49 -0700
commitef3b19e6e6e9669cf75e57ac46ff171221f16fb4 (patch)
tree183f28a84c4023cc33b10d441babbfb1e32d7f40 /src/jsifier.js
parent02c42064795765b746c1800b0ce99ab1c89c189f (diff)
warn on unswitchified switches
Diffstat (limited to 'src/jsifier.js')
-rw-r--r--src/jsifier.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 385adffc..9bc6eb9c 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -1137,6 +1137,9 @@ function JSify(data, functionsOnly, givenFunctions) {
maxx = Math.max(maxx, Math.abs(parseInt(switchLabel.value)));
});
var useIfs = !(maxx <= 2*1024*1024 && (maxx/item.switchLabels.length) < 10*1024);
+ if (VERBOSE && useIfs && item.switchLabels.length > 2) {
+ warn('not optimizing llvm switch into js switch because ' + [maxx, maxx/item.switchLabels.length]);
+ }
var phiSets = calcPhiSets(item);
// Consolidate checks that go to the same label. This is important because it makes the relooper simpler and faster.