Changeset 141916 in webkit
- Timestamp:
- Feb 5, 2013 12:43:27 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r141914 r141916 1 2013-02-04 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Structure::m_outOfLineCapacity is unnecessary 4 https://bugs.webkit.org/show_bug.cgi?id=108206 5 6 Reviewed by Darin Adler. 7 8 Simplifying the utility functions that we use since we don't need a 9 bunch of fancy templates for this one specific call site. 10 11 * runtime/Structure.h: 12 (JSC::Structure::outOfLineCapacity): 13 1 14 2013-02-05 Mark Hahnenberg <mhahnenberg@apple.com> 2 15 -
trunk/Source/JavaScriptCore/runtime/Structure.h
r141681 r141916 197 197 198 198 ASSERT(outOfLineSize > initialOutOfLineCapacity); 199 return WTF::roundUpToPowerOf<outOfLineGrowthFactor>(outOfLineSize); 199 COMPILE_ASSERT(outOfLineGrowthFactor == 2, outOfLineGrowthFactor_is_two); 200 return WTF::roundUpToPowerOfTwo(outOfLineSize); 200 201 } 201 202 unsigned outOfLineSize() const -
trunk/Source/WTF/ChangeLog
r141909 r141916 1 2013-02-04 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 Structure::m_outOfLineCapacity is unnecessary 4 https://bugs.webkit.org/show_bug.cgi?id=108206 5 6 Reviewed by Darin Adler. 7 8 Simplifying the utility functions that we use since we don't need a 9 bunch of fancy templates for this one specific call site. 10 11 * wtf/MathExtras.h: 12 (WTF::roundUpToPowerOfTwo): 13 1 14 2013-02-05 Sheriff Bot <webkit.review.bot@gmail.com> 2 15 -
trunk/Source/WTF/wtf/MathExtras.h
r141295 r141916 432 432 namespace WTF { 433 433 434 // Be careful, this might be super slow in a hot loop.435 template<size_t exponent> inline size_t roundUpToPowerOf(size_t v)436 {437 return round(pow(static_cast<double>(exponent), ceil(log(static_cast<double>(v)) / log(static_cast<double>(exponent)))));438 }439 440 434 // From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2 441 template<> inline size_t roundUpToPowerOf<2>(size_t v)435 inline uint32_t roundUpToPowerOfTwo(uint32_t v) 442 436 { 443 437 v--; … … 447 441 v |= v >> 8; 448 442 v |= v >> 16; 449 #if defined(__LP64__) && __LP64__450 v |= v >> 32;451 #endif452 443 v++; 453 444 return v;
Note: See TracChangeset
for help on using the changeset viewer.