Ignore:
Timestamp:
Oct 29, 2008, 4:52:52 PM (17 years ago)
Author:
[email protected]
Message:

2008-10-29 Sam Weinig <[email protected]>

Reviewed by Geoffrey Garen.

Rename and move the StructureID transition table to its own file.

  • GNUmakefile.am:
  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
  • JavaScriptCore.xcodeproj/project.pbxproj:
  • runtime/StructureID.cpp: (JSC::StructureID::addPropertyTransition):
  • runtime/StructureID.h: (JSC::StructureID::):
  • runtime/StructureIDTransitionTable.h: Copied from runtime/StructureID.h. (JSC::StructureIDTransitionTableHash::hash): (JSC::StructureIDTransitionTableHash::equal):
File:
1 edited

Legend:

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

    r37981 r37985  
    3131#include "JSValue.h"
    3232#include "PropertyMap.h"
     33#include "StructureIDTransitionTable.h"
    3334#include "TypeInfo.h"
    3435#include "ustring.h"
     
    4647    class PropertyNameArrayData;
    4748    class StructureIDChain;
    48 
    49     struct TransitionTableHash {
    50         typedef std::pair<RefPtr<UString::Rep>, unsigned> TransitionTableKey;
    51         static unsigned hash(const TransitionTableKey& p)
    52         {
    53             return p.first->computedHash();
    54         }
    55 
    56         static bool equal(const TransitionTableKey& a, const TransitionTableKey& b)
    57         {
    58             return a == b;
    59         }
    60 
    61         static const bool safeToCompareToEmptyOrDeleted = true;
    62     };
    63 
    64     struct TransitionTableHashTraits {
    65         typedef WTF::HashTraits<RefPtr<UString::Rep> > FirstTraits;
    66         typedef WTF::GenericHashTraits<unsigned> SecondTraits;
    67         typedef std::pair<FirstTraits::TraitType, SecondTraits::TraitType> TraitType;
    68 
    69         static const bool emptyValueIsZero = FirstTraits::emptyValueIsZero && SecondTraits::emptyValueIsZero;
    70         static TraitType emptyValue() { return std::make_pair(FirstTraits::emptyValue(), SecondTraits::emptyValue()); }
    71 
    72         static const bool needsDestruction = FirstTraits::needsDestruction || SecondTraits::needsDestruction;
    73 
    74         static void constructDeletedValue(TraitType& slot) { FirstTraits::constructDeletedValue(slot.first); }
    75         static bool isDeletedValue(const TraitType& value) { return FirstTraits::isDeletedValue(value.first); }
    76     };
    7749
    7850    class StructureID : public RefCounted<StructureID> {
     
    141113
    142114    private:
    143         typedef std::pair<RefPtr<UString::Rep>, unsigned> TransitionTableKey;
    144         typedef HashMap<TransitionTableKey, StructureID*, TransitionTableHash, TransitionTableHashTraits> TransitionTable;
    145 
    146115        StructureID(JSValue* prototype, const TypeInfo&);
    147116       
     
    159128        union {
    160129            StructureID* singleTransition;
    161             TransitionTable* table;
     130            StructureIDTransitionTable* table;
    162131        } m_transitions;
    163132
Note: See TracChangeset for help on using the changeset viewer.