js/src/jit-test/tests/basic/testNestedExitStackOuter.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 // Test stack reconstruction after a nested exit
michael@0 2 function testNestedExitStackInner(j, counter) {
michael@0 3 ++counter;
michael@0 4 var b = 0;
michael@0 5 for (var i = 1; i <= 9; i++) {
michael@0 6 ++b;
michael@0 7 var a;
michael@0 8 // Make sure that once everything has been traced we suddenly switch to
michael@0 9 // a different control flow the first time we run the outermost tree,
michael@0 10 // triggering a side exit.
michael@0 11 if (j < 9)
michael@0 12 a = 1;
michael@0 13 else
michael@0 14 a = 0;
michael@0 15 ++b;
michael@0 16 b += a;
michael@0 17 }
michael@0 18 return counter + b;
michael@0 19 }
michael@0 20 function testNestedExitStackOuter() {
michael@0 21 var counter = 0;
michael@0 22 for (var j = 1; j <= 9; ++j) {
michael@0 23 for (var k = 1; k <= 9; ++k) {
michael@0 24 counter = testNestedExitStackInner(j, counter);
michael@0 25 }
michael@0 26 }
michael@0 27 return counter;
michael@0 28 }
michael@0 29 //assertEq(testNestedExitStackOuter(), 81);

mercurial