diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 200538d2c4c1..a4f74b979e35 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -7754,7 +7754,7 @@ CodeGenerator::visitFunctionBoundary(LFunctionBoundary *lir) // fallthrough case MFunctionBoundary::Enter: - if (sps_.slowAssertions()) { + if (gen->options.spsSlowAssertionsEnabled()) { saveLive(lir); pushArg(ImmGCPtr(lir->script())); if (!callVM(SPSEnterInfo, lir)) @@ -7775,7 +7775,7 @@ CodeGenerator::visitFunctionBoundary(LFunctionBoundary *lir) return true; case MFunctionBoundary::Exit: - if (sps_.slowAssertions()) { + if (gen->options.spsSlowAssertionsEnabled()) { saveLive(lir); pushArg(ImmGCPtr(lir->script())); // Once we've exited, then we shouldn't emit instrumentation for diff --git a/js/src/jit/CompileWrappers.cpp b/js/src/jit/CompileWrappers.cpp index c2a1c226e29a..37cb3efea5c1 100644 --- a/js/src/jit/CompileWrappers.cpp +++ b/js/src/jit/CompileWrappers.cpp @@ -254,7 +254,8 @@ AutoLockForCompilation::AutoLockForCompilation(CompileCompartment *compartment #endif JitCompileOptions::JitCompileOptions() - : cloneSingletons_(false) + : cloneSingletons_(false), + spsSlowAssertionsEnabled_(false) { } @@ -262,4 +263,6 @@ JitCompileOptions::JitCompileOptions(JSContext *cx) { JS::CompartmentOptions &options = cx->compartment()->options(); cloneSingletons_ = options.cloneSingletons(cx); + spsSlowAssertionsEnabled_ = cx->runtime()->spsProfiler.enabled() && + cx->runtime()->spsProfiler.slowAssertionsEnabled(); } diff --git a/js/src/jit/CompileWrappers.h b/js/src/jit/CompileWrappers.h index 88f946c99680..2a8bc4f8d300 100644 --- a/js/src/jit/CompileWrappers.h +++ b/js/src/jit/CompileWrappers.h @@ -128,8 +128,13 @@ class JitCompileOptions return cloneSingletons_; } + bool spsSlowAssertionsEnabled() const { + return spsSlowAssertionsEnabled_; + } + private: bool cloneSingletons_; + bool spsSlowAssertionsEnabled_; }; diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp index e8ad7e639832..e170d8ca744c 100644 --- a/js/src/jit/Lowering.cpp +++ b/js/src/jit/Lowering.cpp @@ -3275,8 +3275,7 @@ LIRGenerator::visitFunctionBoundary(MFunctionBoundary *ins) return false; // If slow assertions are enabled, then this node will result in a callVM // out to a C++ function for the assertions, so we will need a safepoint. - return !GetIonContext()->runtime->spsProfiler().slowAssertionsEnabled() || - assignSafepoint(lir, ins); + return !gen->options.spsSlowAssertionsEnabled() || assignSafepoint(lir, ins); } bool diff --git a/js/src/vm/SPSProfiler.h b/js/src/vm/SPSProfiler.h index e27f3bcfa8a4..a4c714cf1b2b 100644 --- a/js/src/vm/SPSProfiler.h +++ b/js/src/vm/SPSProfiler.h @@ -292,7 +292,6 @@ class SPSInstrumentation /* Small proxies around SPSProfiler */ bool enabled() { return profiler_ && profiler_->enabled(); } SPSProfiler *profiler() { JS_ASSERT(enabled()); return profiler_; } - bool slowAssertions() { return enabled() && profiler_->slowAssertionsEnabled(); } /* Signals an inline function returned, reverting to the previous state */ void leaveInlineFrame() {