summaryrefslogtreecommitdiffstats
path: root/tools/profiler/tests/test_enterjit_osr_enabling.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /tools/profiler/tests/test_enterjit_osr_enabling.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'tools/profiler/tests/test_enterjit_osr_enabling.js')
-rw-r--r--tools/profiler/tests/test_enterjit_osr_enabling.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/profiler/tests/test_enterjit_osr_enabling.js b/tools/profiler/tests/test_enterjit_osr_enabling.js
new file mode 100644
index 000000000..ae696057b
--- /dev/null
+++ b/tools/profiler/tests/test_enterjit_osr_enabling.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());
+
+ // The function is entered with the profiler disabled.
+ (function (){
+ p.StartProfiler(100, 10, ["js"], 1);
+ let n = 10000;
+ while (--n); // OSR happens here with the profiler enabled.
+ // An assertion will fail when this function returns, if the
+ // SPS stack was misbalanced.
+ })();
+ p.StopProfiler();
+}