michael@0: function run_test() { michael@0: let p = Cc["@mozilla.org/tools/profiler;1"]; michael@0: // Just skip the test if the profiler component isn't present. michael@0: if (!p) michael@0: return; michael@0: p = p.getService(Ci.nsIProfiler); michael@0: if (!p) michael@0: return; michael@0: michael@0: do_check_true(!p.IsActive()); michael@0: michael@0: p.StartProfiler(100, 10, ["js"], 1); michael@0: // The function is entered with the profiler enabled michael@0: (function (){ michael@0: p.StopProfiler(); michael@0: let n = 10000; michael@0: while (--n); // OSR happens here with the profiler disabled. michael@0: // An assertion will fail when this function returns, if the michael@0: // SPS stack was misbalanced. michael@0: })(); michael@0: }