Add micro benchmarks to verify that we hoist bound checks.
This commit is contained in:
Родитель
a28bb4b6d9
Коммит
d2e3311637
|
@ -35,3 +35,4 @@ misc-bugs-1131099-lodash1
|
|||
misc-bugs-1131099-lodash2
|
||||
misc-bugs-1131099-underscore
|
||||
misc-bugs-1090583-dart2js-tracer
|
||||
misc-basic-hoist-bounds-check
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
var num = 10000, max = 2000;
|
||||
var str = new Array(num).join(',');
|
||||
|
||||
function countCommas(str) {
|
||||
var commas = 0;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
if (str.charCodeAt(i) === 44 /* ',' */)
|
||||
commas++;
|
||||
}
|
||||
return commas;
|
||||
}
|
||||
|
||||
with ({ res: 0 }) {
|
||||
for (var i = 0; i < max; i++)
|
||||
res += countCommas(str);
|
||||
assertEq(res, (num - 1) * max);
|
||||
};
|
|
@ -113,7 +113,7 @@ class Kraken(SunSpiderBased):
|
|||
|
||||
class Assorted(SunSpiderBased):
|
||||
def __init__(self):
|
||||
super(Assorted, self).__init__('misc', '0.1', 'misc', 3)
|
||||
super(Assorted, self).__init__('misc', '0.4', 'misc', 3)
|
||||
|
||||
def getBenchmark(name):
|
||||
if name == "octane":
|
||||
|
|
|
@ -176,7 +176,7 @@ class Kraken(SunSpiderBased):
|
|||
|
||||
class Assorted(SunSpiderBased):
|
||||
def __init__(self):
|
||||
super(Assorted, self).__init__('misc', '0.3', 'misc', 3)
|
||||
super(Assorted, self).__init__('misc', '0.4', 'misc', 3)
|
||||
|
||||
class Shumway(Benchmark):
|
||||
def __init__(self):
|
||||
|
|
Загрузка…
Ссылка в новой задаче