From cbd3ec6a32e31ab59d89097029db50022df932b8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Sun, 6 Jul 2014 11:16:45 -0700 Subject: fix bug in resurrected optimizeShifts not popping the stack; fixes slow2.test_python --- tools/js-optimizer.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tools/js-optimizer.js') diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 0c689d04..40945d9b 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -1033,6 +1033,8 @@ function optimizeShiftsInternal(ast, conservative) { } else if (type === 'assign' && node[2][0] === 'name' && vars[node[2][1]]) { vars[node[2][1]].defs++; } + }, function() { + stack.pop(); }); // First, break up elements inside a shift. This lets us see clearly what to do next. traverse(fun, function(node, type) { @@ -1195,6 +1197,8 @@ function optimizeShiftsInternal(ast, conservative) { } return node; } + }, function() { + stack.pop(); }); cleanNotes(); var stack = []; @@ -1211,6 +1215,8 @@ function optimizeShiftsInternal(ast, conservative) { return ['name', name + '$s' + data.primaryShift]; } } + }, function() { + stack.pop(); }); cleanNotes(); var SIMPLE_SHIFTS = set('<<', '>>'); @@ -1349,6 +1355,8 @@ function optimizeShiftsInternal(ast, conservative) { } return ret; } + }, function() { + stack.pop(); }); // Note finished variables for (var name in vars) { -- cgit v1.2.3-18-g5258