Debian Codegraph @

js/src/jit-test/tests/self-test/baselineCompile.js

raw
1 // |jit-test| test-also=--fuzzing-safe
2 // Check that the help text for baselineCompile() is accurate.
3
4 if (typeof inJit == "function" && typeof baselineCompile == "function") {
5 if (!inJit()) {
6
7 var res = baselineCompile(); // compile the current script
8
9 assertEq(inJit(), false,
10 "We have compiled this script to baseline jitcode, but shouldn't " +
11 "be running it yet, according to the help text for baselineCompile() " +
12 "in TestingFunctions.cpp. If you fail this assertion, nice work, and " +
13 "please update the help text!");
14
15 for (var i=0; i<1; i++) {} // exact boilerplate suggested by the help text
16
17 assertEq(typeof res != "string" ? inJit() : true, true,
18 "help text in TestingFunctions.cpp claims the above loop causes " +
19 "the interpreter to start running the new baseline jitcode");
20 }
21 }