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

Side by Side Diff: src/bignum.cc

Issue 1371823002: Fix compilation with GCC 5.2 (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix debug compilation Created 5 years, 2 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
« no previous file with comments | « no previous file | src/compiler/ia32/code-generator-ia32.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/bignum.h" 5 #include "src/bignum.h"
6 #include "src/utils.h" 6 #include "src/utils.h"
7 7
8 namespace v8 { 8 namespace v8 {
9 namespace internal { 9 namespace internal {
10 10
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 bigits_[i] = 0; 61 bigits_[i] = 0;
62 } 62 }
63 used_digits_ = other.used_digits_; 63 used_digits_ = other.used_digits_;
64 } 64 }
65 65
66 66
67 static uint64_t ReadUInt64(Vector<const char> buffer, 67 static uint64_t ReadUInt64(Vector<const char> buffer,
68 int from, 68 int from,
69 int digits_to_read) { 69 int digits_to_read) {
70 uint64_t result = 0; 70 uint64_t result = 0;
71 for (int i = from; i < from + digits_to_read; ++i) { 71 int to = from + digits_to_read;
72
73 for (int i = from; i < to; ++i) {
72 int digit = buffer[i] - '0'; 74 int digit = buffer[i] - '0';
73 DCHECK(0 <= digit && digit <= 9); 75 DCHECK(0 <= digit && digit <= 9);
74 result = result * 10 + digit; 76 result = result * 10 + digit;
75 } 77 }
76 return result; 78 return result;
77 } 79 }
78 80
79 81
80 void Bignum::AssignDecimalString(Vector<const char> value) { 82 void Bignum::AssignDecimalString(Vector<const char> value) {
81 // 2^64 = 18446744073709551616 > 10^19 83 // 2^64 = 18446744073709551616 > 10^19
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
743 bigits_[i] = difference & kBigitMask; 745 bigits_[i] = difference & kBigitMask;
744 borrow = difference >> (kChunkSize - 1); 746 borrow = difference >> (kChunkSize - 1);
745 } 747 }
746 Clamp(); 748 Clamp();
747 DCHECK(Bignum::Equal(a, *this)); 749 DCHECK(Bignum::Equal(a, *this));
748 } 750 }
749 751
750 752
751 } // namespace internal 753 } // namespace internal
752 } // namespace v8 754 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698