Changeset 86974 in webkit


Ignore:
Timestamp:
May 20, 2011 12:06:29 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-05-20 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>

Reviewed by Oliver Hunt.

Zombies should "live" forever
https://bugs.webkit.org/show_bug.cgi?id=61170

Reusing zombie cells could still hide garbage
collected cell related bugs.

  • JavaScriptCore.pro:
  • heap/MarkedBlock.cpp: (JSC::MarkedBlock::clearMarks):
  • heap/MarkedBlock.h:
  • heap/MarkedSpace.cpp: (JSC::MarkedSpace::destroy):
  • runtime/JSCell.h: (JSC::JSCell::JSValue::isZombie):
  • runtime/JSZombie.h: (JSC::JSZombie::~JSZombie):
  • runtime/WriteBarrier.h: (JSC::WriteBarrierBase::setWithoutWriteBarrier):
Location:
trunk/Source/JavaScriptCore
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r86972 r86974  
     12011-05-20  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Zombies should "live" forever
     6        https://bugs.webkit.org/show_bug.cgi?id=61170
     7
     8        Reusing zombie cells could still hide garbage
     9        collected cell related bugs.
     10
     11        * JavaScriptCore.pro:
     12        * heap/MarkedBlock.cpp:
     13        (JSC::MarkedBlock::clearMarks):
     14        * heap/MarkedBlock.h:
     15        * heap/MarkedSpace.cpp:
     16        (JSC::MarkedSpace::destroy):
     17        * runtime/JSCell.h:
     18        (JSC::JSCell::JSValue::isZombie):
     19        * runtime/JSZombie.h:
     20        (JSC::JSZombie::~JSZombie):
     21        * runtime/WriteBarrier.h:
     22        (JSC::WriteBarrierBase::setWithoutWriteBarrier):
     23
    1242011-05-20  Brady Eidson  <beidson@apple.com>
    225
  • trunk/Source/JavaScriptCore/JavaScriptCore.pro

    r85855 r86974  
    6363    assembler/ARMv7Assembler.cpp \
    6464    assembler/MacroAssemblerARM.cpp \
    65     assembler/MacroAssemblerSH4.h \
    6665    assembler/MacroAssemblerSH4.cpp \
    67     assembler/SH4Assembler.h \
    6866    bytecode/CodeBlock.cpp \
    6967    bytecode/JumpTable.cpp \
     
    168166    runtime/JSVariableObject.cpp \
    169167    runtime/JSWrapperObject.cpp \
     168    runtime/JSZombie.cpp \
    170169    runtime/LiteralParser.cpp \
    171170    runtime/Lookup.cpp \
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp

    r86499 r86974  
    8787}
    8888
     89#if ENABLE(JSC_ZOMBIES)
     90void MarkedBlock::clearMarks()
     91{
     92    /* Keep our precious zombies! */
     93    for (size_t i = firstAtom(); i < m_endAtom; i += m_atomsPerCell) {
     94        if (m_marks.get(i))
     95            continue;
     96
     97        JSCell* cell = reinterpret_cast<JSCell*>(&atoms()[i]);
     98        if (!cell->isZombie())
     99            m_marks.clear(i);
     100    }
     101}
     102#endif
     103
    89104} // namespace JSC
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.h

    r85533 r86974  
    155155    }
    156156
     157#if !ENABLE(JSC_ZOMBIES)
    157158    inline void MarkedBlock::clearMarks()
    158159    {
    159160        m_marks.clearAll();
    160161    }
     162#endif
    161163   
    162164    inline size_t MarkedBlock::markCount()
  • trunk/Source/JavaScriptCore/heap/MarkedSpace.cpp

    r86499 r86974  
    4747void MarkedSpace::destroy()
    4848{
     49    /* Keep our precious zombies! */
     50#if !ENABLE(JSC_ZOMBIES)
    4951    clearMarks();
    5052    shrink();
    5153    ASSERT(!size());
     54#endif
    5255}
    5356
  • trunk/Source/JavaScriptCore/runtime/JSCell.h

    r86499 r86974  
    356356        return MarkedSpace::heap(c);
    357357    }
    358    
     358
    359359#if ENABLE(JSC_ZOMBIES)
    360360    inline bool JSValue::isZombie() const
    361361    {
    362         return isCell() && asCell() > (JSCell*)0x1ffffffffL && asCell()->isZombie();
     362        return isCell() && asCell()->isZombie();
    363363    }
    364364#endif
  • trunk/Source/JavaScriptCore/runtime/JSZombie.h

    r84556 r86974  
    4242    }
    4343
     44    ~JSZombie()
     45    {
     46        /* Zombie cells should never been reused. */
     47        ASSERT_NOT_REACHED();
     48    }
     49
    4450    virtual bool isZombie() const { return true; }
    4551
  • trunk/Source/JavaScriptCore/runtime/WriteBarrier.h

    r86499 r86974  
    130130        this->m_cell = reinterpret_cast<JSCell*>(value);
    131131#if ENABLE(JSC_ZOMBIES)
    132         ASSERT(!m_cell || !isZombie(m_cell));
     132        ASSERT(!m_cell || value == reinterpret_cast<T*>(1) || !isZombie(m_cell));
    133133#endif
    134134    }
Note: See TracChangeset for help on using the changeset viewer.