aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-06 16:50:54 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-06 16:50:54 -0700
commitf9758d070a44f9ea5b81124a0d25a3e6524c5ed6 (patch)
tree433bf13eda453008c789bf01c86ee6c505a04e25
parentc7df5bdeb790ec42bbd6632db5f878d65414e1fd (diff)
test outlining with -O2, but without size checks
-rwxr-xr-xtests/runner.py8
-rw-r--r--tools/js-optimizer.js2
2 files changed, 6 insertions, 4 deletions
diff --git a/tests/runner.py b/tests/runner.py
index b81ddc61..33e18f2d 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -11200,7 +11200,7 @@ f.close()
def test_outline(self):
- def test(name, src, libs, expected, expected_ranges, args=[], suffix='cpp'):
+ def test(name, src, libs, expected, expected_ranges, args=[], suffix='cpp', test_sizes=True):
print name
def measure_funcs(filename):
@@ -11240,9 +11240,9 @@ f.close()
seen = max(measure_funcs('test.js').values())
high = expected_ranges[outlining_limit][1]
print outlining_limit, ' ', low, '<=', seen, '<=', high
- assert low <= seen <= high
+ if test_sizes: assert low <= seen <= high
- for test_opts in [[]]: #['-O2']]:
+ for test_opts, test_sizes in [([], True), (['-O2'], False)]:
Building.COMPILER_TEST_OPTS = test_opts
test('zlib', path_from_root('tests', 'zlib', 'example.c'),
self.get_library('zlib', os.path.join('libz.a'), make_args=['libz.a']),
@@ -11256,7 +11256,7 @@ f.close()
5000: (800, 1100),
0: (1500, 1800)
},
- args=['-I' + path_from_root('tests', 'zlib')], suffix='c')
+ args=['-I' + path_from_root('tests', 'zlib')], suffix='c', test_sizes=test_sizes)
def test_symlink(self):
if os.name == 'nt':
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js
index c2786acc..4192ddd1 100644
--- a/tools/js-optimizer.js
+++ b/tools/js-optimizer.js
@@ -3417,6 +3417,7 @@ function outline(ast) {
stats.splice.apply(stats, [start, end-start+1].concat(reps));
// final evaluation and processing
if (!extraInfo.allowCostlyOutlines && (measureSize(func) >= funcSize || measureSize(newFunc) >= funcSize)) {
+ //printErr('aborted outline attempt ' + [measureSize(func), measureSize(newFunc), ' one of which >= ', funcSize]);
// abort, this was pointless
stats.length = originalStats.length;
for (var i = 0; i < stats.length; i++) stats[i] = originalStats[i];
@@ -3542,6 +3543,7 @@ function outline(ast) {
});
assert(sum == 0);
// final decision and action
+ //printErr(' will try done working on sizeSeen due to ' + [(sizeSeen > maxSize || sizeSeen > 2*sizeToOutline), end > i , stats[end][0] !== 'begin-outline-call' , stats[end][0] !== 'end-outline-call'] + ' ... ' + [sizeSeen, sizeToOutline, maxSize, sizeSeen >= sizeToOutline, sizeSeen <= maxSize]);
if (sizeSeen >= sizeToOutline && sizeSeen <= maxSize) {
assert(i >= minIndex);
var newFuncs = doOutline(func, asmData, stats, i, end); // outline [i, .. ,end] inclusive