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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/vm/bit_vector.h ('k') | runtime/vm/compiler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/bit_vector.h" 5 #include "vm/bit_vector.h"
6 6
7 #include "vm/os.h" 7 #include "vm/os.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
(...skipping 15 matching lines...) Expand all
26 } 26 }
27 // Skip zero bits. 27 // Skip zero bits.
28 while ((current_word_ & 0x1) == 0) { 28 while ((current_word_ & 0x1) == 0) {
29 current_word_ >>= 1; 29 current_word_ >>= 1;
30 ++bit_index_; 30 ++bit_index_;
31 } 31 }
32 current_word_ = current_word_ >> 1; 32 current_word_ = current_word_ >> 1;
33 } 33 }
34 34
35 35
36 bool BitVector::AddAll(BitVector* from) {
37 ASSERT(data_length_ == from->data_length_);
38 bool changed = false;
39 for (intptr_t i = 0; i < data_length_; i++) {
40 const uword before = data_[i];
41 const uword after = data_[i] | from->data_[i];
42 if (before != after) changed = true;
43 data_[i] = after;
44 }
45 return changed;
46 }
47
48
49 bool BitVector::KillAndAdd(BitVector* kill, BitVector* gen) {
50 ASSERT(data_length_ == kill->data_length_);
51 ASSERT(data_length_ == gen->data_length_);
52 bool changed = false;
53 for (intptr_t i = 0; i < data_length_; i++) {
54 const uword before = data_[i];
55 const uword after = data_[i] | (gen->data_[i] & ~kill->data_[i]);
56 if (before != after) changed = true;
57 data_[i] = after;
58 }
59 return changed;
60 }
61
62
36 } // namespace dart 63 } // namespace dart
OLDNEW
« 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