Changeset 2744 in webkit for trunk/JavaScriptCore
- Timestamp:
- Nov 18, 2002, 6:15:17 PM (23 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r2741 r2744 1 2002-11-18 Maciej Stachowiak <[email protected]> 2 3 Another step towards the List conversion: stop inheriting from Value. 4 5 * kjs/types.cpp: 6 (ListIterator::ListIterator): 7 (List::List): 8 (List::operator=): 9 (List::~List): 10 (List::mark): 11 (List::append): 12 (List::prepend): 13 (List::appendList): 14 (List::prependList): 15 (List::removeFirst): 16 (List::removeLast): 17 (List::remove): 18 (List::clear): 19 (List::copy): 20 (List::begin): 21 (List::end): 22 (List::isEmpty): 23 (List::size): 24 (List::at): 25 (List::operator[]): 26 * kjs/types.h: 27 1 28 2002-11-18 Maciej Stachowiak <[email protected]> 2 29 -
trunk/JavaScriptCore/ChangeLog-2002-12-03
r2741 r2744 1 2002-11-18 Maciej Stachowiak <[email protected]> 2 3 Another step towards the List conversion: stop inheriting from Value. 4 5 * kjs/types.cpp: 6 (ListIterator::ListIterator): 7 (List::List): 8 (List::operator=): 9 (List::~List): 10 (List::mark): 11 (List::append): 12 (List::prepend): 13 (List::appendList): 14 (List::prependList): 15 (List::removeFirst): 16 (List::removeLast): 17 (List::remove): 18 (List::clear): 19 (List::copy): 20 (List::begin): 21 (List::end): 22 (List::isEmpty): 23 (List::size): 24 (List::at): 25 (List::operator[]): 26 * kjs/types.h: 27 1 28 2002-11-18 Maciej Stachowiak <[email protected]> 2 29 -
trunk/JavaScriptCore/ChangeLog-2003-10-25
r2741 r2744 1 2002-11-18 Maciej Stachowiak <[email protected]> 2 3 Another step towards the List conversion: stop inheriting from Value. 4 5 * kjs/types.cpp: 6 (ListIterator::ListIterator): 7 (List::List): 8 (List::operator=): 9 (List::~List): 10 (List::mark): 11 (List::append): 12 (List::prepend): 13 (List::appendList): 14 (List::prependList): 15 (List::removeFirst): 16 (List::removeLast): 17 (List::remove): 18 (List::clear): 19 (List::copy): 20 (List::begin): 21 (List::end): 22 (List::isEmpty): 23 (List::size): 24 (List::at): 25 (List::operator[]): 26 * kjs/types.h: 27 1 28 2002-11-18 Maciej Stachowiak <[email protected]> 2 29 -
trunk/JavaScriptCore/kjs/types.cpp
r2741 r2744 115 115 116 116 ListIterator::ListIterator(const List &l) 117 : node( static_cast<ListImp*>(l.imp())->hook->next)117 : node(l.imp->hook->next) 118 118 { 119 119 } … … 170 170 171 171 List::List(bool needsMarking) 172 : Value(needsMarking ? ListImp::empty() : new ListImp()), 173 m_needsMarking(needsMarking) 174 { 175 if (m_needsMarking) { 176 imp()->deref(); 172 : m_needsMarking(needsMarking) 173 { 174 imp = m_needsMarking ? ListImp::empty() : new ListImp(); 175 176 if (!m_needsMarking) { 177 imp->ref(); 177 178 } 178 179 } … … 180 181 181 182 List::List(const List& l) 182 : Value(l), 183 m_needsMarking(false) 183 : m_needsMarking(false) 184 184 { 185 } 186 187 List::List(ListImp *imp) 188 : Value(imp), 189 m_needsMarking(false) 190 { 185 imp = l.imp; 186 187 if (!m_needsMarking) { 188 imp->ref(); 189 } 190 } 191 192 List::List(ListImp *p_imp) 193 : m_needsMarking(false) 194 { 195 imp = p_imp; 196 197 if (!m_needsMarking) { 198 imp->ref(); 199 } 191 200 } 192 201 … … 194 203 List& List::operator=(const List& l) 195 204 { 196 if (m_needsMarking) { 197 imp()->ref(); 198 } 199 200 Value::operator=(l); 201 202 if (m_needsMarking) { 203 imp()->deref(); 204 } 205 if (!m_needsMarking) { 206 l.imp->ref(); 207 imp->deref(); 208 } 209 210 imp = l.imp; 205 211 206 212 return *this; … … 209 215 List::~List() 210 216 { 211 if ( m_needsMarking) {212 imp ()->ref();217 if (!m_needsMarking) { 218 imp->deref(); 213 219 } 214 220 } … … 216 222 void List::mark() 217 223 { 218 if (!imp ()->marked()) {219 imp ()->mark();224 if (!imp->marked()) { 225 imp->mark(); 220 226 } 221 227 } … … 223 229 void List::append(const Value& val) 224 230 { 225 static_cast<ListImp*>(rep)->append(val);231 imp->append(val); 226 232 } 227 233 228 234 void List::prepend(const Value& val) 229 235 { 230 static_cast<ListImp*>(rep)->prepend(val);236 imp->prepend(val); 231 237 } 232 238 233 239 void List::appendList(const List& lst) 234 240 { 235 static_cast<ListImp*>(rep)->appendList(lst);241 imp->appendList(lst); 236 242 } 237 243 238 244 void List::prependList(const List& lst) 239 245 { 240 static_cast<ListImp*>(rep)->prependList(lst);246 imp->prependList(lst); 241 247 } 242 248 243 249 void List::removeFirst() 244 250 { 245 static_cast<ListImp*>(rep)->removeFirst();251 imp->removeFirst(); 246 252 } 247 253 248 254 void List::removeLast() 249 255 { 250 static_cast<ListImp*>(rep)->removeLast();256 imp->removeLast(); 251 257 } 252 258 253 259 void List::remove(const Value &val) 254 260 { 255 static_cast<ListImp*>(rep)->remove(val);261 imp->remove(val); 256 262 } 257 263 258 264 void List::clear() 259 265 { 260 static_cast<ListImp*>(rep)->clear();266 imp->clear(); 261 267 } 262 268 263 269 List List::copy() const 264 270 { 265 return static_cast<ListImp*>(rep)->copy();271 return imp->copy(); 266 272 } 267 273 268 274 ListIterator List::begin() const 269 275 { 270 return static_cast<ListImp*>(rep)->begin();276 return imp->begin(); 271 277 } 272 278 273 279 ListIterator List::end() const 274 280 { 275 return static_cast<ListImp*>(rep)->end();281 return imp->end(); 276 282 } 277 283 278 284 bool List::isEmpty() const 279 285 { 280 return static_cast<ListImp*>(rep)->isEmpty();286 return imp->isEmpty(); 281 287 } 282 288 283 289 int List::size() const 284 290 { 285 return static_cast<ListImp*>(rep)->size();291 return imp->size(); 286 292 } 287 293 288 294 Value List::at(int i) const 289 295 { 290 return static_cast<ListImp*>(rep)->at(i);296 return imp->at(i); 291 297 } 292 298 293 299 Value List::operator[](int i) const 294 300 { 295 return static_cast<ListImp*>(rep)->at(i);301 return imp->at(i); 296 302 } 297 303 -
trunk/JavaScriptCore/kjs/types.h
r2741 r2744 105 105 * copy of the list the referenced objects are still shared. 106 106 */ 107 class List : private Value{107 class List { 108 108 friend class ListIterator; 109 109 public: … … 198 198 private: 199 199 List(ListImp *); 200 ListImp *imp() const { return (ListImp *)Value::imp(); } 200 201 ListImp *imp; 201 202 bool m_needsMarking; 203 friend class ListNode; 202 204 }; 203 205
Note:
See TracChangeset
for help on using the changeset viewer.