aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/analyzer.js10
-rw-r--r--tools/shared.py4
2 files changed, 8 insertions, 6 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);
diff --git a/tools/shared.py b/tools/shared.py
index bfb338d9..294f15ee 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -140,9 +140,11 @@ try:
COMPILER_OPTS # Can be set in ~/.emscripten, optionally
except:
COMPILER_OPTS = []
+# Force a simple, standard target as much as possible: target 32-bit linux, and disable various flags that hint at other platforms
COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-U__i386__', '-U__x86_64__', '-U__i386', '-U__x86_64', '-U__SSE__', '-U__SSE2__', '-U__MMX__',
'-UX87_DOUBLE_ROUNDING', '-UHAVE_GCC_ASM_FOR_X87', '-DEMSCRIPTEN', '-U__STRICT_ANSI__', '-U__CYGWIN__',
- '-D__STDC__']
+ '-D__STDC__', '-Xclang', '-triple=i386-pc-linux-gnu']
+
USE_EMSDK = not os.environ.get('EMMAKEN_NO_SDK')