Changeset 141916 in webkit


Ignore:
Timestamp:
Feb 5, 2013 12:43:27 PM (11 years ago)
Author:
mhahnenberg@apple.com
Message:

Structure::m_outOfLineCapacity is unnecessary
https://bugs.webkit.org/show_bug.cgi?id=108206

Reviewed by Darin Adler.

Simplifying the utility functions that we use since we don't need a
bunch of fancy templates for this one specific call site.

Source/JavaScriptCore:

  • runtime/Structure.h:

(JSC::Structure::outOfLineCapacity):

Source/WTF:

  • wtf/MathExtras.h:

(WTF::roundUpToPowerOfTwo):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r141914 r141916  
     12013-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
    1142013-02-05  Mark Hahnenberg  <mhahnenberg@apple.com>
    215
  • trunk/Source/JavaScriptCore/runtime/Structure.h

    r141681 r141916  
    197197
    198198            ASSERT(outOfLineSize > initialOutOfLineCapacity);
    199             return WTF::roundUpToPowerOf<outOfLineGrowthFactor>(outOfLineSize);
     199            COMPILE_ASSERT(outOfLineGrowthFactor == 2, outOfLineGrowthFactor_is_two);
     200            return WTF::roundUpToPowerOfTwo(outOfLineSize);
    200201        }
    201202        unsigned outOfLineSize() const
  • trunk/Source/WTF/ChangeLog

    r141909 r141916  
     12013-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
    1142013-02-05  Sheriff Bot  <webkit.review.bot@gmail.com>
    215
  • trunk/Source/WTF/wtf/MathExtras.h

    r141295 r141916  
    432432namespace WTF {
    433433
    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 
    440434// From http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2
    441 template<> inline size_t roundUpToPowerOf<2>(size_t v)
     435inline uint32_t roundUpToPowerOfTwo(uint32_t v)
    442436{
    443437    v--;
     
    447441    v |= v >> 8;
    448442    v |= v >> 16;
    449 #if defined(__LP64__) && __LP64__
    450     v |= v >> 32;
    451 #endif
    452443    v++;
    453444    return v;
Note: See TracChangeset for help on using the changeset viewer.