aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/eliminator/asm-eliminator-test-output.js5
-rw-r--r--tools/eliminator/eliminator-test-output.js11
-rw-r--r--tools/eliminator/eliminator-test.js17
-rw-r--r--tools/js-optimizer.js7
-rw-r--r--tools/shared.py2
5 files changed, 37 insertions, 5 deletions
diff --git a/tools/eliminator/asm-eliminator-test-output.js b/tools/eliminator/asm-eliminator-test-output.js
index 434fbaf9..c71063cb 100644
--- a/tools/eliminator/asm-eliminator-test-output.js
+++ b/tools/eliminator/asm-eliminator-test-output.js
@@ -280,9 +280,10 @@ function tempDouble2($46, $14, $28, $42, $20, $32, $45) {
$20 = $20 | 0;
$32 = $32 | 0;
$45 = $45 | 0;
- var $_sroa_06_0_insert_insert$1 = 0;
+ var $46 = 0, $_sroa_06_0_insert_insert$1 = 0;
+ $46 = (HEAPF32[tempDoublePtr >> 2] = ($14 < $28 ? $14 : $28) - $42, HEAP32[tempDoublePtr >> 2] | 0);
$_sroa_06_0_insert_insert$1 = (HEAPF32[tempDoublePtr >> 2] = ($20 < $32 ? $20 : $32) - $42, HEAP32[tempDoublePtr >> 2] | 0) | 0;
- HEAP32[$45 >> 2] = 0 | (HEAPF32[tempDoublePtr >> 2] = ($14 < $28 ? $14 : $28) - $42, HEAP32[tempDoublePtr >> 2] | 0);
+ HEAP32[$45 >> 2] = 0 | $46;
HEAP32[$45 + 4 >> 2] = $_sroa_06_0_insert_insert$1;
HEAP32[$45 + 8 >> 2] = $_sroa_06_0_insert_insert$1;
}
diff --git a/tools/eliminator/eliminator-test-output.js b/tools/eliminator/eliminator-test-output.js
index 0171e99b..4551fb34 100644
--- a/tools/eliminator/eliminator-test-output.js
+++ b/tools/eliminator/eliminator-test-output.js
@@ -6122,4 +6122,15 @@ function intoCond() {
function math(a, b, c, d) {
print(Math_imul(d) + (Math_fround(c) + (a + Math_abs(b))));
}
+function td(x, y) {
+ HEAP32[tempDoublePtr >> 2] = x;
+ var xf = HEAPF32[tempDoublePtr >> 2];
+ HEAP32[tempDoublePtr >> 2] = y;
+ func(xf, HEAPF32[tempDoublePtr >> 2]);
+ HEAPF64[tempDoublePtr >> 3] = x;
+ var xl = HEAP32[tempDoublePtr >> 2];
+ var xh = HEAP32[tempDoublePtr >> 2];
+ HEAPF64[tempDoublePtr >> 3] = y;
+ func(xl, xh, HEAP32[tempDoublePtr >> 2], HEAP32[tempDoublePtr >> 2]);
+}
diff --git a/tools/eliminator/eliminator-test.js b/tools/eliminator/eliminator-test.js
index ef17b388..e629d9f0 100644
--- a/tools/eliminator/eliminator-test.js
+++ b/tools/eliminator/eliminator-test.js
@@ -8860,5 +8860,20 @@ function math(a, b, c, d) {
w = Math_imul(d);
print(x + y + z + w);
}
-// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a", "b", "c", "f", "g", "h", "py", "r", "t", "f2", "f3", "llvm3_1", "_inflate", "_malloc", "_mallocNoU", "asm", "phi", "intoCond", "math"]
+function td(x, y) { // tempDoublePtr should invalidate each other
+ HEAP32[tempDoublePtr>>2] = x;
+ var xf = HEAPF32[tempDoublePtr>>2];
+ HEAP32[tempDoublePtr>>2] = y;
+ var yf = HEAPF32[tempDoublePtr>>2];
+ func(xf, yf);
+ //
+ HEAPF64[tempDoublePtr>>3] = x;
+ var xl = HEAP32[tempDoublePtr>>2];
+ var xh = HEAP32[tempDoublePtr>>2];
+ HEAPF64[tempDoublePtr>>3] = y;
+ var yl = HEAP32[tempDoublePtr>>2];
+ var yh = HEAP32[tempDoublePtr>>2];
+ func(xl, xh, yl, yh);
+}
+// EMSCRIPTEN_GENERATED_FUNCTIONS: ["a", "b", "c", "f", "g", "h", "py", "r", "t", "f2", "f3", "llvm3_1", "_inflate", "_malloc", "_mallocNoU", "asm", "phi", "intoCond", "math", "td"]
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 9efca25f..6e82451c 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -2427,7 +2427,12 @@ function eliminate(ast, memSafe) {
if (allowTracking) track(name, node[3], node);
}
} else if (target[0] === 'sub') {
- if (!isTempDoublePtrAccess(target) && !memoryInvalidated) {
+ if (isTempDoublePtrAccess(target)) {
+ if (!globalsInvalidated) {
+ invalidateGlobals();
+ globalsInvalidated = true;
+ }
+ } else if (!memoryInvalidated) {
invalidateMemory();
memoryInvalidated = true;
}
diff --git a/tools/shared.py b/tools/shared.py
index 443ff4c7..2177a527 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -682,7 +682,7 @@ def line_splitter(data):
return out
-def limit_size(string, MAX=12000*20):
+def limit_size(string, MAX=80*20):
if len(string) < MAX: return string
return string[0:MAX/2] + '\n[..]\n' + string[-MAX/2:]