summaryrefslogtreecommitdiff
path: root/runtime/base/bit_vector-inl.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2017-10-12 13:34:49 +0100
committer Vladimir Marko <vmarko@google.com> 2017-10-17 11:12:08 +0100
commit174b2e27ebf933b80f4e8b64b4b024ab4306aaac (patch)
tree968cdd8d7fd68571115db77cc288807c3b257911 /runtime/base/bit_vector-inl.h
parent6783118d2ad9d759f0617b1219a9e29a10a569f7 (diff)
Use ScopedArenaAllocator for code generation.
Reuse the memory previously allocated on the ArenaStack by optimization passes. This CL handles only the architecture-independent codegen and slow paths, architecture-dependent codegen allocations shall be moved to the ScopedArenaAllocator in a follow-up. Memory needed to compile the two most expensive methods for aosp_angler-userdebug boot image: BatteryStats.dumpCheckinLocked() : 19.6MiB -> 18.5MiB (-1189KiB) BatteryStats.dumpLocked(): 39.3MiB -> 37.0MiB (-2379KiB) Also move definitions of functions that use bit_vector-inl.h from bit_vector.h also to bit_vector-inl.h . Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 64312607 Change-Id: I84688c3a5a95bf90f56bd3a150bc31fedc95f29c
Diffstat (limited to 'runtime/base/bit_vector-inl.h')
-rw-r--r--runtime/base/bit_vector-inl.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/runtime/base/bit_vector-inl.h b/runtime/base/bit_vector-inl.h
index 08877987b1..0e67f77e19 100644
--- a/runtime/base/bit_vector-inl.h
+++ b/runtime/base/bit_vector-inl.h
@@ -65,6 +65,24 @@ inline uint32_t BitVector::IndexIterator::FindIndex(uint32_t start_index) const
return word_index * 32u + CTZ(word);
}
+inline BitVector::IndexIterator::IndexIterator(const BitVector* bit_vector, begin_tag)
+ : bit_storage_(bit_vector->GetRawStorage()),
+ storage_size_(bit_vector->storage_size_),
+ bit_index_(FindIndex(0u)) { }
+
+inline BitVector::IndexIterator::IndexIterator(const BitVector* bit_vector, end_tag)
+ : bit_storage_(bit_vector->GetRawStorage()),
+ storage_size_(bit_vector->storage_size_),
+ bit_index_(BitSize()) { }
+
+inline BitVector::IndexIterator BitVector::IndexContainer::begin() const {
+ return IndexIterator(bit_vector_, IndexIterator::begin_tag());
+}
+
+inline BitVector::IndexIterator BitVector::IndexContainer::end() const {
+ return IndexIterator(bit_vector_, IndexIterator::end_tag());
+}
+
inline void BitVector::ClearAllBits() {
memset(storage_, 0, storage_size_ * kWordBytes);
}