tools/profiler/tests/test_enterjit_osr_disabling.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/tools/profiler/tests/test_enterjit_osr_disabling.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,21 @@
     1.4 +function run_test() {
     1.5 +    let p = Cc["@mozilla.org/tools/profiler;1"];
     1.6 +    // Just skip the test if the profiler component isn't present.
     1.7 +    if (!p)
     1.8 +	return;
     1.9 +    p = p.getService(Ci.nsIProfiler);
    1.10 +    if (!p)
    1.11 +	return;
    1.12 +
    1.13 +    do_check_true(!p.IsActive());
    1.14 +
    1.15 +    p.StartProfiler(100, 10, ["js"], 1);
    1.16 +    // The function is entered with the profiler enabled
    1.17 +    (function (){
    1.18 +	p.StopProfiler();
    1.19 +	let n = 10000;
    1.20 +	while (--n);  // OSR happens here with the profiler disabled.
    1.21 +	// An assertion will fail when this function returns, if the
    1.22 +	// SPS stack was misbalanced.
    1.23 +    })();
    1.24 +}

mercurial