Changeset 242053 in webkit
- Timestamp:
- Feb 25, 2019 12:13:01 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r242047 r242053 1 2019-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 1 20 2019-02-25 Yusuke Suzuki <ysuzuki@apple.com> 2 21 -
trunk/Source/JavaScriptCore/runtime/CachedTypes.cpp
r241938 r242053 128 128 } 129 129 130 WTF::Optional<ptrdiff_t> cachedOffsetForPtr(const void* ptr)130 Optional<ptrdiff_t> cachedOffsetForPtr(const void* ptr) 131 131 { 132 132 auto it = m_ptrToOffsetMap.find(ptr); … … 162 162 { 163 163 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); 166 166 if (static_cast<size_t>(offset + size) > m_capacity) 167 167 return false; … … 193 193 void allocateNewPage(size_t size = 0) 194 194 { 195 static size_t minPageSize = WTF::pageSize();195 static size_t minPageSize = pageSize(); 196 196 if (m_currentPage) 197 197 m_baseOffset += m_currentPage->size(); … … 199 199 size = minPageSize; 200 200 else 201 size = WTF::roundUpToMultipleOf(minPageSize, size);201 size = roundUpToMultipleOf(minPageSize, size); 202 202 m_pages.append(Page { size }); 203 203 m_currentPage = &m_pages.last(); … … 246 246 } 247 247 248 WTF::Optional<void*> cachedPtrForOffset(ptrdiff_t offset)248 Optional<void*> cachedPtrForOffset(ptrdiff_t offset) 249 249 { 250 250 auto it = m_offsetToPtrMap.find(offset); … … 378 378 return; 379 379 380 if ( WTF::Optional<ptrdiff_t> offset = encoder.cachedOffsetForPtr(src)) {380 if (Optional<ptrdiff_t> offset = encoder.cachedOffsetForPtr(src)) { 381 381 this->m_offset = *offset - encoder.offsetOf(&this->m_offset); 382 382 return; … … 397 397 398 398 ptrdiff_t bufferOffset = decoder.offsetOf(this->buffer()); 399 if ( WTF::Optional<void*> ptr = decoder.cachedPtrForOffset(bufferOffset)) {399 if (Optional<void*> ptr = decoder.cachedPtrForOffset(bufferOffset)) { 400 400 isNewAllocation = false; 401 401 return reinterpret_cast<Source*>(*ptr); … … 690 690 691 691 template<typename T> 692 class CachedOptional : public VariableLengthObject< WTF::Optional<SourceType<T>>> {693 public: 694 void encode(Encoder& encoder, const WTF::Optional<SourceType<T>>& source)692 class CachedOptional : public VariableLengthObject<Optional<SourceType<T>>> { 693 public: 694 void encode(Encoder& encoder, const Optional<SourceType<T>>& source) 695 695 { 696 696 m_isEmpty = !source; … … 702 702 } 703 703 704 WTF::Optional<SourceType<T>> decode(Decoder& decoder) const704 Optional<SourceType<T>> decode(Decoder& decoder) const 705 705 { 706 706 if (m_isEmpty) … … 710 710 } 711 711 712 void decode(Decoder& decoder, WTF::Optional<SourceType<T>>& dst) const712 void decode(Decoder& decoder, Optional<SourceType<T>>& dst) const 713 713 { 714 714 dst = decode(decoder);
Note: See TracChangeset
for help on using the changeset viewer.