Reviewed by Cameron Zwarich.
Simplified heap destruction
https://bugs.webkit.org/show_bug.cgi?id=53392
* JavaScriptCore.exp:
* runtime/Heap.cpp:
(JSC::Heap::destroy):
* runtime/Heap.h:
* runtime/MarkedSpace.cpp:
(JSC::MarkedSpace::destroy):
* runtime/MarkedSpace.h: Don't go out of our way to destroy GC-protected
cells last -- the difficult contortions required to do so just don't seem
justified. We make no guarantees about GC protection after the client
throws away JSGlobalData, and it doesn't seem like any meaningful
guarantee is even possible.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77081
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-01-29 Geoffrey Garen <ggaren@apple.com>
+
+ Reviewed by Cameron Zwarich.
+
+ Simplified heap destruction
+ https://bugs.webkit.org/show_bug.cgi?id=53392
+
+ * JavaScriptCore.exp:
+ * runtime/Heap.cpp:
+ (JSC::Heap::destroy):
+ * runtime/Heap.h:
+ * runtime/MarkedSpace.cpp:
+ (JSC::MarkedSpace::destroy):
+ * runtime/MarkedSpace.h: Don't go out of our way to destroy GC-protected
+ cells last -- the difficult contortions required to do so just don't seem
+ justified. We make no guarantees about GC protection after the client
+ throws away JSGlobalData, and it doesn't seem like any meaningful
+ guarantee is even possible.
+
2011-01-29 Geoffrey Garen <ggaren@apple.com>
Reviewed by Maciej Stachowiak.
__ZN3JSC19initializeThreadingEv
__ZN3JSC20MarkedArgumentBuffer10slowAppendENS_7JSValueE
__ZN3JSC20createReferenceErrorEPNS_9ExecStateERKNS_7UStringE
-__ZN3JSC22globalMemoryStatisticsEv
__ZN3JSC23AbstractSamplingCounter4dumpEv
__ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateE
__ZN3JSC23setUpStaticFunctionSlotEPNS_9ExecStateEPKNS_9HashEntryEPNS_8JSObjectERKNS_10IdentifierERNS_12PropertySlotE
__ZNK3JSC19SourceProviderCache8byteSizeEv
__ZNK3JSC24JSObjectWithGlobalObject12globalObjectEv
__ZNK3JSC4Heap11objectCountEv
-__ZNK3JSC4Heap4sizeEv
__ZNK3JSC4Heap8capacityEv
__ZNK3JSC6JSCell11toPrimitiveEPNS_9ExecStateENS_22PreferredPrimitiveTypeE
__ZNK3JSC6JSCell12toThisObjectEPNS_9ExecStateE
delete m_markListSet;
m_markListSet = 0;
- ProtectCountSet protectedValuesCopy = m_protectedValues;
- m_markedSpace.destroy(protectedValuesCopy);
- ASSERT(!protectedObjectCount());
+ m_markedSpace.destroy();
m_globalData = 0;
}
class WeakGCHandlePool;
typedef std::pair<JSValue, UString> ValueStringPair;
+ typedef HashCountedSet<JSCell*> ProtectCountSet;
enum OperationInProgress { NoOperation, Allocation, Collection };
allocateBlock();
}
-void MarkedSpace::destroy(ProtectCountSet& protectedValuesCopy)
+void MarkedSpace::destroy()
{
- clearMarkBits();
- ProtectCountSet::iterator protectedValuesEnd = protectedValuesCopy.end();
- for (ProtectCountSet::iterator it = protectedValuesCopy.begin(); it != protectedValuesEnd; ++it)
- markCell(it->first);
-
- m_heap.nextCell = 0;
- m_heap.nextBlock = 0;
- DeadObjectIterator it(m_heap, m_heap.nextBlock, m_heap.nextCell);
- DeadObjectIterator end(m_heap, m_heap.usedBlocks);
- for ( ; it != end; ++it)
- (*it)->~JSCell();
-
- protectedValuesEnd = protectedValuesCopy.end();
- for (ProtectCountSet::iterator it = protectedValuesCopy.begin(); it != protectedValuesEnd; ++it)
- it->first->~JSCell();
-
for (size_t block = 0; block < m_heap.usedBlocks; ++block)
- m_heap.blocks[block].deallocate();
-
+ freeBlock(block);
fastFree(m_heap.blocks);
memset(&m_heap, 0, sizeof(CollectorHeap));
const size_t BLOCK_SIZE = 256 * 1024; // 256k
#endif
- typedef HashCountedSet<JSCell*> ProtectCountSet;
-
struct CollectorHeap {
size_t nextBlock;
size_t nextCell;
static void markCell(JSCell*);
MarkedSpace(JSGlobalData*);
- void destroy(ProtectCountSet&);
+ void destroy();
JSGlobalData* globalData() { return m_globalData; }