summaryrefslogtreecommitdiffstats
path: root/tools/profiler/tests/xpcshell/test_enterjit_osr_disabling.js
blob: 558c9b0c3b753af0e0862809256d9086bf154b4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function run_test() {
  Assert.ok(!Services.profiler.IsActive());

  Services.profiler.StartProfiler(100, 10, ["js"]);
  // The function is entered with the profiler enabled
  (function () {
    Services.profiler.StopProfiler();
    let n = 10000;
    // eslint-disable-next-line no-empty
    while (--n) {} // OSR happens here with the profiler disabled.
    // An assertion will fail when this function returns, if the
    // profiler stack was misbalanced.
  })();
}