aboutsummaryrefslogtreecommitdiff
path: root/tools/js-optimizer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-18 18:02:43 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-18 18:02:43 -0700
commit9f8c0f7512499408c93feaee3766a962e066e021 (patch)
treedc8f33026d197306a767883bf9ba43918f58aa26 /tools/js-optimizer.js
parentc04260c0a1a66feac67ec8ed2d96793d255964d9 (diff)
do not miss returns that are statements
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r--tools/js-optimizer.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 6e37cca8..a807b9cc 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -3119,9 +3119,9 @@ function outline(ast) {
var level = 0;
function doOutline(func, asmData, stats, start, end) {
- printErr(' do outline ' + [func[1], level, 'range:', start, end, 'of', stats.length]);
var code = stats.slice(start, end+1);
var newIdent = func[1] + '$' + (asmData.splitCounter++);
+ printErr(' do outline ' + [func[1], level, 'range:', start, end, 'of', stats.length, newIdent]); //dumpSrc(['block', code]);//dumpAst(['block', code]);
// analyze variables, and find 'owned' variables - that only appear in the outlined code, and do not need any spill support
var codeInfo = analyzeCode(func, asmData, code);
var allCodeInfo = analyzeCode(func, asmData, func);
@@ -3161,6 +3161,7 @@ function outline(ast) {
if (stats) {
for (var i = 0; i < stats.length; i++) {
var node = stats[i]; // step all over node and type here, for convenience
+ if (node[0] == 'stat') node = node[1];
var type = node[0];
var ret = null;
if (type == 'return') {