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

Side by Side Diff: src/list-inl.h

Issue 103743004: Implement zone-allocated types (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments; silenced x64 warnings Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.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-2009 the V8 project authors. All rights reserved. 1 // Copyright 2006-2009 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 // We don't call Initialize(0) since that requires passing a Zone, 159 // We don't call Initialize(0) since that requires passing a Zone,
160 // which we don't really need. 160 // which we don't really need.
161 data_ = NULL; 161 data_ = NULL;
162 capacity_ = 0; 162 capacity_ = 0;
163 length_ = 0; 163 length_ = 0;
164 } 164 }
165 165
166 166
167 template<typename T, class P> 167 template<typename T, class P>
168 void List<T, P>::Rewind(int pos) { 168 void List<T, P>::Rewind(int pos) {
169 ASSERT(pos <= length_);
169 length_ = pos; 170 length_ = pos;
170 } 171 }
171 172
172 173
173 template<typename T, class P> 174 template<typename T, class P>
174 void List<T, P>::Trim(P alloc) { 175 void List<T, P>::Trim(P alloc) {
175 if (length_ < capacity_ / 4) { 176 if (length_ < capacity_ / 4) {
176 Resize(capacity_ / 2, alloc); 177 Resize(capacity_ / 2, alloc);
177 } 178 }
178 } 179 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 274
274 template <typename T> 275 template <typename T>
275 int SortedListBSearch(const List<T>& list, T elem) { 276 int SortedListBSearch(const List<T>& list, T elem) {
276 return SortedListBSearch<T, ElementCmp<T> > (list, ElementCmp<T>(elem)); 277 return SortedListBSearch<T, ElementCmp<T> > (list, ElementCmp<T>(elem));
277 } 278 }
278 279
279 280
280 } } // namespace v8::internal 281 } } // namespace v8::internal
281 282
282 #endif // V8_LIST_INL_H_ 283 #endif // V8_LIST_INL_H_
OLDNEW
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698