aboutsummaryrefslogtreecommitdiff
path: root/tools/js-optimizer.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-07-16 17:42:40 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-07-16 17:42:40 -0700
commitf5f36712af0284244f60c109623938841b846948 (patch)
tree84e1010beae493dd564027c05898a1dd16b7d329 /tools/js-optimizer.js
parent4260723fdf4c436a7999c9b3eefb8cd0e8b1208a (diff)
fix break forwarding in outlined code
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r--tools/js-optimizer.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index 7989f1f4..49bc5d12 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -3105,7 +3105,6 @@ function outline(ast) {
// Generate new function
if (codeInfo.hasReturn || codeInfo.hasBreak || codeInfo.hasContinue) {
// we need to capture all control flow using a top-level labeled one-time loop in the outlined function
- code = [['label', 'OL', ['do', ['num', 0], ['block', code]]]];
var breakCapturers = 0;
var continueCapturers = 0;
traverse(code, function(node, type) {
@@ -3158,6 +3157,7 @@ function outline(ast) {
continueCapturers--;
}
});
+ code = [['label', 'OL', ['do', ['num', 0], ['block', code]]]]; // do this after processing, to not confuse breakCapturers etc.
// read the control data at the callsite to the outlined function
if (codeInfo.hasReturn) {
reps.push(makeIf(