Changeset 242053 in webkit


Ignore:
Timestamp:
Feb 25, 2019 12:13:01 PM (5 years ago)
Author:
Tadeu Zagallo
Message:

Remove unnecessary WTF:: prefixes in CachedTypes
https://bugs.webkit.org/show_bug.cgi?id=194936

Reviewed by Saam Barati.

Cleanup unnecessary prefixes from Optional, roundUpToMultipleOf and
pageSize.

  • runtime/CachedTypes.cpp:

(JSC::Encoder::cachedOffsetForPtr):
(JSC::Encoder::Page::malloc):
(JSC::Encoder::allocateNewPage):
(JSC::CachedPtr::encode):
(JSC::CachedPtr::decode const):
(JSC::CachedOptional::encode):
(JSC::CachedOptional::decode const):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r242047 r242053  
     12019-02-25  Tadeu Zagallo  <tzagallo@apple.com>
     2
     3        Remove unnecessary WTF:: prefixes in CachedTypes
     4        https://bugs.webkit.org/show_bug.cgi?id=194936
     5
     6        Reviewed by Saam Barati.
     7
     8        Cleanup unnecessary prefixes from Optional, roundUpToMultipleOf and
     9        pageSize.
     10
     11        * runtime/CachedTypes.cpp:
     12        (JSC::Encoder::cachedOffsetForPtr):
     13        (JSC::Encoder::Page::malloc):
     14        (JSC::Encoder::allocateNewPage):
     15        (JSC::CachedPtr::encode):
     16        (JSC::CachedPtr::decode const):
     17        (JSC::CachedOptional::encode):
     18        (JSC::CachedOptional::decode const):
     19
    1202019-02-25  Yusuke Suzuki  <ysuzuki@apple.com>
    221
  • trunk/Source/JavaScriptCore/runtime/CachedTypes.cpp

    r241938 r242053  
    128128    }
    129129
    130     WTF::Optional<ptrdiff_t> cachedOffsetForPtr(const void* ptr)
     130    Optional<ptrdiff_t> cachedOffsetForPtr(const void* ptr)
    131131    {
    132132        auto it = m_ptrToOffsetMap.find(ptr);
     
    162162        {
    163163            size_t alignment = std::min(alignof(std::max_align_t), static_cast<size_t>(WTF::roundUpToPowerOfTwo(size)));
    164             ptrdiff_t offset = WTF::roundUpToMultipleOf(alignment, m_offset);
    165             size = WTF::roundUpToMultipleOf(alignment, size);
     164            ptrdiff_t offset = roundUpToMultipleOf(alignment, m_offset);
     165            size = roundUpToMultipleOf(alignment, size);
    166166            if (static_cast<size_t>(offset + size) > m_capacity)
    167167                return false;
     
    193193    void allocateNewPage(size_t size = 0)
    194194    {
    195         static size_t minPageSize = WTF::pageSize();
     195        static size_t minPageSize = pageSize();
    196196        if (m_currentPage)
    197197            m_baseOffset += m_currentPage->size();
     
    199199            size = minPageSize;
    200200        else
    201             size = WTF::roundUpToMultipleOf(minPageSize, size);
     201            size = roundUpToMultipleOf(minPageSize, size);
    202202        m_pages.append(Page { size });
    203203        m_currentPage = &m_pages.last();
     
    246246    }
    247247
    248     WTF::Optional<void*> cachedPtrForOffset(ptrdiff_t offset)
     248    Optional<void*> cachedPtrForOffset(ptrdiff_t offset)
    249249    {
    250250        auto it = m_offsetToPtrMap.find(offset);
     
    378378            return;
    379379
    380         if (WTF::Optional<ptrdiff_t> offset = encoder.cachedOffsetForPtr(src)) {
     380        if (Optional<ptrdiff_t> offset = encoder.cachedOffsetForPtr(src)) {
    381381            this->m_offset = *offset - encoder.offsetOf(&this->m_offset);
    382382            return;
     
    397397
    398398        ptrdiff_t bufferOffset = decoder.offsetOf(this->buffer());
    399         if (WTF::Optional<void*> ptr = decoder.cachedPtrForOffset(bufferOffset)) {
     399        if (Optional<void*> ptr = decoder.cachedPtrForOffset(bufferOffset)) {
    400400            isNewAllocation = false;
    401401            return reinterpret_cast<Source*>(*ptr);
     
    690690
    691691template<typename T>
    692 class CachedOptional : public VariableLengthObject<WTF::Optional<SourceType<T>>> {
    693 public:
    694     void encode(Encoder& encoder, const WTF::Optional<SourceType<T>>& source)
     692class CachedOptional : public VariableLengthObject<Optional<SourceType<T>>> {
     693public:
     694    void encode(Encoder& encoder, const Optional<SourceType<T>>& source)
    695695    {
    696696        m_isEmpty = !source;
     
    702702    }
    703703
    704     WTF::Optional<SourceType<T>> decode(Decoder& decoder) const
     704    Optional<SourceType<T>> decode(Decoder& decoder) const
    705705    {
    706706        if (m_isEmpty)
     
    710710    }
    711711
    712     void decode(Decoder& decoder, WTF::Optional<SourceType<T>>& dst) const
     712    void decode(Decoder& decoder, Optional<SourceType<T>>& dst) const
    713713    {
    714714        dst = decode(decoder);
Note: See TracChangeset for help on using the changeset viewer.