Reviewers: floitschv8_gmail.com, Description: Change cached powers of 10 to avoid constants that need a static initializer to be called on process startup instead of being in the read-only section.
Please review this at http://codereview.chromium.org/8177018/ SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/cached-powers.cc Index: src/cached-powers.cc =================================================================== --- src/cached-powers.cc (revision 9537) +++ src/cached-powers.cc (working copy) @@ -134,14 +134,11 @@ }; static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers); -static const int kCachedPowersOffset = -kCachedPowers[0].decimal_exponent; +static const int kCachedPowersOffset = 348; static const double kD_1_LOG2_10 = 0.30102999566398114; // 1 / lg(10) -const int PowersOfTenCache::kDecimalExponentDistance = - kCachedPowers[1].decimal_exponent - kCachedPowers[0].decimal_exponent; -const int PowersOfTenCache::kMinDecimalExponent = - kCachedPowers[0].decimal_exponent; -const int PowersOfTenCache::kMaxDecimalExponent = - kCachedPowers[kCachedPowersLength - 1].decimal_exponent; +const int PowersOfTenCache::kDecimalExponentDistance = 8; +const int PowersOfTenCache::kMinDecimalExponent = -348; +const int PowersOfTenCache::kMaxDecimalExponent = 340; void PowersOfTenCache::GetCachedPowerForBinaryExponentRange( int min_exponent, -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
