]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/controlFlowProfiler/loop-statements.js
1 load("./driver/driver.js");
3 function forRegular(limit
) {
5 for (var i
= 0; i
< limit
; i
++) {
28 function whileLoop(limit
) {
39 assert(!hasBasicBlockExecuted(forRegular
, "var sum"), "should not have executed yet.");
42 assert(hasBasicBlockExecuted(forRegular
, "var sum"), "should have executed.");
43 assert(!hasBasicBlockExecuted(forRegular
, "sum += i"), "should not have executed yet.");
46 assert(hasBasicBlockExecuted(forRegular
, "sum += i"), "should have executed.");
49 assert(!hasBasicBlockExecuted(forIn
, "var s"), "should not have executed yet.");
52 assert(hasBasicBlockExecuted(forIn
, "var s"), "should have executed.");
53 assert(!hasBasicBlockExecuted(forIn
, "s += p"), "should not have executed yet.");
56 assert(hasBasicBlockExecuted(forIn
, "s += p"), "should have executed.");
59 assert(!hasBasicBlockExecuted(forOf
, "var s"), "should not have executed yet.");
62 assert(hasBasicBlockExecuted(forOf
, "var s"), "should have executed.");
63 assert(!hasBasicBlockExecuted(forOf
, "s += p"), "should not have executed yet.");
66 assert(hasBasicBlockExecuted(forOf
, "s += p"), "should have executed.");
69 assert(!hasBasicBlockExecuted(whileLoop
, "var sum"), "should not have executed yet.");
72 assert(hasBasicBlockExecuted(whileLoop
, "var sum"), "should have executed.");
73 assert(!hasBasicBlockExecuted(whileLoop
, "sum += i"), "should not have executed yet.");
76 assert(hasBasicBlockExecuted(whileLoop
, "sum += i"), "should have executed.");