Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Unified Diff: runtime/vm/bit_vector.h

Issue 10914314: Simple redundant load elimination. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: addressed comments Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/vm/bit_vector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bit_vector.h
===================================================================
--- runtime/vm/bit_vector.h (revision 12420)
+++ runtime/vm/bit_vector.h (working copy)
@@ -52,6 +52,11 @@
Clear();
}
+ void CopyFrom(const BitVector* other) {
+ Clear();
+ AddAll(other);
+ }
+
static intptr_t SizeFor(intptr_t length) {
return 1 + ((length - 1) / kBitsPerWord);
}
@@ -66,13 +71,17 @@
data_[i / kBitsPerWord] &= ~(static_cast<uword>(1) << (i % kBitsPerWord));
}
+ bool Equals(const BitVector& other) const;
+
// Add all elements that are in the bitvector from.
- bool AddAll(BitVector* from);
+ bool AddAll(const BitVector* from);
// From the bitvector gen add those elements that are not in the
// bitvector kill.
bool KillAndAdd(BitVector* kill, BitVector* gen);
+ void Intersect(const BitVector& other);
+
bool Contains(int i) const {
ASSERT(i >= 0 && i < length());
uword block = data_[i / kBitsPerWord];
@@ -85,8 +94,16 @@
}
}
+ void SetAll() {
+ for (intptr_t i = 0; i < data_length_; i++) {
+ data_[i] = static_cast<uword>(-1);
+ }
+ }
+
intptr_t length() const { return length_; }
+ void Print() const;
+
private:
intptr_t length_;
intptr_t data_length_;
« no previous file with comments | « no previous file | runtime/vm/bit_vector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698