mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-16 14:55:47 +00:00
Bug 1752099 part 5 - Move executable memory initialization into InitializeJit. r=lth
This makes it a bit easier to reason about the ordering of these. Depends on D137026 Differential Revision: https://phabricator.services.mozilla.com/D137027
This commit is contained in:
parent
ad9f1b55ce
commit
09e4065954
@ -116,10 +116,22 @@ bool jit::InitializeJit() {
|
||||
JitOptions.supportsUnalignedAccesses =
|
||||
MacroAssembler::SupportsUnalignedAccesses();
|
||||
|
||||
if (HasJitBackend()) {
|
||||
if (!InitProcessExecutableMemory()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
CheckPerf();
|
||||
return true;
|
||||
}
|
||||
|
||||
void jit::ShutdownJit() {
|
||||
if (HasJitBackend() && !JSRuntime::hasLiveRuntimes()) {
|
||||
ReleaseProcessExecutableMemory();
|
||||
}
|
||||
}
|
||||
|
||||
bool jit::JitSupportsWasmSimd() {
|
||||
#if defined(ENABLE_WASM_SIMD)
|
||||
return js::jit::MacroAssembler::SupportsWasmSimd();
|
||||
|
@ -146,8 +146,9 @@ class JitContext {
|
||||
#endif
|
||||
};
|
||||
|
||||
// Process-wide initialization of JIT data structures.
|
||||
// Process-wide initialization and shutdown of JIT data structures.
|
||||
[[nodiscard]] bool InitializeJit();
|
||||
void ShutdownJit();
|
||||
|
||||
// Get and set the current JIT context.
|
||||
JitContext* GetJitContext();
|
||||
|
@ -176,10 +176,6 @@ JS_PUBLIC_API const char* JS::detail::InitWithFailureDiagnostic(
|
||||
|
||||
js::coverage::InitLCov();
|
||||
|
||||
if (js::jit::HasJitBackend()) {
|
||||
RETURN_IF_FAIL(js::jit::InitProcessExecutableMemory());
|
||||
}
|
||||
|
||||
RETURN_IF_FAIL(js::MemoryProtectionExceptionHandler::install());
|
||||
|
||||
RETURN_IF_FAIL(js::jit::InitializeJit());
|
||||
@ -306,12 +302,9 @@ JS_PUBLIC_API void JS_ShutDown(void) {
|
||||
|
||||
js::FinishDateTimeState();
|
||||
|
||||
if (!JSRuntime::hasLiveRuntimes()) {
|
||||
if (js::jit::HasJitBackend()) {
|
||||
js::jit::ReleaseProcessExecutableMemory();
|
||||
}
|
||||
MOZ_ASSERT(!js::LiveMappedBufferCount());
|
||||
}
|
||||
js::jit::ShutdownJit();
|
||||
|
||||
MOZ_ASSERT_IF(!JSRuntime::hasLiveRuntimes(), !js::LiveMappedBufferCount());
|
||||
|
||||
js::ShutDownMallocAllocator();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user