summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/heap
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-27 21:51:42 +0200
commitbe01689f43cf6882cf670d33df49ead1f570c53a (patch)
tree4bb2161d8983b38e3e7ed37b4a50303bfd5e2e85 /Source/JavaScriptCore/heap
parenta89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd (diff)
downloadqtwebkit-be01689f43cf6882cf670d33df49ead1f570c53a.tar.gz
Imported WebKit commit 8d6c5efc74f0222dfc7bcce8d845d4a2707ed9e6 (http://svn.webkit.org/repository/webkit/trunk@118629)
Diffstat (limited to 'Source/JavaScriptCore/heap')
-rw-r--r--Source/JavaScriptCore/heap/MarkedBlock.cpp6
-rw-r--r--Source/JavaScriptCore/heap/WeakBlock.h10
-rw-r--r--Source/JavaScriptCore/heap/WeakSetInlines.h13
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