aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/src/bit-vector.cc
diff options
context:
space:
mode:
authorMichaƫl Zasso <targos@protonmail.com>2017-09-12 11:34:59 +0200
committerAnna Henningsen <anna@addaleax.net>2017-09-13 16:15:18 +0200
commitd82e1075dbc2cec2d6598ade10c1f43805f690fd (patch)
treeccd242b9b491dfc341d1099fe11b0ef528839877 /deps/v8/src/bit-vector.cc
parentb4b7ac6ae811b2b5a3082468115dfb5a5246fe3f (diff)
downloadandroid-node-v8-d82e1075dbc2cec2d6598ade10c1f43805f690fd.tar.gz
android-node-v8-d82e1075dbc2cec2d6598ade10c1f43805f690fd.tar.bz2
android-node-v8-d82e1075dbc2cec2d6598ade10c1f43805f690fd.zip
deps: update V8 to 6.1.534.36
PR-URL: https://github.com/nodejs/node/pull/14730 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'deps/v8/src/bit-vector.cc')
-rw-r--r--deps/v8/src/bit-vector.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/deps/v8/src/bit-vector.cc b/deps/v8/src/bit-vector.cc
index e6aec7efb1..1da110b342 100644
--- a/deps/v8/src/bit-vector.cc
+++ b/deps/v8/src/bit-vector.cc
@@ -32,7 +32,8 @@ void BitVector::Iterator::Advance() {
while (val == 0) {
current_index_++;
if (Done()) return;
- val = target_->data_[current_index_];
+ DCHECK(!target_->is_inline());
+ val = target_->data_.ptr_[current_index_];
current_ = current_index_ << kDataBitShift;
}
val = SkipZeroBytes(val);
@@ -42,16 +43,15 @@ void BitVector::Iterator::Advance() {
int BitVector::Count() const {
- int count = 0;
- for (int i = 0; i < data_length_; i++) {
- uintptr_t data = data_[i];
- if (sizeof(data) == 8) {
- count += base::bits::CountPopulation64(data);
- } else {
- count += base::bits::CountPopulation32(static_cast<uint32_t>(data));
+ if (data_length_ == 0) {
+ return base::bits::CountPopulation(data_.inline_);
+ } else {
+ int count = 0;
+ for (int i = 0; i < data_length_; i++) {
+ count += base::bits::CountPopulation(data_.ptr_[i]);
}
+ return count;
}
- return count;
}
} // namespace internal