diff options
Diffstat (limited to 'Source/JavaScriptCore/heap')
-rw-r--r-- | Source/JavaScriptCore/heap/MarkedBlock.cpp | 6 | ||||
-rw-r--r-- | Source/JavaScriptCore/heap/WeakBlock.h | 10 | ||||
-rw-r--r-- | Source/JavaScriptCore/heap/WeakSetInlines.h | 13 |
3 files changed, 18 insertions, 11 deletions
diff --git a/Source/JavaScriptCore/heap/MarkedBlock.cpp b/Source/JavaScriptCore/heap/MarkedBlock.cpp index 42dc10371..0075f78d7 100644 --- a/Source/JavaScriptCore/heap/MarkedBlock.cpp +++ b/Source/JavaScriptCore/heap/MarkedBlock.cpp @@ -67,8 +67,12 @@ inline void MarkedBlock::callDestructor(JSCell* cell) #if ENABLE(SIMPLE_HEAP_PROFILING) m_heap->m_destroyedTypeCounts.countVPtr(vptr); #endif - cell->methodTable()->destroy(cell); +#if !ASSERT_DISABLED || ENABLE(GC_VALIDATION) + cell->clearStructure(); +#endif + + cell->methodTable()->destroy(cell); cell->zap(); } diff --git a/Source/JavaScriptCore/heap/WeakBlock.h b/Source/JavaScriptCore/heap/WeakBlock.h index dc3e89d55..6461f7b2f 100644 --- a/Source/JavaScriptCore/heap/WeakBlock.h +++ b/Source/JavaScriptCore/heap/WeakBlock.h @@ -115,16 +115,6 @@ inline WeakBlock::FreeCell* WeakBlock::asFreeCell(WeakImpl* weakImpl) return reinterpret_cast<FreeCell*>(weakImpl); } -inline void WeakBlock::finalize(WeakImpl* weakImpl) -{ - ASSERT(weakImpl->state() == WeakImpl::Dead); - weakImpl->setState(WeakImpl::Finalized); - WeakHandleOwner* weakHandleOwner = weakImpl->weakHandleOwner(); - if (!weakHandleOwner) - return; - weakHandleOwner->finalize(Handle<Unknown>::wrapSlot(&const_cast<JSValue&>(weakImpl->jsValue())), weakImpl->context()); -} - inline WeakImpl* WeakBlock::weakImpls() { return reinterpret_cast<WeakImpl*>(this) + ((sizeof(WeakBlock) + sizeof(WeakImpl) - 1) / sizeof(WeakImpl)); diff --git a/Source/JavaScriptCore/heap/WeakSetInlines.h b/Source/JavaScriptCore/heap/WeakSetInlines.h index 6e2420c45..c1c87b380 100644 --- a/Source/JavaScriptCore/heap/WeakSetInlines.h +++ b/Source/JavaScriptCore/heap/WeakSetInlines.h @@ -42,6 +42,19 @@ inline WeakImpl* WeakSet::allocate(JSValue jsValue, WeakHandleOwner* weakHandleO return new (NotNull, weakImpl) WeakImpl(jsValue, weakHandleOwner, context); } +inline void WeakBlock::finalize(WeakImpl* weakImpl) +{ + ASSERT(weakImpl->state() == WeakImpl::Dead); + weakImpl->setState(WeakImpl::Finalized); + WeakHandleOwner* weakHandleOwner = weakImpl->weakHandleOwner(); + if (!weakHandleOwner) + return; +#if !ASSERT_DISABLED || ENABLE(GC_VALIDATION) + weakImpl->jsValue().asCell()->clearStructure(); +#endif + weakHandleOwner->finalize(Handle<Unknown>::wrapSlot(&const_cast<JSValue&>(weakImpl->jsValue())), weakImpl->context()); +} + } // namespace JSC #endif // WeakSetInlines_h |