fune/tools/profiler/tests/xpcshell/test_enterjit_osr_disabling.js
Victor Porof 5c7cdbd4ba Bug 1561435 - Format tools/, a=automatic-formatting
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D35940

--HG--
extra : source : d214f0c82813e5a8d3987debc490a2c11f1308ff
2019-07-05 11:18:19 +02:00

18 lines
552 B
JavaScript

function run_test() {
// Just skip the test if the profiler component isn't present.
if (!AppConstants.MOZ_GECKO_PROFILER) {
return;
}
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;
while (--n) {} // OSR happens here with the profiler disabled.
// An assertion will fail when this function returns, if the
// profiler stack was misbalanced.
})();
}