diff options
Diffstat (limited to 'runtime/art_method-inl.h')
-rw-r--r-- | runtime/art_method-inl.h | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h index cb1e21d638..614a67f57c 100644 --- a/runtime/art_method-inl.h +++ b/runtime/art_method-inl.h @@ -421,42 +421,9 @@ inline CodeItemDebugInfoAccessor ArtMethod::DexInstructionDebugInfo() { return CodeItemDebugInfoAccessor(*GetDexFile(), GetCodeItem(), GetDexMethodIndex()); } -inline bool ArtMethod::CounterHasChanged() { +inline void ArtMethod::SetCounter(uint16_t hotness_count) { DCHECK(!IsAbstract()); - return hotness_count_ != interpreter::kNterpHotnessMask; -} - -inline void ArtMethod::ResetCounter() { - DCHECK(!IsAbstract()); - // Avoid dirtying the value if possible. - if (hotness_count_ != interpreter::kNterpHotnessMask) { - hotness_count_ = interpreter::kNterpHotnessMask; - } -} - -inline void ArtMethod::SetHotCounter() { - DCHECK(!IsAbstract()); - // Avoid dirtying the value if possible. - if (hotness_count_ != 0) { - hotness_count_ = 0; - } -} - -inline void ArtMethod::UpdateCounter(int32_t new_samples) { - DCHECK(!IsAbstract()); - DCHECK_GT(new_samples, 0); - DCHECK_LE(new_samples, std::numeric_limits<uint16_t>::max()); - uint16_t old_hotness_count = hotness_count_; - uint16_t new_count = (old_hotness_count <= new_samples) ? 0u : old_hotness_count - new_samples; - // Avoid dirtying the value if possible. - if (old_hotness_count != new_count) { - hotness_count_ = new_count; - } -} - -inline bool ArtMethod::CounterIsHot() { - DCHECK(!IsAbstract()); - return hotness_count_ == 0; + hotness_count_ = hotness_count; } inline uint16_t ArtMethod::GetCounter() { |