diff options
| -rw-r--r-- | runtime/jit/jit_instrumentation.cc | 10 | 
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/jit/jit_instrumentation.cc b/runtime/jit/jit_instrumentation.cc index cce2fb2edc..d8ec689051 100644 --- a/runtime/jit/jit_instrumentation.cc +++ b/runtime/jit/jit_instrumentation.cc @@ -132,11 +132,15 @@ void JitInstrumentationCache::DeleteThreadPool(Thread* self) {  void JitInstrumentationCache::AddSamples(Thread* self, ArtMethod* method, uint16_t count) {    // Since we don't have on-stack replacement, some methods can remain in the interpreter longer -  // than we want resulting in samples even after the method is compiled. -  if (method->IsClassInitializer() || method->IsNative()) { +  // than we want resulting in samples even after the method is compiled.  Also, if the +  // jit is no longer interested in hotness samples because we're shutting down, just return. +  if (method->IsClassInitializer() || method->IsNative() || (thread_pool_ == nullptr)) { +    if (thread_pool_  == nullptr) { +      // Should only see this when shutting down. +      DCHECK(Runtime::Current()->IsShuttingDown(self)); +    }      return;    } -  DCHECK(thread_pool_ != nullptr);    DCHECK_GT(warm_method_threshold_, 0);    DCHECK_GT(hot_method_threshold_, warm_method_threshold_);    DCHECK_GT(osr_method_threshold_, hot_method_threshold_);  |