diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2011-02-16 08:38:33 -0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2011-02-16 10:38:49 -0800 |
commit | 550f73ae3e3b29aa36e793e8ffc5cd23478df099 (patch) | |
tree | 3f4d8f9d7648169df967a820406923a9c4321cba /deps/v8/src/bignum.cc | |
parent | 3ef6433255cfeabdeb70bbfa51ac32a287c5d243 (diff) | |
download | node-new-550f73ae3e3b29aa36e793e8ffc5cd23478df099.tar.gz |
Upgrade V8 to 3.1.5
Diffstat (limited to 'deps/v8/src/bignum.cc')
-rw-r--r-- | deps/v8/src/bignum.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/deps/v8/src/bignum.cc b/deps/v8/src/bignum.cc index dd1537a25a..a973974550 100644 --- a/deps/v8/src/bignum.cc +++ b/deps/v8/src/bignum.cc @@ -67,7 +67,7 @@ void Bignum::AssignUInt64(uint64_t value) { int needed_bigits = kUInt64Size / kBigitSize + 1; EnsureCapacity(needed_bigits); for (int i = 0; i < needed_bigits; ++i) { - bigits_[i] = value & kBigitMask; + bigits_[i] = static_cast<Chunk>(value & kBigitMask); value = value >> kBigitSize; } used_digits_ = needed_bigits; @@ -266,7 +266,7 @@ void Bignum::MultiplyByUInt32(uint32_t factor) { } while (carry != 0) { EnsureCapacity(used_digits_ + 1); - bigits_[used_digits_] = carry & kBigitMask; + bigits_[used_digits_] = static_cast<Chunk>(carry & kBigitMask); used_digits_++; carry >>= kBigitSize; } @@ -287,13 +287,13 @@ void Bignum::MultiplyByUInt64(uint64_t factor) { uint64_t product_low = low * bigits_[i]; uint64_t product_high = high * bigits_[i]; uint64_t tmp = (carry & kBigitMask) + product_low; - bigits_[i] = tmp & kBigitMask; + bigits_[i] = static_cast<Chunk>(tmp & kBigitMask); carry = (carry >> kBigitSize) + (tmp >> kBigitSize) + (product_high << (32 - kBigitSize)); } while (carry != 0) { EnsureCapacity(used_digits_ + 1); - bigits_[used_digits_] = carry & kBigitMask; + bigits_[used_digits_] = static_cast<Chunk>(carry & kBigitMask); used_digits_++; carry >>= kBigitSize; } @@ -748,7 +748,8 @@ void Bignum::SubtractTimes(const Bignum& other, int factor) { for (int i = 0; i < other.used_digits_; ++i) { DoubleChunk product = static_cast<DoubleChunk>(factor) * other.bigits_[i]; DoubleChunk remove = borrow + product; - Chunk difference = bigits_[i + exponent_diff] - (remove & kBigitMask); + Chunk difference = + bigits_[i + exponent_diff] - static_cast<Chunk>(remove & kBigitMask); bigits_[i + exponent_diff] = difference & kBigitMask; borrow = static_cast<Chunk>((difference >> (kChunkSize - 1)) + (remove >> kBigitSize)); |