js/src/jit-test/tests/gc/incremental-state.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.

     1 /*
     2  * Test expected state changes during collection.
     3  */
     5 if ("gcstate" in this) {
     6     assertEq(gcstate(), "none");
     8     /* Non-incremental GC. */
     9     gc();
    10     assertEq(gcstate(), "none");
    12     /* Incremental GC in one slice. */
    13     gcslice(1000000);
    14     assertEq(gcstate(), "none");
    16     /* 
    17      * Incremental GC in multiple slices: if marking takes more than one slice,
    18      * we yield before we start sweeping.
    19      */
    20     gcslice(1);
    21     assertEq(gcstate(), "mark");
    22     gcslice(1000000);
    23     assertEq(gcstate(), "mark");
    24     gcslice(1000000);
    25     assertEq(gcstate(), "none");
    27     /* Zeal mode 8: Incremental GC in two slices: 1) mark roots 2) finish collection. */
    28     gczeal(8);
    29     gcslice(1);
    30     assertEq(gcstate(), "mark");
    31     gcslice(1);
    32     assertEq(gcstate(), "none");
    34     /* Zeal mode 9: Incremental GC in two slices: 1) mark all 2) new marking and finish. */
    35     gczeal(9);
    36     gcslice(1);
    37     assertEq(gcstate(), "mark");
    38     gcslice(1);
    39     assertEq(gcstate(), "none");
    41     /* Zeal mode 10: Incremental GC in multiple slices (always yeilds before sweeping). */
    42     gczeal(10);
    43     gcslice(1000000);
    44     assertEq(gcstate(), "sweep");
    45     gcslice(1000000);
    46     assertEq(gcstate(), "none");
    47 }

mercurial