| OLD | NEW |
| 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/cached-powers.h" |
| 6 |
| 5 #include <limits.h> | 7 #include <limits.h> |
| 6 #include <stdarg.h> | 8 #include <stdarg.h> |
| 7 #include <stdint.h> | 9 #include <stdint.h> |
| 8 #include <cmath> | 10 #include <cmath> |
| 9 | 11 |
| 10 #include "src/base/logging.h" | 12 #include "src/base/logging.h" |
| 11 #include "src/cached-powers.h" | |
| 12 #include "src/globals.h" | 13 #include "src/globals.h" |
| 13 | 14 |
| 14 namespace v8 { | 15 namespace v8 { |
| 15 namespace internal { | 16 namespace internal { |
| 16 | 17 |
| 17 struct CachedPower { | 18 struct CachedPower { |
| 18 uint64_t significand; | 19 uint64_t significand; |
| 19 int16_t binary_exponent; | 20 int16_t binary_exponent; |
| 20 int16_t decimal_exponent; | 21 int16_t decimal_exponent; |
| 21 }; | 22 }; |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 (requested_exponent + kCachedPowersOffset) / kDecimalExponentDistance; | 152 (requested_exponent + kCachedPowersOffset) / kDecimalExponentDistance; |
| 152 CachedPower cached_power = kCachedPowers[index]; | 153 CachedPower cached_power = kCachedPowers[index]; |
| 153 *power = DiyFp(cached_power.significand, cached_power.binary_exponent); | 154 *power = DiyFp(cached_power.significand, cached_power.binary_exponent); |
| 154 *found_exponent = cached_power.decimal_exponent; | 155 *found_exponent = cached_power.decimal_exponent; |
| 155 DCHECK(*found_exponent <= requested_exponent); | 156 DCHECK(*found_exponent <= requested_exponent); |
| 156 DCHECK(requested_exponent < *found_exponent + kDecimalExponentDistance); | 157 DCHECK(requested_exponent < *found_exponent + kDecimalExponentDistance); |
| 157 } | 158 } |
| 158 | 159 |
| 159 } // namespace internal | 160 } // namespace internal |
| 160 } // namespace v8 | 161 } // namespace v8 |
| OLD | NEW |