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/Collector.cpp

    r73223 r73545  
    686686                    continue;
    687687                markStack.append(reinterpret_cast<JSCell*>(xAsBits));
    688                 markStack.drain();
    689688            }
    690689        }
     
    698697    void* stackBase = currentThreadStackBase();
    699698    markConservatively(markStack, stackPointer, stackBase);
     699    markStack.drain();
    700700}
    701701
     
    860860    // mark the thread's registers
    861861    markConservatively(markStack, static_cast<void*>(&regs), static_cast<void*>(reinterpret_cast<char*>(&regs) + regSize));
     862    markStack.drain();
    862863
    863864    void* stackPointer = otherThreadStackPointer(regs);
    864865    markConservatively(markStack, stackPointer, thread->stackBase);
     866    markStack.drain();
    865867
    866868    resumeThread(thread->platformThread);
Note: See TracChangeset for help on using the changeset viewer.