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

Side by Side Diff: src/list.h

Issue 1209403005: Let the second pass phantom callbacks run in a separate task on the foreground thread. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Run second pass callbacks synchronously when GC is forced. Created 5 years, 5 months 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 | « src/heap/heap.cc ('k') | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_LIST_H_ 5 #ifndef V8_LIST_H_
6 #define V8_LIST_H_ 6 #define V8_LIST_H_
7 7
8 #include <algorithm>
9
8 #include "src/checks.h" 10 #include "src/checks.h"
9 #include "src/utils.h" 11 #include "src/utils.h"
10 12
11 namespace v8 { 13 namespace v8 {
12 namespace internal { 14 namespace internal {
13 15
14 template<typename T> class Vector; 16 template<typename T> class Vector;
15 17
16 // ---------------------------------------------------------------------------- 18 // ----------------------------------------------------------------------------
17 // The list is a template for very light-weight lists. We are not 19 // The list is a template for very light-weight lists. We are not
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // Clears the list by setting the length to zero. Even if T is a 132 // Clears the list by setting the length to zero. Even if T is a
131 // pointer type, clearing the list doesn't delete the entries. 133 // pointer type, clearing the list doesn't delete the entries.
132 INLINE(void Clear()); 134 INLINE(void Clear());
133 135
134 // Drops all but the first 'pos' elements from the list. 136 // Drops all but the first 'pos' elements from the list.
135 INLINE(void Rewind(int pos)); 137 INLINE(void Rewind(int pos));
136 138
137 // Drop the last 'count' elements from the list. 139 // Drop the last 'count' elements from the list.
138 INLINE(void RewindBy(int count)) { Rewind(length_ - count); } 140 INLINE(void RewindBy(int count)) { Rewind(length_ - count); }
139 141
142 // Swaps the contents of the two lists.
143 INLINE(void Swap(List<T, AllocationPolicy>* list));
144
140 // Halve the capacity if fill level is less than a quarter. 145 // Halve the capacity if fill level is less than a quarter.
141 INLINE(void Trim(AllocationPolicy allocator = AllocationPolicy())); 146 INLINE(void Trim(AllocationPolicy allocator = AllocationPolicy()));
142 147
143 bool Contains(const T& elm) const; 148 bool Contains(const T& elm) const;
144 int CountOccurrences(const T& elm, int start, int end) const; 149 int CountOccurrences(const T& elm, int start, int end) const;
145 150
146 // Iterate through all list entries, starting at index 0. 151 // Iterate through all list entries, starting at index 0.
147 void Iterate(void (*callback)(T* x)); 152 void Iterate(void (*callback)(T* x));
148 template<class Visitor> 153 template<class Visitor>
149 void Iterate(Visitor* visitor); 154 void Iterate(Visitor* visitor);
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 template <typename T, class P> 221 template <typename T, class P>
217 int SortedListBSearch(const List<T>& list, P cmp); 222 int SortedListBSearch(const List<T>& list, P cmp);
218 template <typename T> 223 template <typename T>
219 int SortedListBSearch(const List<T>& list, T elem); 224 int SortedListBSearch(const List<T>& list, T elem);
220 225
221 226
222 } } // namespace v8::internal 227 } } // namespace v8::internal
223 228
224 229
225 #endif // V8_LIST_H_ 230 #endif // V8_LIST_H_
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/list-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698