diff options
Diffstat (limited to 'runtime/interpreter/interpreter_cache-inl.h')
-rw-r--r-- | runtime/interpreter/interpreter_cache-inl.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/runtime/interpreter/interpreter_cache-inl.h b/runtime/interpreter/interpreter_cache-inl.h index 269f5fa9ab..804d382877 100644 --- a/runtime/interpreter/interpreter_cache-inl.h +++ b/runtime/interpreter/interpreter_cache-inl.h @@ -35,13 +35,9 @@ inline bool InterpreterCache::Get(Thread* self, const void* key, /* out */ size_ inline void InterpreterCache::Set(Thread* self, const void* key, size_t value) { DCHECK(self->GetInterpreterCache() == this) << "Must be called from owning thread"; - - // For simplicity, only update the cache if weak ref accesses are enabled. If - // they are disabled, this means the CC GC could be processing the cache, and - // reading it concurrently. - if (!gUseReadBarrier || self->GetWeakRefAccessEnabled()) { - data_[IndexOf(key)] = Entry{key, value}; - } + // Simple store works here as the cache is always read/written by the owning + // thread only (or in a stop-the-world pause). + data_[IndexOf(key)] = Entry{key, value}; } } // namespace art |