diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-12 21:55:47 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-12 21:55:47 -0700 |
commit | 5912c32ab0da188196f5d486edc7fb5153f1ee65 (patch) | |
tree | 2b75fa5343568928ff1f0079694e5a3eaaf7737c /src | |
parent | e9f5fc355b1682a79d3fa5044ad9bb00e81a2159 (diff) |
do not switchify illegally-typed switches
Diffstat (limited to 'src')
-rw-r--r-- | src/jsifier.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 49f2c564..1f53b1a2 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -1148,6 +1148,10 @@ function JSify(data, functionsOnly, givenFunctions) { if (VERBOSE && useIfs && item.switchLabels.length >= 6) { warn('not optimizing llvm switch into js switch because range of values is ' + range + ', density is ' + range/item.switchLabels.length); } + if (!useIfs && isIllegalType(item.type)) { + useIfs = true; + if (VERBOSE) warn('not optimizing llvm switch because illegal type ' + item.type); + } var phiSets = calcPhiSets(item); // Consolidate checks that go to the same label. This is important because it makes the relooper simpler and faster. |