39 UInt128() : high_bits_(0), low_bits_(0) { }
40 UInt128(uint64_t high, uint64_t low) : high_bits_(high), low_bits_(low) { }
45 accumulator = (low_bits_ & kMask32) * multiplicand;
46 uint32_t part =
static_cast<uint32_t
>(accumulator & kMask32);
48 accumulator = accumulator + (low_bits_ >> 32) * multiplicand;
49 low_bits_ = (accumulator << 32) + part;
51 accumulator = accumulator + (high_bits_ & kMask32) * multiplicand;
52 part =
static_cast<uint32_t
>(accumulator & kMask32);
54 accumulator = accumulator + (high_bits_ >> 32) * multiplicand;
55 high_bits_ = (accumulator << 32) + part;
61 if (shift_amount == 0) {
63 }
else if (shift_amount == -64) {
64 high_bits_ = low_bits_;
66 }
else if (shift_amount == 64) {
67 low_bits_ = high_bits_;
69 }
else if (shift_amount <= 0) {
70 high_bits_ <<= -shift_amount;
71 high_bits_ += low_bits_ >> (64 + shift_amount);
72 low_bits_ <<= -shift_amount;
74 low_bits_ >>= shift_amount;
75 low_bits_ += high_bits_ << (64 - shift_amount);
76 high_bits_ >>= shift_amount;
84 int result =
static_cast<int>(high_bits_ >> (power - 64));
85 high_bits_ -=
static_cast<uint64_t
>(
result) << (power - 64);
88 uint64_t part_low = low_bits_ >> power;
89 uint64_t part_high = high_bits_ << (64 - power);
90 int result =
static_cast<int>(part_low + part_high);
92 low_bits_ -= part_low << power;
98 return high_bits_ == 0 && low_bits_ == 0;
102 if (position >= 64) {
103 return static_cast<int>(high_bits_ >> (position - 64)) & 1;
105 return static_cast<int>(low_bits_ >> position) & 1;
110 static const uint64_t kMask32 = 0xFFFFFFFF;
122 for (
int i = requested_length - 1;
i >= 0; --
i) {
123 buffer[(*length) +
i] =
'0' + number % 10;
126 *
length += requested_length;
131 int number_length = 0;
133 while (number != 0) {
134 int digit = number % 10;
136 buffer[(*length) + number_length] =
static_cast<char>(
'0' + digit);
141 int j = *
length + number_length - 1;
155 const uint32_t kTen7 = 10000000;
157 uint32_t part2 =
static_cast<uint32_t
>(number % kTen7);
159 uint32_t part1 =
static_cast<uint32_t
>(number % kTen7);
160 uint32_t part0 =
static_cast<uint32_t
>(number / kTen7);
169 const uint32_t kTen7 = 10000000;
171 uint32_t part2 =
static_cast<uint32_t
>(number % kTen7);
173 uint32_t part1 =
static_cast<uint32_t
>(number % kTen7);
174 uint32_t part0 =
static_cast<uint32_t
>(number / kTen7);
180 }
else if (part1 != 0) {
200 for (
int i = (*
length) - 1;
i > 0; --
i) {
212 if (
buffer[0] ==
'0' + 10) {
232 int*
length,
int* decimal_point) {
237 if (-exponent <= 64) {
240 int point = -exponent;
241 for (
int i = 0;
i < fractional_count; ++
i) {
242 if (fractionals == 0)
break;
255 int digit =
static_cast<int>(fractionals >> point);
259 fractionals -=
static_cast<uint64_t
>(digit) << point;
263 if ((fractionals != 0) && ((fractionals >> (point - 1)) & 1) == 1) {
269 fractionals128.
Shift(-exponent - 64);
271 for (
int i = 0;
i < fractional_count; ++
i) {
272 if (fractionals128.
IsZero())
break;
283 if (fractionals128.
BitAt(point - 1) == 1) {
296 int first_non_zero = 0;
297 while (first_non_zero < *
length &&
buffer[first_non_zero] ==
'0') {
300 if (first_non_zero != 0) {
301 for (
int i = first_non_zero;
i < *
length; ++
i) {
304 *
length -= first_non_zero;
305 *decimal_point -= first_non_zero;
311 int fractional_count,
314 int* decimal_point) {
315 const uint32_t kMaxUInt32 = 0xFFFFFFFF;
323 if (exponent > 20)
return false;
324 if (fractional_count > 20)
return false;
339 uint64_t divisor = kFive17;
340 int divisor_power = 17;
341 uint64_t dividend = significand;
353 if (exponent > divisor_power) {
355 dividend <<= exponent - divisor_power;
356 quotient =
static_cast<uint32_t
>(dividend / divisor);
357 remainder = (dividend % divisor) << divisor_power;
359 divisor <<= divisor_power - exponent;
360 quotient =
static_cast<uint32_t
>(dividend / divisor);
361 remainder = (dividend % divisor) << exponent;
366 }
else if (exponent >= 0) {
368 significand <<= exponent;
373 uint64_t integrals = significand >> -exponent;
374 uint64_t fractionals = significand - (integrals << -exponent);
375 if (integrals > kMaxUInt32) {
383 }
else if (exponent < -128) {
389 *decimal_point = -fractional_count;
400 *decimal_point = -fractional_count;
uint64_t Significand() const
UInt128(uint64_t high, uint64_t low)
void Shift(int shift_amount)
int DivModPowerOf2(int power)
void Multiply(uint32_t multiplicand)
int BitAt(int position) const
static void FillDigits64FixedLength(uint64_t number, Vector< char > buffer, int *length)
static void FillDigits32FixedLength(uint32_t number, int requested_length, Vector< char > buffer, int *length)
static void FillFractionals(uint64_t fractionals, int exponent, int fractional_count, Vector< char > buffer, int *length, int *decimal_point)
static const int kDoubleSignificandSize
bool FastFixedDtoa(double v, int fractional_count, Vector< char > buffer, int *length, int *decimal_point)
static void FillDigits32(uint32_t number, Vector< char > buffer, int *length)
static void TrimZeros(Vector< char > buffer, int *length, int *decimal_point)
static void RoundUp(Vector< char > buffer, int *length, int *decimal_point)
static void FillDigits64(uint64_t number, Vector< char > buffer, int *length)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
#define DOUBLE_CONVERSION_ASSERT(condition)
#define DOUBLE_CONVERSION_UINT64_2PART_C(a, b)