Ignore:
Timestamp:
Jan 20, 2010, 3:30:02 PM (15 years ago)
Author:
[email protected]
Message:

<rdar://problem/7562708> REGRESSION(53460): Heap::destroy may not run
all destructors

Reviewed by Oliver Hunt.

  • runtime/Collector.cpp:

(JSC::Heap::freeBlocks): Instead of fully marking protected objects,
just set their mark bits. This prevents protected objects from keeping
unprotected objects alive. Destructor order is not guaranteed, so it's
OK to destroy objects pointed to by protected objects before destroying
protected objects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Collector.cpp

    r53460 r53572  
    338338
    339339    clearMarkBits();
    340     markProtectedObjects(m_globalData->markStack);
     340    ProtectCountSet::iterator protectedValuesEnd = protectedValuesCopy.end();
     341    for (ProtectCountSet::iterator it = protectedValuesCopy.begin(); it != protectedValuesEnd; ++it)
     342        markCell(it->first);
    341343
    342344    m_heap.nextCell = 0;
     
    349351    ASSERT(!protectedObjectCount());
    350352
    351     ProtectCountSet::iterator protectedValuesEnd = protectedValuesCopy.end();
    352     for (ProtectCountSet::iterator protectedValuesIt = protectedValuesCopy.begin(); protectedValuesIt != protectedValuesEnd; ++protectedValuesIt)
    353         protectedValuesIt->first->~JSCell();
     353    protectedValuesEnd = protectedValuesCopy.end();
     354    for (ProtectCountSet::iterator it = protectedValuesCopy.begin(); it != protectedValuesEnd; ++it)
     355        it->first->~JSCell();
    354356
    355357    for (size_t block = 0; block < m_heap.usedBlocks; ++block)
Note: See TracChangeset for help on using the changeset viewer.