Changeset 171953 in webkit


Ignore:
Timestamp:
Aug 1, 2014 3:49:51 PM (10 years ago)
Author:
mark.lam@apple.com
Message:

Add some structure related assertions.
<https://webkit.org/b/135523>

Reviewed by Geoffrey Garen.

Adding 2 assertions:

  1. assert that we don't index pass the end of the StructureIDTable. This should never happen, but this assertion will help catch bugs where a bad structureID gets passed in.
  2. assert that cells in MarkedBlock::callDestructor() that are not zapped should have a non-null StructureID. This will help us catch bugs where the other cell header flag bits get set after the cell is zapped, thereby making the cell look like an unzapped cell but has a null structureID.
  • heap/MarkedBlock.cpp:

(JSC::MarkedBlock::callDestructor):

  • runtime/StructureIDTable.h:

(JSC::StructureIDTable::get):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r171949 r171953  
     12014-08-01  Mark Lam  <mark.lam@apple.com>
     2
     3        Add some structure related assertions.
     4        <https://webkit.org/b/135523>
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Adding 2 assertions:
     9        1. assert that we don't index pass the end of the StructureIDTable.
     10           This should never happen, but this assertion will help catch bugs
     11           where a bad structureID gets passed in.
     12        2. assert that cells in MarkedBlock::callDestructor() that are not
     13           zapped should have a non-null StructureID.  This will help us catch
     14           bugs where the other cell header flag bits get set after the cell is
     15           zapped, thereby making the cell look like an unzapped cell but has a
     16           null structureID.
     17
     18        * heap/MarkedBlock.cpp:
     19        (JSC::MarkedBlock::callDestructor):
     20        * runtime/StructureIDTable.h:
     21        (JSC::StructureIDTable::get):
     22
    1232014-08-01  Csaba Osztrogonác  <ossy@webkit.org>
    224
  • trunk/Source/JavaScriptCore/heap/MarkedBlock.cpp

    r171362 r171953  
    6262        return;
    6363
     64    ASSERT(cell->structureID());
    6465    if (dtorType == MarkedBlock::Normal)
    6566        jsCast<JSDestructibleObject*>(cell)->classInfo()->methodTable.destroy(cell);
  • trunk/Source/JavaScriptCore/runtime/StructureIDTable.h

    r165265 r171953  
    8484{
    8585#if USE(JSVALUE64)
     86    ASSERT(structureID && structureID < m_capacity);
    8687    return table()[structureID].structure;
    8788#else
Note: See TracChangeset for help on using the changeset viewer.