diff options
| author | 2022-02-20 16:10:11 +0000 | |
|---|---|---|
| committer | 2022-02-21 10:29:12 +0000 | |
| commit | 0992436853a4a31e4bf7f4eefdc5245ea1d7c73f (patch) | |
| tree | fef7a06ecddc92e7ecbcf0828f96fac284a6438b /runtime/interpreter/interpreter_cache.h | |
| parent | 17958de62ddb522b009e5968227c650a7af6f3cb (diff) | |
Move GetWeakRefAccessEnabled check from nterp into the cache.
Ensure that all callers do the check.
The check only applies if we have read barriers.
Just by-pass the cache if that is not the case.
Test: run_build_test_target.py -j80 art-gtest-ss-gc-tlab
Change-Id: I9b12c694845277bf3a07719d3fd419538d07ef2c
Diffstat (limited to 'runtime/interpreter/interpreter_cache.h')
| -rw-r--r-- | runtime/interpreter/interpreter_cache.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/interpreter/interpreter_cache.h b/runtime/interpreter/interpreter_cache.h index 99c7afe1e5..c57d0233a6 100644 --- a/runtime/interpreter/interpreter_cache.h +++ b/runtime/interpreter/interpreter_cache.h @@ -62,17 +62,15 @@ class ALIGNED(16) InterpreterCache { // Clear the whole cache. It requires the owning thread for DCHECKs. void Clear(Thread* owning_thread); - ALWAYS_INLINE bool Get(const void* key, /* out */ size_t* value); + ALWAYS_INLINE bool Get(Thread* self, const void* key, /* out */ size_t* value); - ALWAYS_INLINE void Set(const void* key, size_t value); + ALWAYS_INLINE void Set(Thread* self, const void* key, size_t value); std::array<Entry, kSize>& GetArray() { return data_; } private: - bool IsCalledFromOwningThread(); - static ALWAYS_INLINE size_t IndexOf(const void* key) { static_assert(IsPowerOfTwo(kSize), "Size must be power of two"); size_t index = (reinterpret_cast<uintptr_t>(key) >> 2) & (kSize - 1); |