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

Side by Side Diff: src/data-flow.cc

Issue 683243005: convert BitVector to use pointer size blocks (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 1 month 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 | « src/data-flow.h ('k') | src/full-codegen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "src/data-flow.h"
6
7 #include "src/base/bits.h"
8 #include "src/scopes.h"
9
10 namespace v8 {
11 namespace internal {
12
13 #ifdef DEBUG
14 void BitVector::Print() {
15 bool first = true;
16 PrintF("{");
17 for (int i = 0; i < length(); i++) {
18 if (Contains(i)) {
19 if (!first) PrintF(",");
20 first = false;
21 PrintF("%d", i);
22 }
23 }
24 PrintF("}");
25 }
26 #endif
27
28
29 void BitVector::Iterator::Advance() {
30 current_++;
31 uint32_t val = current_value_;
32 while (val == 0) {
33 current_index_++;
34 if (Done()) return;
35 val = target_->data_[current_index_];
36 current_ = current_index_ << 5;
37 }
38 val = SkipZeroBytes(val);
39 val = SkipZeroBits(val);
40 current_value_ = val >> 1;
41 }
42
43
44 int BitVector::Count() const {
45 int count = 0;
46 for (int i = 0; i < data_length_; i++) {
47 int data = data_[i];
48 if (data != 0) count += base::bits::CountPopulation32(data);
49 }
50 return count;
51 }
52
53 } // namespace internal
54 } // namespace v8
OLDNEW
« no previous file with comments | « src/data-flow.h ('k') | src/full-codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698