OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // always zero. The capacity must be non-negative. | 194 // always zero. The capacity must be non-negative. |
195 ZoneList(int capacity, Zone* zone) | 195 ZoneList(int capacity, Zone* zone) |
196 : List<T, ZoneAllocationPolicy>(capacity, ZoneAllocationPolicy(zone)) { } | 196 : List<T, ZoneAllocationPolicy>(capacity, ZoneAllocationPolicy(zone)) { } |
197 | 197 |
198 INLINE(void* operator new(size_t size, Zone* zone)); | 198 INLINE(void* operator new(size_t size, Zone* zone)); |
199 | 199 |
200 // Construct a new ZoneList by copying the elements of the given ZoneList. | 200 // Construct a new ZoneList by copying the elements of the given ZoneList. |
201 ZoneList(const ZoneList<T>& other, Zone* zone) | 201 ZoneList(const ZoneList<T>& other, Zone* zone) |
202 : List<T, ZoneAllocationPolicy>(other.length(), | 202 : List<T, ZoneAllocationPolicy>(other.length(), |
203 ZoneAllocationPolicy(zone)) { | 203 ZoneAllocationPolicy(zone)) { |
204 AddAll(other, ZoneAllocationPolicy(zone)); | 204 AddAll(other, zone); |
205 } | 205 } |
206 | 206 |
207 // We add some convenience wrappers so that we can pass in a Zone | 207 // We add some convenience wrappers so that we can pass in a Zone |
208 // instead of a (less convenient) ZoneAllocationPolicy. | 208 // instead of a (less convenient) ZoneAllocationPolicy. |
209 INLINE(void Add(const T& element, Zone* zone)) { | 209 INLINE(void Add(const T& element, Zone* zone)) { |
210 List<T, ZoneAllocationPolicy>::Add(element, ZoneAllocationPolicy(zone)); | 210 List<T, ZoneAllocationPolicy>::Add(element, ZoneAllocationPolicy(zone)); |
211 } | 211 } |
212 INLINE(void AddAll(const List<T, ZoneAllocationPolicy>& other, | 212 INLINE(void AddAll(const List<T, ZoneAllocationPolicy>& other, Zone* zone)) { |
213 Zone* zone)) { | |
214 List<T, ZoneAllocationPolicy>::AddAll(other, ZoneAllocationPolicy(zone)); | 213 List<T, ZoneAllocationPolicy>::AddAll(other, ZoneAllocationPolicy(zone)); |
215 } | 214 } |
216 INLINE(void AddAll(const Vector<T>& other, Zone* zone)) { | 215 INLINE(void AddAll(const Vector<T>& other, Zone* zone)) { |
217 List<T, ZoneAllocationPolicy>::AddAll(other, ZoneAllocationPolicy(zone)); | 216 List<T, ZoneAllocationPolicy>::AddAll(other, ZoneAllocationPolicy(zone)); |
218 } | 217 } |
219 INLINE(void InsertAt(int index, const T& element, Zone* zone)) { | 218 INLINE(void InsertAt(int index, const T& element, Zone* zone)) { |
220 List<T, ZoneAllocationPolicy>::InsertAt(index, element, | 219 List<T, ZoneAllocationPolicy>::InsertAt(index, element, |
221 ZoneAllocationPolicy(zone)); | 220 ZoneAllocationPolicy(zone)); |
222 } | 221 } |
223 INLINE(Vector<T> AddBlock(T value, int count, Zone* zone)) { | 222 INLINE(Vector<T> AddBlock(T value, int count, Zone* zone)) { |
(...skipping 23 matching lines...) Expand all Loading... |
247 : SplayTree<Config, ZoneAllocationPolicy>(ZoneAllocationPolicy(zone)) {} | 246 : SplayTree<Config, ZoneAllocationPolicy>(ZoneAllocationPolicy(zone)) {} |
248 ~ZoneSplayTree(); | 247 ~ZoneSplayTree(); |
249 }; | 248 }; |
250 | 249 |
251 | 250 |
252 typedef TemplateHashMapImpl<ZoneAllocationPolicy> ZoneHashMap; | 251 typedef TemplateHashMapImpl<ZoneAllocationPolicy> ZoneHashMap; |
253 | 252 |
254 } } // namespace v8::internal | 253 } } // namespace v8::internal |
255 | 254 |
256 #endif // V8_ZONE_H_ | 255 #endif // V8_ZONE_H_ |
OLD | NEW |