summaryrefslogtreecommitdiff
path: root/runtime/base/bit_vector.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2015-05-12 18:27:20 +0100
committer Vladimir Marko <vmarko@google.com> 2015-05-12 18:37:17 +0100
commit83d46ef1eaa8fdecadfdb9564d80e50b42646c37 (patch)
treec009b65e982a72c78cbfe6b203c3e942275c8531 /runtime/base/bit_vector.h
parentf3962119654ac1f02e7ec891e1526ca8045542aa (diff)
Quick: Fix DCE to mark wide register overlaps correctly.
Previously we missed some cases of overlap with registers coming from previous blocks. Bug: 20640451 Change-Id: I4b32a7aaea2dea1b0b9560ae3459a4d903683f20
Diffstat (limited to 'runtime/base/bit_vector.h')
-rw-r--r--runtime/base/bit_vector.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/base/bit_vector.h b/runtime/base/bit_vector.h
index be4d363bf5..6e4367ac9d 100644
--- a/runtime/base/bit_vector.h
+++ b/runtime/base/bit_vector.h
@@ -20,6 +20,8 @@
#include <stdint.h>
#include <iterator>
+#include "utils.h"
+
namespace art {
class Allocator;
@@ -116,6 +118,11 @@ class BitVector {
virtual ~BitVector();
+ // The number of words necessary to encode bits.
+ static constexpr uint32_t BitsToWords(uint32_t bits) {
+ return RoundUp(bits, kWordBits) / kWordBits;
+ }
+
// Mark the specified bit as "set".
void SetBit(uint32_t idx) {
/*