Changeset 246610 in webkit
- Timestamp:
- Jun 19, 2019 2:29:48 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r246596 r246610 1 2019-06-19 Tadeu Zagallo <tzagallo@apple.com> 2 3 Some of the ASSERTs in CachedTypes.cpp should be RELEASE_ASSERTs 4 https://bugs.webkit.org/show_bug.cgi?id=199030 5 6 Reviewed by Mark Lam. 7 8 These assertions represent strong assumptions that the cache makes so 9 it's not safe to keep executing if they fail. 10 11 * runtime/CachedTypes.cpp: 12 (JSC::Encoder::malloc): 13 (JSC::Encoder::Page::alignEnd): 14 (JSC::Decoder::ptrForOffsetFromBase): 15 (JSC::Decoder::handleForEnvironment const): 16 (JSC::Decoder::setHandleForEnvironment): 17 (JSC::CachedPtr::get const): 18 (JSC::CachedOptional::encode): 19 (JSC::CachedOptional::decodeAsPtr const): Deleted. 20 1 21 2019-06-19 Adrian Perez de Castro <aperez@igalia.com> 2 22 -
trunk/Source/JavaScriptCore/runtime/CachedTypes.cpp
r246490 r246610 102 102 Allocation malloc(unsigned size) 103 103 { 104 ASSERT(size);104 RELEASE_ASSERT(size); 105 105 ptrdiff_t offset; 106 106 if (m_currentPage->malloc(size, offset)) … … 245 245 if (size == m_offset) 246 246 return; 247 ASSERT(static_cast<size_t>(size) <= m_capacity);247 RELEASE_ASSERT(static_cast<size_t>(size) <= m_capacity); 248 248 m_offset = size; 249 249 } … … 324 324 const void* Decoder::ptrForOffsetFromBase(ptrdiff_t offset) 325 325 { 326 #ifndef NDEBUG327 326 ASSERT(offset > 0 && static_cast<size_t>(offset) < m_cachedBytecode->size()); 328 #endif329 327 return m_cachedBytecode->data() + offset; 330 328 } … … 333 331 { 334 332 auto it = m_environmentToHandleMap.find(environment); 335 ASSERT(it != m_environmentToHandleMap.end());333 RELEASE_ASSERT(it != m_environmentToHandleMap.end()); 336 334 return it->value; 337 335 } … … 340 338 { 341 339 auto addResult = m_environmentToHandleMap.add(environment, handle); 342 ASSERT_UNUSED(addResult,addResult.isNewEntry);340 RELEASE_ASSERT(addResult.isNewEntry); 343 341 } 344 342 … … 526 524 const T* get() const 527 525 { 528 if (this->isEmpty()) 529 return nullptr; 526 RELEASE_ASSERT(!this->isEmpty()); 530 527 return this->template buffer<T>(); 531 528 } … … 824 821 else 825 822 encode(encoder, { *source }); 826 }827 828 SourceType<T>* decodeAsPtr(Decoder& decoder) const829 {830 if (this->isEmpty())831 return nullptr;832 833 return this->template buffer<T>()->decode(decoder);834 823 } 835 824 };
Note: See TracChangeset
for help on using the changeset viewer.