summaryrefslogtreecommitdiffstats
path: root/tools/profiler/tests/test_enterjit_osr_disabling.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/profiler/tests/test_enterjit_osr_disabling.js')
-rw-r--r--tools/profiler/tests/test_enterjit_osr_disabling.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/profiler/tests/test_enterjit_osr_disabling.js b/tools/profiler/tests/test_enterjit_osr_disabling.js
new file mode 100644
index 000000000..dbf74c93a
--- /dev/null
+++ b/tools/profiler/tests/test_enterjit_osr_disabling.js
@@ -0,0 +1,21 @@
+function run_test() {
+ let p = Cc["@mozilla.org/tools/profiler;1"];
+ // Just skip the test if the profiler component isn't present.
+ if (!p)
+ return;
+ p = p.getService(Ci.nsIProfiler);
+ if (!p)
+ return;
+
+ do_check_true(!p.IsActive());
+
+ p.StartProfiler(100, 10, ["js"], 1);
+ // The function is entered with the profiler enabled
+ (function (){
+ p.StopProfiler();
+ let n = 10000;
+ while (--n); // OSR happens here with the profiler disabled.
+ // An assertion will fail when this function returns, if the
+ // SPS stack was misbalanced.
+ })();
+}