Ignore:
Timestamp:
Dec 8, 2010, 1:44:38 PM (14 years ago)
Author:
[email protected]
Message:

2010-12-08 Oliver Hunt <[email protected]>

Reviewed by Gavin Barraclough.

Marking the active global object re-enters through markConservatively
https://bugs.webkit.org/show_bug.cgi?id=50711

draining of the MarkStack is not allowed to be re-entrant, we got away
with this simply due to the logic in MarkStack::drain implicitly handling
changes that could be triggered by the re-entry.

Just to be safe this patch removes the re-entry through markConservatively
so we don't accidentally introduce such an issue in future. I've also
added an assertion to catch such errors.

  • runtime/Collector.cpp: (JSC::Heap::markConservatively): (JSC::Heap::markCurrentThreadConservativelyInternal): (JSC::Heap::markOtherThreadConservatively):
  • runtime/JSArray.h: (JSC::MarkStack::drain):
  • runtime/MarkStack.h: (JSC::MarkStack::MarkStack):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSArray.h

    r65588 r73545  
    223223    inline void MarkStack::drain()
    224224    {
     225#if !ASSERT_DISABLED
     226        ASSERT(!m_isDraining);
     227        m_isDraining = true;
     228#endif
    225229        while (!m_markSets.isEmpty() || !m_values.isEmpty()) {
    226230            while (!m_markSets.isEmpty() && m_values.size() < 50) {
     
    261265                markChildren(m_values.removeLast());
    262266        }
     267#if !ASSERT_DISABLED
     268        m_isDraining = false;
     269#endif
    263270    }
    264271
Note: See TracChangeset for help on using the changeset viewer.