Changeset 55002 in webkit for trunk/JavaScriptCore/runtime/PropertySlot.h
- Timestamp:
- Feb 18, 2010, 10:23:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/PropertySlot.h
r46598 r55002 72 72 } 73 73 74 bool isCacheable() const { return m_offset != WTF::notFound; } 74 bool isGetter() const { return m_isGetter; } 75 bool isCacheable() const { return m_isCacheable; } 76 bool isCacheableValue() const { return m_isCacheable && !m_isGetter; } 75 77 size_t cachedOffset() const 76 78 { … … 103 105 m_data.valueSlot = valueSlot; 104 106 m_offset = offset; 107 m_isCacheable = true; 108 m_isGetter = false; 105 109 } 106 110 … … 140 144 m_data.index = index; 141 145 } 142 146 143 147 void setGetterSlot(JSObject* getterFunc) 148 { 149 ASSERT(getterFunc); 150 m_thisValue = m_slotBase; 151 m_getValue = functionGetter; 152 m_data.getterFunc = getterFunc; 153 m_isGetter = true; 154 } 155 156 void setCacheableGetterSlot(JSValue slotBase, JSObject* getterFunc, unsigned offset) 144 157 { 145 158 ASSERT(getterFunc); 146 159 m_getValue = functionGetter; 160 m_thisValue = m_slotBase; 161 m_slotBase = slotBase; 147 162 m_data.getterFunc = getterFunc; 148 } 149 163 m_offset = offset; 164 m_isCacheable = true; 165 m_isGetter = true; 166 } 167 150 168 void setUndefined() 151 169 { … … 183 201 // Clear offset even in release builds, in case this PropertySlot has been used before. 184 202 // (For other data members, we don't need to clear anything because reuse would meaningfully overwrite them.) 185 m_offset = WTF::notFound; 203 m_offset = 0; 204 m_isCacheable = false; 205 m_isGetter = false; 186 206 } 187 207 188 208 unsigned index() const { return m_data.index; } 189 209 210 JSValue thisValue() const { return m_thisValue; } 190 211 private: 191 212 static JSValue functionGetter(ExecState*, const Identifier&, const PropertySlot&); … … 202 223 203 224 JSValue m_value; 225 JSValue m_thisValue; 204 226 205 227 size_t m_offset; 228 bool m_isCacheable : 1; 229 bool m_isGetter : 1; 206 230 }; 207 231
Note:
See TracChangeset
for help on using the changeset viewer.