diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 777729448e18..5b25568ef99a 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -455,9 +455,8 @@ jit::RequestInterruptForIonCode(JSRuntime *rt, JSRuntime::InterruptMode mode) } } -JitCompartment::JitCompartment(JitRuntime *rt) - : rt(rt), - stubCodes_(nullptr), +JitCompartment::JitCompartment() + : stubCodes_(nullptr), baselineCallReturnAddr_(nullptr), baselineGetPropReturnAddr_(nullptr), baselineSetPropReturnAddr_(nullptr), @@ -562,7 +561,7 @@ JitCompartment::mark(JSTracer *trc, JSCompartment *compartment) FinishAllOffThreadCompilations(compartment); // Free temporary OSR buffer. - rt->freeOsrTempData(); + trc->runtime->jitRuntime()->freeOsrTempData(); } void diff --git a/js/src/jit/IonLinker.h b/js/src/jit/IonLinker.h index 4caf86b46453..4af0d01dbb5b 100644 --- a/js/src/jit/IonLinker.h +++ b/js/src/jit/IonLinker.h @@ -78,7 +78,7 @@ class Linker template JitCode *newCode(JSContext *cx, JSC::CodeKind kind) { - return newCode(cx, cx->compartment()->jitCompartment()->execAlloc(), kind); + return newCode(cx, cx->runtime()->jitRuntime()->execAlloc(), kind); } JitCode *newCodeForIonScript(JSContext *cx) { diff --git a/js/src/jit/JitCompartment.h b/js/src/jit/JitCompartment.h index da0e09bf8928..6d2158a0911c 100644 --- a/js/src/jit/JitCompartment.h +++ b/js/src/jit/JitCompartment.h @@ -245,6 +245,10 @@ class JitRuntime flusher_ = fl; } + JSC::ExecutableAllocator *execAlloc() const { + return execAlloc_; + } + JSC::ExecutableAllocator *getIonAlloc(JSContext *cx) { JS_ASSERT(cx->runtime()->currentThreadOwnsInterruptLock()); return ionAlloc_ ? ionAlloc_ : createIonAlloc(cx); @@ -336,9 +340,6 @@ class JitCompartment { friend class JitActivation; - // Ion state for the compartment's runtime. - JitRuntime *rt; - // Map ICStub keys to ICStub shared code objects. typedef WeakValueCache > ICStubCodeMap; ICStubCodeMap *stubCodes_; @@ -406,7 +407,7 @@ class JitCompartment JSC::ExecutableAllocator *createIonAlloc(); public: - JitCompartment(JitRuntime *rt); + JitCompartment(); ~JitCompartment(); bool initialize(JSContext *cx); @@ -417,10 +418,6 @@ class JitCompartment void mark(JSTracer *trc, JSCompartment *compartment); void sweep(FreeOp *fop); - JSC::ExecutableAllocator *execAlloc() { - return rt->execAlloc_; - } - JitCode *stringConcatStub(ExecutionMode mode) const { switch (mode) { case SequentialExecution: return stringConcatStub_; diff --git a/js/src/jscompartment.cpp b/js/src/jscompartment.cpp index c6ecfe4ff72e..0b27e9b68ca5 100644 --- a/js/src/jscompartment.cpp +++ b/js/src/jscompartment.cpp @@ -164,12 +164,11 @@ JSCompartment::ensureJitCompartmentExists(JSContext *cx) if (jitCompartment_) return true; - JitRuntime *jitRuntime = cx->runtime()->getJitRuntime(cx); - if (!jitRuntime) + if (!cx->runtime()->getJitRuntime(cx)) return false; /* Set the compartment early, so linking works. */ - jitCompartment_ = cx->new_(jitRuntime); + jitCompartment_ = cx->new_(); if (!jitCompartment_) return false;