tools/profiler/tests/test_enterjit_osr_disabling.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 function run_test() {
     2     let p = Cc["@mozilla.org/tools/profiler;1"];
     3     // Just skip the test if the profiler component isn't present.
     4     if (!p)
     5 	return;
     6     p = p.getService(Ci.nsIProfiler);
     7     if (!p)
     8 	return;
    10     do_check_true(!p.IsActive());
    12     p.StartProfiler(100, 10, ["js"], 1);
    13     // The function is entered with the profiler enabled
    14     (function (){
    15 	p.StopProfiler();
    16 	let n = 10000;
    17 	while (--n);  // OSR happens here with the profiler disabled.
    18 	// An assertion will fail when this function returns, if the
    19 	// SPS stack was misbalanced.
    20     })();
    21 }

mercurial