js/src/jit-test/tests/gc/incremental-state.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     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