diff options
Diffstat (limited to 'runtime/interpreter/interpreter_cache.h')
-rw-r--r-- | runtime/interpreter/interpreter_cache.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/interpreter/interpreter_cache.h b/runtime/interpreter/interpreter_cache.h index 003ea6c8d3..0ada562438 100644 --- a/runtime/interpreter/interpreter_cache.h +++ b/runtime/interpreter/interpreter_cache.h @@ -45,10 +45,10 @@ class Thread; // Aligned to 16-bytes to make it easier to get the address of the cache // from assembly (it ensures that the offset is valid immediate value). class ALIGNED(16) InterpreterCache { + public: // Aligned since we load the whole entry in single assembly instruction. typedef std::pair<const void*, size_t> Entry ALIGNED(2 * sizeof(size_t)); - public: // 2x size increase/decrease corresponds to ~0.5% interpreter performance change. // Value of 256 has around 75% cache hit rate. static constexpr size_t kSize = 256; @@ -77,6 +77,10 @@ class ALIGNED(16) InterpreterCache { data_[IndexOf(key)] = Entry{key, value}; } + std::array<Entry, kSize>& GetArray() { + return data_; + } + private: bool IsCalledFromOwningThread(); |