Changeset 170215 in webkit


Ignore:
Timestamp:
Jun 20, 2014, 3:27:36 PM (11 years ago)
Author:
mhahnenberg@apple.com
Message:

Merge r169903 to the branch.

2014-06-12 Mark Hahnenberg <mhahnenberg@apple.com>


Move structureHasRareData out of TypeInfo
https://bugs.webkit.org/show_bug.cgi?id=133800


Reviewed by Andreas Kling.


StructureHasRareData was originally put in TypeInfo to avoid making Structure bigger,
but we have a few spare bits in Structure so it would be nice to remove this hack.


  • runtime/JSTypeInfo.h: (JSC::TypeInfo::newImpurePropertyFiresWatchpoints): (JSC::TypeInfo::structureHasRareData): Deleted.
  • runtime/Structure.cpp: (JSC::Structure::Structure): (JSC::Structure::allocateRareData): (JSC::Structure::cloneRareDataFrom):
  • runtime/Structure.h: (JSC::Structure::previousID): (JSC::Structure::objectToStringValue): (JSC::Structure::setObjectToStringValue): (JSC::Structure::setPreviousID): (JSC::Structure::clearPreviousID): (JSC::Structure::previous): (JSC::Structure::rareData):
  • runtime/StructureInlines.h: (JSC::Structure::setEnumerationCache): (JSC::Structure::enumerationCache):
Location:
branches/ftlopt/Source/JavaScriptCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/ftlopt/Source/JavaScriptCore/ChangeLog

    r170161 r170215  
     12014-06-20  Mark Hahnenberg  <mhahnenberg@apple.com>
     2
     3        Merge r169903 to the branch.
     4
     5    2014-06-12  Mark Hahnenberg  <mhahnenberg@apple.com>
     6   
     7            Move structureHasRareData out of TypeInfo
     8            https://bugs.webkit.org/show_bug.cgi?id=133800
     9   
     10            Reviewed by Andreas Kling.
     11   
     12            StructureHasRareData was originally put in TypeInfo to avoid making Structure bigger,
     13            but we have a few spare bits in Structure so it would be nice to remove this hack.
     14   
     15            * runtime/JSTypeInfo.h:
     16            (JSC::TypeInfo::newImpurePropertyFiresWatchpoints):
     17            (JSC::TypeInfo::structureHasRareData): Deleted.
     18            * runtime/Structure.cpp:
     19            (JSC::Structure::Structure):
     20            (JSC::Structure::allocateRareData):
     21            (JSC::Structure::cloneRareDataFrom):
     22            * runtime/Structure.h:
     23            (JSC::Structure::previousID):
     24            (JSC::Structure::objectToStringValue):
     25            (JSC::Structure::setObjectToStringValue):
     26            (JSC::Structure::setPreviousID):
     27            (JSC::Structure::clearPreviousID):
     28            (JSC::Structure::previous):
     29            (JSC::Structure::rareData):
     30            * runtime/StructureInlines.h:
     31            (JSC::Structure::setEnumerationCache):
     32            (JSC::Structure::enumerationCache):
     33
    1342014-06-19  Filip Pizlo  <fpizlo@apple.com>
    235
  • branches/ftlopt/Source/JavaScriptCore/runtime/JSTypeInfo.h

    r170129 r170215  
    5050    static const unsigned HasImpureGetOwnPropertySlot = 1 << 10;
    5151    static const unsigned NewImpurePropertyFiresWatchpoints = 1 << 11;
    52     static const unsigned StructureHasRareData = 1 << 12;
    53     static const unsigned StructureIsImmortal = 1 << 13;
     52    static const unsigned StructureIsImmortal = 1 << 12;
    5453
    5554    class TypeInfo {
     
    9695        bool hasImpureGetOwnPropertySlot() const { return isSetOnFlags2(HasImpureGetOwnPropertySlot); }
    9796        bool newImpurePropertyFiresWatchpoints() const { return isSetOnFlags2(NewImpurePropertyFiresWatchpoints); }
    98         bool structureHasRareData() const { return isSetOnFlags2(StructureHasRareData); }
    9997        bool structureIsImmortal() const { return isSetOnFlags2(StructureIsImmortal); }
    10098
  • branches/ftlopt/Source/JavaScriptCore/runtime/Structure.cpp

    r170129 r170215  
    176176    , m_didTransition(false)
    177177    , m_staticFunctionReified(false)
     178    , m_hasRareData(false)
    178179{
    179180    ASSERT(inlineCapacity <= JSFinalObject::maxInlineCapacity());
    180181    ASSERT(static_cast<PropertyOffset>(inlineCapacity) < firstOutOfLineOffset);
    181     ASSERT(!typeInfo.structureHasRareData());
     182    ASSERT(!m_hasRareData);
    182183    ASSERT(hasReadOnlyOrGetterSetterPropertiesExcludingProto() || !m_classInfo->hasStaticSetterOrReadonlyProperties(vm));
    183184    ASSERT(hasGetterSetterProperties() || !m_classInfo->hasStaticSetterOrReadonlyProperties(vm));
     
    203204    , m_didTransition(false)
    204205    , m_staticFunctionReified(false)
     206    , m_hasRareData(false)
    205207{
    206208    TypeInfo typeInfo = TypeInfo(CellType, OverridesVisitChildren | StructureIsImmortal);
     
    229231    , m_didTransition(true)
    230232    , m_staticFunctionReified(previous->m_staticFunctionReified)
    231 {
    232     TypeInfo typeInfo = TypeInfo(previous->typeInfo().type(), previous->typeInfo().flags() & ~StructureHasRareData);
     233    , m_hasRareData(false)
     234{
     235    TypeInfo typeInfo = previous->typeInfo();
    233236    m_blob = StructureIDBlob(vm.heap.structureIDTable().allocateID(this), previous->indexingTypeIncludingHistory(), typeInfo);
    234237    m_outOfLineTypeFlags = typeInfo.outOfLineTypeFlags();
    235238
    236239    ASSERT(!previous->typeInfo().structureIsImmortal());
    237     if (previous->typeInfo().structureHasRareData() && previous->rareData()->needsCloning())
     240    if (previous->m_hasRareData && previous->rareData()->needsCloning())
    238241        cloneRareDataFrom(vm, previous);
    239242    else if (previous->previousID())
     
    780783void Structure::allocateRareData(VM& vm)
    781784{
    782     ASSERT(!typeInfo().structureHasRareData());
     785    ASSERT(!m_hasRareData);
    783786    StructureRareData* rareData = StructureRareData::create(vm, previous());
    784     TypeInfo oldTypeInfo = typeInfo();
    785     TypeInfo newTypeInfo = TypeInfo(oldTypeInfo.type(), oldTypeInfo.flags() | StructureHasRareData);
    786     m_outOfLineTypeFlags = newTypeInfo.outOfLineTypeFlags();
    787787    m_previousOrRareData.set(vm, this, rareData);
    788     ASSERT(typeInfo().structureHasRareData());
     788    m_hasRareData = true;
     789    ASSERT(m_hasRareData);
    789790}
    790791
    791792void Structure::cloneRareDataFrom(VM& vm, const Structure* other)
    792793{
    793     ASSERT(other->typeInfo().structureHasRareData());
     794    ASSERT(!m_hasRareData);
     795    ASSERT(other->m_hasRareData);
    794796    StructureRareData* newRareData = StructureRareData::clone(vm, other->rareData());
    795     TypeInfo oldTypeInfo = typeInfo();
    796     TypeInfo newTypeInfo = TypeInfo(oldTypeInfo.type(), oldTypeInfo.flags() | StructureHasRareData);
    797     m_outOfLineTypeFlags = newTypeInfo.outOfLineTypeFlags();
    798797    m_previousOrRareData.set(vm, this, newRareData);
    799     ASSERT(typeInfo().structureHasRareData());
     798    m_hasRareData = true;
     799    ASSERT(m_hasRareData);
    800800}
    801801
  • branches/ftlopt/Source/JavaScriptCore/runtime/Structure.h

    r169753 r170215  
    194194    {
    195195        ASSERT(structure()->classInfo() == info());
    196         if (typeInfo().structureHasRareData())
     196        if (m_hasRareData)
    197197            return rareData()->previousID();
    198198        return previous();
     
    299299    JSString* objectToStringValue()
    300300    {
    301         if (!typeInfo().structureHasRareData())
     301        if (!m_hasRareData)
    302302            return 0;
    303303        return rareData()->objectToStringValue();
     
    306306    void setObjectToStringValue(VM& vm, const JSCell* owner, JSString* value)
    307307    {
    308         if (!typeInfo().structureHasRareData())
     308        if (!m_hasRareData)
    309309            allocateRareData(vm);
    310310        rareData()->setObjectToStringValue(vm, owner, value);
     
    456456    void setPreviousID(VM& vm, Structure* transition, Structure* structure)
    457457    {
    458         if (typeInfo().structureHasRareData())
     458        if (m_hasRareData)
    459459            rareData()->setPreviousID(vm, transition, structure);
    460460        else
     
    464464    void clearPreviousID()
    465465    {
    466         if (typeInfo().structureHasRareData())
     466        if (m_hasRareData)
    467467            rareData()->clearPreviousID();
    468468        else
     
    483483    Structure* previous() const
    484484    {
    485         ASSERT(!typeInfo().structureHasRareData());
     485        ASSERT(!m_hasRareData);
    486486        return static_cast<Structure*>(m_previousOrRareData.get());
    487487    }
     
    489489    StructureRareData* rareData() const
    490490    {
    491         ASSERT(typeInfo().structureHasRareData());
     491        ASSERT(m_hasRareData);
    492492        return static_cast<StructureRareData*>(m_previousOrRareData.get());
    493493    }
     
    545545    unsigned m_didTransition : 1;
    546546    unsigned m_staticFunctionReified : 1;
     547    bool m_hasRareData : 1;
    547548};
    548549
  • branches/ftlopt/Source/JavaScriptCore/runtime/StructureInlines.h

    r168373 r170215  
    136136{
    137137    ASSERT(!isDictionary());
    138     if (!typeInfo().structureHasRareData())
     138    if (!m_hasRareData)
    139139        allocateRareData(vm);
    140140    rareData()->setEnumerationCache(vm, this, enumerationCache);
     
    143143inline JSPropertyNameIterator* Structure::enumerationCache()
    144144{
    145     if (!typeInfo().structureHasRareData())
     145    if (!m_hasRareData)
    146146        return 0;
    147147    return rareData()->enumerationCache();
Note: See TracChangeset for help on using the changeset viewer.