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

Side by Side Diff: src/cached-powers.cc

Issue 358363002: Move platform abstraction to base library (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 5 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 | Annotate | Revision Log
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 <limits.h> 5 #include <limits.h>
6 #include <stdarg.h> 6 #include <stdarg.h>
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "include/v8stdint.h" 9 #include "include/v8stdint.h"
10 #include "src/base/logging.h"
10 #include "src/cached-powers.h" 11 #include "src/cached-powers.h"
11 #include "src/checks.h"
12 #include "src/globals.h" 12 #include "src/globals.h"
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace internal { 15 namespace internal {
16 16
17 struct CachedPower { 17 struct CachedPower {
18 uint64_t significand; 18 uint64_t significand;
19 int16_t binary_exponent; 19 int16_t binary_exponent;
20 int16_t decimal_exponent; 20 int16_t decimal_exponent;
21 }; 21 };
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 int index = 150 int index =
151 (requested_exponent + kCachedPowersOffset) / kDecimalExponentDistance; 151 (requested_exponent + kCachedPowersOffset) / kDecimalExponentDistance;
152 CachedPower cached_power = kCachedPowers[index]; 152 CachedPower cached_power = kCachedPowers[index];
153 *power = DiyFp(cached_power.significand, cached_power.binary_exponent); 153 *power = DiyFp(cached_power.significand, cached_power.binary_exponent);
154 *found_exponent = cached_power.decimal_exponent; 154 *found_exponent = cached_power.decimal_exponent;
155 ASSERT(*found_exponent <= requested_exponent); 155 ASSERT(*found_exponent <= requested_exponent);
156 ASSERT(requested_exponent < *found_exponent + kDecimalExponentDistance); 156 ASSERT(requested_exponent < *found_exponent + kDecimalExponentDistance);
157 } 157 }
158 158
159 } } // namespace v8::internal 159 } } // namespace v8::internal
OLDNEW
« src/base/macros.h ('K') | « src/cached-powers.h ('k') | src/checks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698