Ignore:
Timestamp:
Jan 12, 2015, 8:29:22 AM (10 years ago)
Author:
[email protected]
Message:

Local JSArray* "keys" in objectConstructorKeys() is not marked during garbage collection
https://bugs.webkit.org/show_bug.cgi?id=140348

Reviewed by Mark Lam.

Move the address of the local variable that is used to demarcate the top of the stack for
conservative roots down to MachineThreads::gatherFromCurrentThread() since it also gets
the register values using setjmp(). That way we don't lose any callee save register
contents between Heap::markRoots(), where it was set, and gatherFromCurrentThread().
If we lose any JSObject* that are only in callee save registers, they will be GC'ed
erroneously.

  • heap/Heap.cpp:

(JSC::Heap::markRoots):
(JSC::Heap::gatherStackRoots):

  • heap/Heap.h:
  • heap/MachineStackMarker.cpp:

(JSC::MachineThreads::gatherFromCurrentThread):
(JSC::MachineThreads::gatherConservativeRoots):

  • heap/MachineStackMarker.h:
File:
1 edited

Legend:

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

    r176424 r178266  
    505505    // We gather conservative roots before clearing mark bits because conservative
    506506    // gathering uses the mark bits to determine whether a reference is valid.
    507     void* dummy;
    508507    ConservativeRoots conservativeRoots(&m_objectSpace.blocks(), &m_storageSpace);
    509     gatherStackRoots(conservativeRoots, &dummy);
     508    gatherStackRoots(conservativeRoots);
    510509    gatherJSStackRoots(conservativeRoots);
    511510    gatherScratchBufferRoots(conservativeRoots);
     
    567566}
    568567
    569 void Heap::gatherStackRoots(ConservativeRoots& roots, void** dummy)
     568void Heap::gatherStackRoots(ConservativeRoots& roots)
    570569{
    571570    GCPHASE(GatherStackRoots);
    572571    m_jitStubRoutines.clearMarks();
    573     m_machineThreads.gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks, dummy);
     572    m_machineThreads.gatherConservativeRoots(roots, m_jitStubRoutines, m_codeBlocks);
    574573}
    575574
Note: See TracChangeset for help on using the changeset viewer.