Ignore:
Timestamp:
Feb 5, 2014, 9:31:47 AM (11 years ago)
Author:
[email protected]
Message:

Malloc called beneath MachineThreads::gatherFromOtherThread(), while forbidden
https://bugs.webkit.org/show_bug.cgi?id=128202

Reviewed by Geoffrey Garen.

This patch uses the new GCSegmentedArray to replace the Vector that was used
to record the set of currently executing CodeBlocks during the conservative
stack scan. This is primarily to avoid the possibility of the Vector resizing
while FastMalloc is forbidden.

  • heap/BlockAllocator.h:
  • heap/CodeBlockSet.cpp:

(JSC::CodeBlockSet::CodeBlockSet):
(JSC::CodeBlockSet::rememberCurrentlyExecutingCodeBlocks):

  • heap/CodeBlockSet.h:
  • heap/GCSegmentedArray.h:

(JSC::GCSegmentedArray::begin):
(JSC::GCSegmentedArray::end):
(JSC::GCSegmentedArrayIterator::GCSegmentedArrayIterator):
(JSC::GCSegmentedArrayIterator::get):
(JSC::GCSegmentedArrayIterator::operator*):
(JSC::GCSegmentedArrayIterator::operator->):
(JSC::GCSegmentedArrayIterator::operator==):
(JSC::GCSegmentedArrayIterator::operator!=):
(JSC::GCSegmentedArrayIterator::operator++):

  • heap/Heap.cpp:

(JSC::Heap::Heap):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/heap/CodeBlockSet.cpp

    r162377 r163450  
    3434static const bool verbose = false;
    3535
    36 CodeBlockSet::CodeBlockSet() { }
     36CodeBlockSet::CodeBlockSet(BlockAllocator& blockAllocator)
     37    : m_currentlyExecuting(blockAllocator)
     38{
     39}
    3740
    3841CodeBlockSet::~CodeBlockSet()
     
    110113{
    111114#if ENABLE(GGC)
    112     for (size_t i = 0; i < m_currentlyExecuting.size(); ++i)
    113         heap->addToRememberedSet(m_currentlyExecuting[i]->ownerExecutable());
     115    for (CodeBlock* codeBlock : m_currentlyExecuting)
     116        heap->addToRememberedSet(codeBlock->ownerExecutable());
    114117    m_currentlyExecuting.clear();
    115118#else
Note: See TracChangeset for help on using the changeset viewer.