Changeset 160822 in webkit
- Timestamp:
- Dec 18, 2013 8:30:02 PM (10 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r160812 r160822 1 2013-12-18 Mark Hahnenberg <mhahnenberg@apple.com> 2 3 DelayedReleaseScope is in the wrong place 4 https://bugs.webkit.org/show_bug.cgi?id=125876 5 6 Reviewed by Geoffrey Garen. 7 8 The DelayedReleaseScope needs to be around the free list sweeping in MarkedAllocator::tryAllocateHelper. 9 This location gives us a good safe point between getting ready to allocate (i.e. identifying a non-empty 10 free list) and doing the actual allocation (popping the free list). 11 12 * heap/MarkedAllocator.cpp: 13 (JSC::MarkedAllocator::tryAllocateHelper): 14 (JSC::MarkedAllocator::allocateSlowCase): 15 (JSC::MarkedAllocator::addBlock): 16 * runtime/JSCellInlines.h: 17 (JSC::allocateCell): 18 1 19 2013-12-18 Gustavo Noronha Silva <gns@gnome.org> 2 20 -
trunk/Source/JavaScriptCore/heap/MarkedAllocator.cpp
r159351 r160822 31 31 inline void* MarkedAllocator::tryAllocateHelper(size_t bytes) 32 32 { 33 if (!m_freeList.head) { 33 // We need a while loop to check the free list because the DelayedReleaseScope 34 // could cause arbitrary code to execute and exhaust the free list that we 35 // thought had elements in it. 36 while (!m_freeList.head) { 37 DelayedReleaseScope delayedReleaseScope(*m_markedSpace); 34 38 if (m_currentBlock) { 35 39 ASSERT(m_currentBlock == m_blocksToSweep); … … 60 64 } 61 65 } 62 66 67 ASSERT(m_freeList.head); 63 68 MarkedBlock::FreeCell* head = m_freeList.head; 64 69 m_freeList.head = head->next; … … 79 84 { 80 85 ASSERT(m_heap->vm()->currentThreadIsHoldingAPILock()); 81 DelayedReleaseScope delayedReleaseScope(*m_markedSpace);82 86 #if COLLECT_ON_EVERY_ALLOCATION 83 87 if (!m_heap->isDeferred()) … … 127 131 void MarkedAllocator::addBlock(MarkedBlock* block) 128 132 { 133 // Satisfy the ASSERT in MarkedBlock::sweep. 134 DelayedReleaseScope delayedReleaseScope(*m_markedSpace); 129 135 ASSERT(!m_currentBlock); 130 136 ASSERT(!m_freeList.head); -
trunk/Source/JavaScriptCore/runtime/JSCellInlines.h
r157539 r160822 89 89 ASSERT(!DisallowGC::isGCDisallowedOnCurrentThread()); 90 90 ASSERT(size >= sizeof(T)); 91 #if ENABLE(GC_VALIDATION)92 ASSERT(!heap.vm()->isInitializingObject());93 heap.vm()->setInitializingObjectClass(T::info());94 #endif95 91 JSCell* result = 0; 96 92 if (T::needsDestruction && T::hasImmortalStructure) … … 100 96 else 101 97 result = static_cast<JSCell*>(heap.allocateWithoutDestructor(size)); 98 #if ENABLE(GC_VALIDATION) 99 ASSERT(!heap.vm()->isInitializingObject()); 100 heap.vm()->setInitializingObjectClass(T::info()); 101 #endif 102 102 result->clearStructure(); 103 103 return result;
Note: See TracChangeset
for help on using the changeset viewer.