Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(456)

Side by Side Diff: regexp2000/src/list.h

Issue 9110: Experimental: Fixed bug in RegExp Parser. Added feature counting in parser. (Closed)
Patch Set: Merged changes to tip of experimental branch. Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « regexp2000/src/jsregexp.cc ('k') | regexp2000/src/list-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 // pointer type. Returns the removed element. 88 // pointer type. Returns the removed element.
89 INLINE(T RemoveLast()) { return Remove(length_ - 1); } 89 INLINE(T RemoveLast()) { return Remove(length_ - 1); }
90 90
91 // Clears the list by setting the length to zero. Even if T is a 91 // Clears the list by setting the length to zero. Even if T is a
92 // pointer type, clearing the list doesn't delete the entries. 92 // pointer type, clearing the list doesn't delete the entries.
93 INLINE(void Clear()); 93 INLINE(void Clear());
94 94
95 // Drops all but the first 'pos' elements from the list. 95 // Drops all but the first 'pos' elements from the list.
96 INLINE(void Rewind(int pos)); 96 INLINE(void Rewind(int pos));
97 97
98 bool Contains(T& elm); 98 bool Contains(const T& elm);
99 99
100 // Iterate through all list entries, starting at index 0. 100 // Iterate through all list entries, starting at index 0.
101 void Iterate(void (*callback)(T* x)); 101 void Iterate(void (*callback)(T* x));
102 102
103 // Sort all list entries (using QuickSort) 103 // Sort all list entries (using QuickSort)
104 void Sort(int (*cmp)(const T* x, const T* y)); 104 void Sort(int (*cmp)(const T* x, const T* y));
105 105
106 INLINE(void Initialize(int capacity)); 106 INLINE(void Initialize(int capacity));
107 107
108 private: 108 private:
109 T* data_; 109 T* data_;
110 int capacity_; 110 int capacity_;
111 int length_; 111 int length_;
112 112
113 INLINE(T* NewData(int n)) { return static_cast<T*>(P::New(n * sizeof(T))); } 113 INLINE(T* NewData(int n)) { return static_cast<T*>(P::New(n * sizeof(T))); }
114 INLINE(void DeleteData(T* data)) { P::Delete(data); } 114 INLINE(void DeleteData(T* data)) { P::Delete(data); }
115 115
116 DISALLOW_COPY_AND_ASSIGN(List); 116 DISALLOW_COPY_AND_ASSIGN(List);
117 }; 117 };
118 118
119 119
120 } } // namespace v8::internal 120 } } // namespace v8::internal
121 121
122 #endif // V8_LIST_H_ 122 #endif // V8_LIST_H_
OLDNEW
« no previous file with comments | « regexp2000/src/jsregexp.cc ('k') | regexp2000/src/list-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698