Ignore:
Timestamp:
Jul 30, 2009, 1:57:44 PM (16 years ago)
Author:
[email protected]
Message:

Merged nitro-extreme branch into trunk.

File:
1 edited

Legend:

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

    r44757 r46598  
    2424#include "Identifier.h"
    2525#include "JSValue.h"
    26 #include "JSImmediate.h"
    2726#include "Register.h"
    2827#include <wtf/Assertions.h>
     
    4039    public:
    4140        PropertySlot()
    42             : m_offset(WTF::notFound)
    43         {
    44             clearBase();
     41        {
     42            clearBase();
     43            clearOffset();
    4544            clearValue();
    4645        }
     
    4847        explicit PropertySlot(const JSValue base)
    4948            : m_slotBase(base)
    50             , m_offset(WTF::notFound)
    51         {
     49        {
     50            clearOffset();
    5251            clearValue();
    5352        }
     
    8382        {
    8483            ASSERT(valueSlot);
    85             m_getValue = JSC_VALUE_SLOT_MARKER;
    86             clearBase();
     84            clearBase();
     85            clearOffset();
     86            m_getValue = JSC_VALUE_SLOT_MARKER;
    8787            m_data.valueSlot = valueSlot;
    8888        }
     
    108108        {
    109109            ASSERT(value);
    110             m_getValue = JSC_VALUE_SLOT_MARKER;
    111             clearBase();
     110            clearBase();
     111            clearOffset();
     112            m_getValue = JSC_VALUE_SLOT_MARKER;
    112113            m_value = value;
    113114            m_data.valueSlot = &m_value;
     
    117118        {
    118119            ASSERT(registerSlot);
     120            clearBase();
     121            clearOffset();
    119122            m_getValue = JSC_REGISTER_SLOT_MARKER;
    120             clearBase();
    121123            m_data.registerSlot = registerSlot;
    122124        }
     
    148150        void setUndefined()
    149151        {
    150             clearBase();
    151152            setValue(jsUndefined());
    152153        }
     
    154155        JSValue slotBase() const
    155156        {
    156             ASSERT(m_slotBase);
    157157            return m_slotBase;
    158158        }
     
    177177            m_value = JSValue();
    178178#endif
     179        }
     180
     181        void clearOffset()
     182        {
     183            // Clear offset even in release builds, in case this PropertySlot has been used before.
     184            // (For other data members, we don't need to clear anything because reuse would meaningfully overwrite them.)
     185            m_offset = WTF::notFound;
    179186        }
    180187
Note: See TracChangeset for help on using the changeset viewer.