mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1570259 part 1 - Document and clean up JitContext constructors. r=luke
The next patch will simplify the constructor code a bit more. Differential Revision: https://phabricator.services.mozilla.com/D41377 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
ec806131cb
commit
883264b018
@ -100,7 +100,7 @@ JitContext::JitContext(CompileRuntime* rt, CompileRealm* realm,
|
||||
prev_(CurrentJitContext()),
|
||||
realm_(realm),
|
||||
#ifdef DEBUG
|
||||
isCompilingWasm_(!realm),
|
||||
isCompilingWasm_(false),
|
||||
oom_(false),
|
||||
#endif
|
||||
assemblerCount_(0) {
|
||||
@ -122,9 +122,20 @@ JitContext::JitContext(JSContext* cx, TempAllocator* temp)
|
||||
}
|
||||
|
||||
JitContext::JitContext(TempAllocator* temp)
|
||||
: JitContext(nullptr, nullptr, temp) {}
|
||||
: cx(nullptr),
|
||||
temp(temp),
|
||||
runtime(nullptr),
|
||||
prev_(CurrentJitContext()),
|
||||
realm_(nullptr),
|
||||
#ifdef DEBUG
|
||||
isCompilingWasm_(true),
|
||||
oom_(false),
|
||||
#endif
|
||||
assemblerCount_(0) {
|
||||
SetJitContext(this);
|
||||
}
|
||||
|
||||
JitContext::JitContext() : JitContext(nullptr, nullptr, nullptr) {}
|
||||
JitContext::JitContext() : JitContext(nullptr) {}
|
||||
|
||||
JitContext::~JitContext() { SetJitContext(prev_); }
|
||||
|
||||
|
@ -54,10 +54,16 @@ static_assert(sizeof(AbortReasonOr<bool>) <= sizeof(uintptr_t),
|
||||
|
||||
class JitContext {
|
||||
public:
|
||||
// Constructor for compilations happening on the main thread.
|
||||
JitContext(JSContext* cx, TempAllocator* temp);
|
||||
|
||||
// Constructor for off-thread Ion compilations.
|
||||
JitContext(CompileRuntime* rt, CompileRealm* realm, TempAllocator* temp);
|
||||
|
||||
// Constructors for Wasm compilation.
|
||||
explicit JitContext(TempAllocator* temp);
|
||||
JitContext();
|
||||
|
||||
~JitContext();
|
||||
|
||||
// Running context when executing on the main thread. Not available during
|
||||
|
Loading…
Reference in New Issue
Block a user