// - A value of 4 for offthread_compilation_strategy will aggressively
// compile all JS functions omt with bytecode eagerly.
// - 255 for delazification strategy will full parse all functions.
SpecialPowers.pushPrefEnv({set: [
["dom.expose_test_interfaces", true],
["javascript.options.baselinejit", true],
["javascript.options.baselinejit.offthread_compilation_strategy", 4],
["dom.script_loader.delazification.strategy", 255],
["dom.script_loader.delazification.max_size", -1],
["dom.script_loader.delazification.min_mem", 0]
]});
async function doTest() { variframe = document.getElementById("ifr");
var dispatchReceived = false; var compiledFunctions = new Set();
window.addEventListener("message", function(event) {
if (event.data && event.data.type) {
// Check for function-specific events
if (event.data.type.startsWith("omt_eager_baseline_function: ")) {
const functionName = event.data.type.substring("omt_eager_baseline_function: ".length);
compiledFunctions.add(functionName);
} else if (event.data.type === "omt_eager_baseline_dispatch") {
dispatchReceived = true;
}
}
});
// Need a long timeout here since this test can take a long time
// on some platforms.
await SimpleTest.promiseWaitForCondition(
() => compiledFunctions.has("fun1") && compiledFunctions.has("fun2") && compiledFunctions.has("fun3"), "Failed to eagerly compile functions.", 100, 100
);
await SimpleTest.promiseWaitForCondition(
() => dispatchReceived, "Did not recieve eager baseline compilation dispatch.", 100, 10
);
ok(true, "All functions were eagerly compiled successfully.");
SimpleTest.finish();
}
</script>
</head>
<body onload="doTest()">
<iframe id="ifr" allowfullscreen></iframe>
</body>
</html>
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.