WebKit Bugzilla
Attachment 372490 Details for
Bug 199030
: Some of the ASSERTs in CachedTypes.cpp should be RELEASE_ASSERTs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199030-20190619223454.patch (text/plain), 3.67 KB, created by
Tadeu Zagallo
on 2019-06-19 13:34:56 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Tadeu Zagallo
Created:
2019-06-19 13:34:56 PDT
Size:
3.67 KB
patch
obsolete
>Subversion Revision: 246350 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 1c08f6039c11084d1187a15c60f0e13526899bdd..8af5cc7f8273bfca54a9b464df3ae5cd58d424d1 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,23 @@ >+2019-06-19 Tadeu Zagallo <tzagallo@apple.com> >+ >+ Some of the ASSERTs in CachedTypes.cpp should be RELEASE_ASSERTs >+ https://bugs.webkit.org/show_bug.cgi?id=199030 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ These assertions represent strong assumptions that the cache makes so >+ it's not safe to keep executing if they fail. >+ >+ * runtime/CachedTypes.cpp: >+ (JSC::Encoder::malloc): >+ (JSC::Encoder::Page::alignEnd): >+ (JSC::Decoder::ptrForOffsetFromBase): >+ (JSC::Decoder::handleForEnvironment const): >+ (JSC::Decoder::setHandleForEnvironment): >+ (JSC::CachedPtr::get const): >+ (JSC::CachedOptional::encode): >+ (JSC::CachedOptional::decodeAsPtr const): Deleted. >+ > 2019-06-11 Alexey Shvayka <shvaikalesh@gmail.com> > > JSC should throw if proxy set returns falsish in strict mode context >diff --git a/Source/JavaScriptCore/runtime/CachedTypes.cpp b/Source/JavaScriptCore/runtime/CachedTypes.cpp >index b1623695cb63e4e9d96376f1c241f736f9f9be75..feca4ec14584d1974a0275a0f5ddb2fb38051b7f 100644 >--- a/Source/JavaScriptCore/runtime/CachedTypes.cpp >+++ b/Source/JavaScriptCore/runtime/CachedTypes.cpp >@@ -101,7 +101,7 @@ public: > > Allocation malloc(unsigned size) > { >- ASSERT(size); >+ RELEASE_ASSERT(size); > ptrdiff_t offset; > if (m_currentPage->malloc(size, offset)) > return Allocation { m_currentPage->buffer() + offset, m_baseOffset + offset }; >@@ -244,7 +244,7 @@ private: > ptrdiff_t size = roundUpToMultipleOf(alignof(std::max_align_t), m_offset); > if (size == m_offset) > return; >- ASSERT(static_cast<size_t>(size) <= m_capacity); >+ RELEASE_ASSERT(static_cast<size_t>(size) <= m_capacity); > m_offset = size; > } > >@@ -323,23 +323,21 @@ WTF::Optional<void*> Decoder::cachedPtrForOffset(ptrdiff_t offset) > > const void* Decoder::ptrForOffsetFromBase(ptrdiff_t offset) > { >-#ifndef NDEBUG > ASSERT(offset > 0 && static_cast<size_t>(offset) < m_cachedBytecode->size()); >-#endif > return m_cachedBytecode->data() + offset; > } > > CompactVariableMap::Handle Decoder::handleForEnvironment(CompactVariableEnvironment* environment) const > { > auto it = m_environmentToHandleMap.find(environment); >- ASSERT(it != m_environmentToHandleMap.end()); >+ RELEASE_ASSERT(it != m_environmentToHandleMap.end()); > return it->value; > } > > void Decoder::setHandleForEnvironment(CompactVariableEnvironment* environment, const CompactVariableMap::Handle& handle) > { > auto addResult = m_environmentToHandleMap.add(environment, handle); >- ASSERT_UNUSED(addResult, addResult.isNewEntry); >+ RELEASE_ASSERT(addResult.isNewEntry); > } > > void Decoder::addLeafExecutable(const UnlinkedFunctionExecutable* executable, ptrdiff_t offset) >@@ -525,8 +523,7 @@ public: > private: > const T* get() const > { >- if (this->isEmpty()) >- return nullptr; >+ RELEASE_ASSERT(!this->isEmpty()); > return this->template buffer<T>(); > } > }; >@@ -824,14 +821,6 @@ public: > else > encode(encoder, { *source }); > } >- >- SourceType<T>* decodeAsPtr(Decoder& decoder) const >- { >- if (this->isEmpty()) >- return nullptr; >- >- return this->template buffer<T>()->decode(decoder); >- } > }; > > class CachedSimpleJumpTable : public CachedObject<UnlinkedSimpleJumpTable> {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199030
: 372490