Changeset 77081 in webkit
- Timestamp:
- Jan 29, 2011 10:11:07 PM (13 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r77080 r77081 1 2011-01-29 Geoffrey Garen <ggaren@apple.com> 2 3 Reviewed by Cameron Zwarich. 4 5 Simplified heap destruction 6 https://bugs.webkit.org/show_bug.cgi?id=53392 7 8 * JavaScriptCore.exp: 9 * runtime/Heap.cpp: 10 (JSC::Heap::destroy): 11 * runtime/Heap.h: 12 * runtime/MarkedSpace.cpp: 13 (JSC::MarkedSpace::destroy): 14 * runtime/MarkedSpace.h: Don't go out of our way to destroy GC-protected 15 cells last -- the difficult contortions required to do so just don't seem 16 justified. We make no guarantees about GC protection after the client 17 throws away JSGlobalData, and it doesn't seem like any meaningful 18 guarantee is even possible. 19 1 20 2011-01-29 Geoffrey Garen <ggaren@apple.com> 2 21 -
trunk/Source/JavaScriptCore/JavaScriptCore.exp
r77077 r77081 197 197 __ZN3JSC20MarkedArgumentBuffer10slowAppendENS_7JSValueE 198 198 __ZN3JSC20createReferenceErrorEPNS_9ExecStateERKNS_7UStringE 199 __ZN3JSC22globalMemoryStatisticsEv200 199 __ZN3JSC23AbstractSamplingCounter4dumpEv 201 200 __ZN3JSC23objectProtoFuncToStringEPNS_9ExecStateE … … 520 519 __ZNK3JSC24JSObjectWithGlobalObject12globalObjectEv 521 520 __ZNK3JSC4Heap11objectCountEv 522 __ZNK3JSC4Heap4sizeEv523 521 __ZNK3JSC4Heap8capacityEv 524 522 __ZNK3JSC6JSCell11toPrimitiveEPNS_9ExecStateENS_22PreferredPrimitiveTypeE -
trunk/Source/JavaScriptCore/runtime/Heap.cpp
r77077 r77081 73 73 m_markListSet = 0; 74 74 75 ProtectCountSet protectedValuesCopy = m_protectedValues; 76 m_markedSpace.destroy(protectedValuesCopy); 77 ASSERT(!protectedObjectCount()); 75 m_markedSpace.destroy(); 78 76 79 77 m_globalData = 0; -
trunk/Source/JavaScriptCore/runtime/Heap.h
r77077 r77081 45 45 46 46 typedef std::pair<JSValue, UString> ValueStringPair; 47 typedef HashCountedSet<JSCell*> ProtectCountSet; 47 48 48 49 enum OperationInProgress { NoOperation, Allocation, Collection }; -
trunk/Source/JavaScriptCore/runtime/MarkedSpace.cpp
r77080 r77081 49 49 } 50 50 51 void MarkedSpace::destroy(ProtectCountSet& protectedValuesCopy) 52 { 53 clearMarkBits(); 54 ProtectCountSet::iterator protectedValuesEnd = protectedValuesCopy.end(); 55 for (ProtectCountSet::iterator it = protectedValuesCopy.begin(); it != protectedValuesEnd; ++it) 56 markCell(it->first); 57 58 m_heap.nextCell = 0; 59 m_heap.nextBlock = 0; 60 DeadObjectIterator it(m_heap, m_heap.nextBlock, m_heap.nextCell); 61 DeadObjectIterator end(m_heap, m_heap.usedBlocks); 62 for ( ; it != end; ++it) 63 (*it)->~JSCell(); 64 65 protectedValuesEnd = protectedValuesCopy.end(); 66 for (ProtectCountSet::iterator it = protectedValuesCopy.begin(); it != protectedValuesEnd; ++it) 67 it->first->~JSCell(); 68 51 void MarkedSpace::destroy() 52 { 69 53 for (size_t block = 0; block < m_heap.usedBlocks; ++block) 70 m_heap.blocks[block].deallocate(); 71 54 freeBlock(block); 72 55 fastFree(m_heap.blocks); 73 56 -
trunk/Source/JavaScriptCore/runtime/MarkedSpace.h
r77080 r77081 47 47 #endif 48 48 49 typedef HashCountedSet<JSCell*> ProtectCountSet;50 51 49 struct CollectorHeap { 52 50 size_t nextBlock; … … 73 71 74 72 MarkedSpace(JSGlobalData*); 75 void destroy( ProtectCountSet&);73 void destroy(); 76 74 77 75 JSGlobalData* globalData() { return m_globalData; }
Note: See TracChangeset
for help on using the changeset viewer.