aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-06 15:25:10 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-06 15:29:48 -0700
commitc7df5bdeb790ec42bbd6632db5f878d65414e1fd (patch)
tree7b26dfeaa26fd4a5768e2f5754a4cee2afb51714
parent7d0af54c914da5a86446a44d8341fe1b83111094 (diff)
allow outlining of single statements
-rwxr-xr-xtests/runner.py2
-rw-r--r--tools/js-optimizer.js2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 04e15d7f..b81ddc61 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -11249,7 +11249,7 @@ f.close()
open(path_from_root('tests', 'zlib', 'ref.txt'), 'r').read(),
{
100: (190, 250),
- 250: (300, 330),
+ 250: (200, 330),
500: (250, 310),
1000: (230, 300),
2000: (380, 450),
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index b948dc96..c2786acc 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -3520,7 +3520,7 @@ function outline(ast) {
// If this is big enough to outline, but not too big (if very close to the size of the full function,
// outlining is pointless; remove stats from the end to try to achieve the good case), then outline.
// Also, try to reduce the size if it is much larger than the hoped-for size
- while ((sizeSeen > maxSize || sizeSeen > 2*sizeToOutline) && end > i+1 && stats[end][0] !== 'begin-outline-call' && stats[end][0] !== 'end-outline-call') {
+ while ((sizeSeen > maxSize || sizeSeen > 2*sizeToOutline) && end > i && stats[end][0] !== 'begin-outline-call' && stats[end][0] !== 'end-outline-call') {
sizeSeen -= measureSize(stats[end]);
if (sizeSeen >= sizeToOutline) {
end--;