Changeset 49717 in webkit for trunk/JavaScriptCore/runtime/PropertyNameArray.h
- Timestamp:
- Oct 16, 2009, 5:28:19 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/PropertyNameArray.h
r49398 r49717 25 25 #include "Identifier.h" 26 26 #include <wtf/HashSet.h> 27 #include <wtf/OwnArrayPtr.h> 27 28 #include <wtf/Vector.h> 28 29 … … 32 33 class StructureChain; 33 34 35 // FIXME: Rename to PropertyNameArray. 34 36 class PropertyNameArrayData : public RefCounted<PropertyNameArrayData> { 35 37 public: 36 38 typedef Vector<Identifier, 20> PropertyNameVector; 37 typedef PropertyNameVector::const_iterator const_iterator;38 39 39 40 static PassRefPtr<PropertyNameArrayData> create() { return adoptRef(new PropertyNameArrayData); } 40 41 41 const_iterator begin() const { return m_propertyNameVector.begin(); }42 const_iterator end() const { return m_propertyNameVector.end(); }43 44 42 PropertyNameVector& propertyNameVector() { return m_propertyNameVector; } 45 46 void setCachedStructure(Structure* structure) { m_cachedStructure = structure; }47 Structure* cachedStructure() const { return m_cachedStructure; }48 49 void setCachedPrototypeChain(NonNullPassRefPtr<StructureChain> cachedPrototypeChain) { m_cachedPrototypeChain = cachedPrototypeChain; }50 StructureChain* cachedPrototypeChain() { return m_cachedPrototypeChain.get(); }51 43 52 44 private: 53 45 PropertyNameArrayData() 54 : m_cachedStructure(0)55 46 { 56 47 } 57 48 58 49 PropertyNameVector m_propertyNameVector; 59 Structure* m_cachedStructure;60 RefPtr<StructureChain> m_cachedPrototypeChain;61 50 }; 62 51 52 // FIXME: Rename to PropertyNameArrayBuilder. 63 53 class PropertyNameArray { 64 54 public: 65 typedef PropertyNameArrayData::const_iterator const_iterator;66 67 55 PropertyNameArray(JSGlobalData* globalData) 68 56 : m_data(PropertyNameArrayData::create()) … … 85 73 void addKnownUnique(UString::Rep* identifier) { m_data->propertyNameVector().append(Identifier(m_globalData, identifier)); } 86 74 87 size_t size() const { return m_data->propertyNameVector().size(); }88 89 75 Identifier& operator[](unsigned i) { return m_data->propertyNameVector()[i]; } 90 76 const Identifier& operator[](unsigned i) const { return m_data->propertyNameVector()[i]; } 91 77 92 const_iterator begin() const { return m_data->begin(); }93 const_iterator end() const { return m_data->end(); }94 95 78 void setData(PassRefPtr<PropertyNameArrayData> data) { m_data = data; } 96 79 PropertyNameArrayData* data() { return m_data.get(); } 97 98 80 PassRefPtr<PropertyNameArrayData> releaseData() { return m_data.release(); } 99 81 100 void setShouldCache(bool shouldCache) { m_shouldCache = shouldCache; } 101 bool shouldCache() const { return m_shouldCache; } 82 // FIXME: Remove these functions. 83 typedef PropertyNameArrayData::PropertyNameVector::const_iterator const_iterator; 84 size_t size() const { return m_data->propertyNameVector().size(); } 85 const_iterator begin() const { return m_data->propertyNameVector().begin(); } 86 const_iterator end() const { return m_data->propertyNameVector().end(); } 102 87 103 88 private:
Note:
See TracChangeset
for help on using the changeset viewer.