Ignore:
Timestamp:
Dec 2, 2009, 10:25:58 PM (15 years ago)
Author:
[email protected]
Message:

Add zombies to JSC
https://bugs.webkit.org/show_bug.cgi?id=32103

Reviewed by Gavin Barraclough.

Add a compile time flag to make the JSC collector replace "unreachable"
objects with zombie objects. The zombie object is a JSCell subclass that
ASSERTs on any attempt to use the JSCell methods. In addition there are
a number of additional assertions in bottleneck code to catch zombie usage
as quickly as possible.

Grrr. Argh. Brains.

File:
1 edited

Legend:

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

    r51334 r51624  
    169169        uint32_t toUInt32(ExecState*, bool& ok) const;
    170170
     171#if ENABLE(JSC_ZOMBIES)
     172        bool isZombie() const;
     173#endif
     174
    171175        // Floating point conversions (this is a convenience method for webcore;
    172176        // signle precision float is not a representation used in JS or JSC).
     
    439443        JSValue v;
    440444        v.u.asEncodedJSValue = encodedJSValue;
     445#if ENABLE(JSC_ZOMBIES)
     446        ASSERT(!v.isZombie());
     447#endif
    441448        return v;
    442449    }
     
    485492            u.asBits.tag = EmptyValueTag;
    486493        u.asBits.payload = reinterpret_cast<int32_t>(ptr);
     494#if ENABLE(JSC_ZOMBIES)
     495        ASSERT(!isZombie());
     496#endif
    487497    }
    488498
     
    494504            u.asBits.tag = EmptyValueTag;
    495505        u.asBits.payload = reinterpret_cast<int32_t>(const_cast<JSCell*>(ptr));
     506#if ENABLE(JSC_ZOMBIES)
     507        ASSERT(!isZombie());
     508#endif
    496509    }
    497510
     
    794807        : m_ptr(ptr)
    795808    {
     809#if ENABLE(JSC_ZOMBIES)
     810        ASSERT(!isZombie());
     811#endif
    796812    }
    797813
     
    799815        : m_ptr(const_cast<JSCell*>(ptr))
    800816    {
     817#if ENABLE(JSC_ZOMBIES)
     818        ASSERT(!isZombie());
     819#endif
    801820    }
    802821
Note: See TracChangeset for help on using the changeset viewer.