aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-06 13:49:39 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-06 13:49:39 -0700
commitf50eca757a4df4f5bfae97d11a3499265a0437c1 (patch)
treed78a7e38eac0d1dc1b7b990ddbb6f48a6d6438bb /tools
parent6a1f8030bfddf31d35e5df5fddb6f73cdd3d996e (diff)
better outline logging
Diffstat (limited to 'tools')
-rw-r--r--tools/js-optimizer.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index facf2a0e..b948dc96 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -3227,6 +3227,7 @@ function outline(ast) {
if (asmData.splitCounter === asmData.maxOutlinings) return [];
if (!extraInfo.allowCostlyOutlines) var originalStats = copy(stats);
var code = stats.slice(start, end+1);
+ var originalCodeSize = measureSize(code);
var funcSize = measureSize(func);
var outlineIndex = asmData.splitCounter++;
var newIdent = func[1] + '$' + outlineIndex;
@@ -3239,7 +3240,6 @@ function outline(ast) {
owned[v] = 1;
}
});
- printErr('attempting outline ' + [func[1], newIdent, 'overhead:', setSize(setSub(codeInfo.writes, owned)), setSize(setSub(codeInfo.reads, owned))]);
var reps = [];
// wipe out control variable
reps.push(['stat', makeAssign(makeStackAccess(ASM_INT, asmData.controlStackPos(outlineIndex)), ['num', 0])]);
@@ -3418,7 +3418,6 @@ function outline(ast) {
// final evaluation and processing
if (!extraInfo.allowCostlyOutlines && (measureSize(func) >= funcSize || measureSize(newFunc) >= funcSize)) {
// abort, this was pointless
- printErr('abort outlining ' + newIdent);
stats.length = originalStats.length;
for (var i = 0; i < stats.length; i++) stats[i] = originalStats[i];
asmData.splitCounter--;
@@ -3436,7 +3435,7 @@ function outline(ast) {
}
}
outliningParents[newIdent] = func[1];
- printErr('successful outlining ' + newIdent);
+ printErr('performed outline ' + [func[1], newIdent, 'code sizes (pre/post):', originalCodeSize, measureSize(code), 'overhead (w/r):', setSize(setSub(codeInfo.writes, owned)), setSize(setSub(codeInfo.reads, owned))]);
calculateThreshold(func);
return [newFunc];
}
@@ -3548,7 +3547,6 @@ function outline(ast) {
var newFuncs = doOutline(func, asmData, stats, i, end); // outline [i, .. ,end] inclusive
if (newFuncs.length) {
ret.push.apply(ret, newFuncs);
- printErr('performed outline on ' + func[1] + ' of ' + sizeSeen + ', => ' + newFuncs[0][1]);
}
sizeSeen = 0;
end = i-1;