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

Unified Diff: runtime/vm/bit_vector.cc

Issue 10657044: Fix a bug in liveness analysis code and add more comments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « runtime/vm/bit_vector.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bit_vector.cc
diff --git a/runtime/vm/bit_vector.cc b/runtime/vm/bit_vector.cc
index d270764b9a30684761656e1df1b90dc6b5a36443..9ec3c63bf47d3b6e792fdf62db268e72c2da101b 100644
--- a/runtime/vm/bit_vector.cc
+++ b/runtime/vm/bit_vector.cc
@@ -33,4 +33,31 @@ void BitVector::Iterator::Advance() {
}
+bool BitVector::AddAll(BitVector* from) {
+ ASSERT(data_length_ == from->data_length_);
+ bool changed = false;
+ for (intptr_t i = 0; i < data_length_; i++) {
+ const uword before = data_[i];
+ const uword after = data_[i] | from->data_[i];
+ if (before != after) changed = true;
+ data_[i] = after;
+ }
+ return changed;
+}
+
+
+bool BitVector::KillAndAdd(BitVector* kill, BitVector* gen) {
+ ASSERT(data_length_ == kill->data_length_);
+ ASSERT(data_length_ == gen->data_length_);
+ bool changed = false;
+ for (intptr_t i = 0; i < data_length_; i++) {
+ const uword before = data_[i];
+ const uword after = data_[i] | (gen->data_[i] & ~kill->data_[i]);
+ if (before != after) changed = true;
+ data_[i] = after;
+ }
+ return changed;
+}
+
+
} // namespace dart
« no previous file with comments | « runtime/vm/bit_vector.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698