diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-07-16 17:12:31 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-07-16 17:12:31 -0700 |
commit | e747992077a1889a92330d7677cb1324c5fb499b (patch) | |
tree | 68f70d896877b24401c7d928a894d958aca7ddcc /tools/js-optimizer.js | |
parent | b4d483354945aeec630231c0bf69d7c21c23baf0 (diff) |
fix hasBreak/hasContinue processing in outline
Diffstat (limited to 'tools/js-optimizer.js')
-rw-r--r-- | tools/js-optimizer.js | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index 71a59921..2c11d683 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -3058,8 +3058,7 @@ function outline(ast) { for (var name in appearances) { if (appearances[name] > 0) reads[name] = 0; } - - return { writes: writes, reads: reads, hasReturn: hasReturn, breaks: breaks, continues: continues, labels: labels }; + return { writes: writes, reads: reads, hasReturn: hasReturn, hasBreak: hasBreak, hasContinue: hasContinue, breaks: breaks, continues: continues, labels: labels }; } function makeAssign(dst, src) { @@ -3174,21 +3173,21 @@ function outline(ast) { if (codeInfo.hasBreak) { reps.push(makeIf( makeComparison(makeStackAccess(ASM_INT, asmData.controlStackPos), '==', ['num', CONTROL_BREAK]), - ['stat', ['break']] + [['stat', ['break']]] )); reps.push(makeIf( makeComparison(makeStackAccess(ASM_INT, asmData.controlStackPos), '==', ['num', CONTROL_BREAK_LABEL]), - ['stat', ['break', makeStackAccess(ASM_INT, asmData.controlDataStackPos)]] // XXX here and below, need a switch overall possible labels + [['stat', ['break', makeStackAccess(ASM_INT, asmData.controlDataStackPos)]]] // XXX here and below, need a switch overall possible labels )); } if (codeInfo.hasContinue) { reps.push(makeIf( makeComparison(makeStackAccess(ASM_INT, asmData.controlStackPos), '==', ['num', CONTROL_CONTINUE]), - ['stat', ['break']] + [['stat', ['break']]] )); reps.push(makeIf( makeComparison(makeStackAccess(ASM_INT, asmData.controlStackPos), '==', ['num', CONTROL_CONTINUE_LABEL]), - ['stat', ['continue', makeStackAccess(ASM_INT, asmData.controlDataStackPos)]] // XXX + [['stat', ['continue', makeStackAccess(ASM_INT, asmData.controlDataStackPos)]]] // XXX )); } } |