tools/profiler/tests/test_enterjit_osr_enabling.js

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     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     // The function is entered with the profiler disabled.
    13     (function (){
    14 	p.StartProfiler(100, 10, ["js"], 1);
    15 	let n = 10000;
    16 	while (--n); // OSR happens here with the profiler enabled.
    17 	// An assertion will fail when this function returns, if the
    18 	// SPS stack was misbalanced.
    19     })();
    20     p.StopProfiler();
    21 }

mercurial