danno@chromium.org | fa458e4 | 2012-02-01 10:48:36 +0000 | [diff] [blame] | 1 | // Copyright 2012 the V8 project authors. All rights reserved. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 2 | // Redistribution and use in source and binary forms, with or without |
| 3 | // modification, are permitted provided that the following conditions are |
| 4 | // met: |
| 5 | // |
| 6 | // * Redistributions of source code must retain the above copyright |
| 7 | // notice, this list of conditions and the following disclaimer. |
| 8 | // * Redistributions in binary form must reproduce the above |
| 9 | // copyright notice, this list of conditions and the following |
| 10 | // disclaimer in the documentation and/or other materials provided |
| 11 | // with the distribution. |
| 12 | // * Neither the name of Google Inc. nor the names of its |
| 13 | // contributors may be used to endorse or promote products derived |
| 14 | // from this software without specific prior written permission. |
| 15 | // |
| 16 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 17 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 18 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 19 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 20 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 21 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 22 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 26 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | |
| 28 | #ifndef V8_ZONE_H_ |
| 29 | #define V8_ZONE_H_ |
| 30 | |
lrn@chromium.org | 1c09276 | 2011-05-09 09:42:16 +0000 | [diff] [blame] | 31 | #include "allocation.h" |
danno@chromium.org | fa458e4 | 2012-02-01 10:48:36 +0000 | [diff] [blame] | 32 | #include "checks.h" |
yangguo@chromium.org | ab30bb8 | 2012-02-24 14:41:46 +0000 | [diff] [blame] | 33 | #include "hashmap.h" |
danno@chromium.org | fa458e4 | 2012-02-01 10:48:36 +0000 | [diff] [blame] | 34 | #include "globals.h" |
| 35 | #include "list.h" |
| 36 | #include "splay-tree.h" |
lrn@chromium.org | 1c09276 | 2011-05-09 09:42:16 +0000 | [diff] [blame] | 37 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 38 | namespace v8 { |
| 39 | namespace internal { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 40 | |
| 41 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 42 | // Zone scopes are in one of two modes. Either they delete the zone |
| 43 | // on exit or they do not. |
| 44 | enum ZoneScopeMode { |
| 45 | DELETE_ON_EXIT, |
| 46 | DONT_DELETE_ON_EXIT |
| 47 | }; |
| 48 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 49 | class Segment; |
danno@chromium.org | fa458e4 | 2012-02-01 10:48:36 +0000 | [diff] [blame] | 50 | class Isolate; |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 51 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 52 | // The Zone supports very fast allocation of small chunks of |
| 53 | // memory. The chunks cannot be deallocated individually, but instead |
| 54 | // the Zone supports deallocating all chunks in one fast |
| 55 | // operation. The Zone is used to hold temporary data structures like |
| 56 | // the abstract syntax tree, which is deallocated after compilation. |
| 57 | |
| 58 | // Note: There is no need to initialize the Zone; the first time an |
| 59 | // allocation is attempted, a segment of memory will be requested |
| 60 | // through a call to malloc(). |
| 61 | |
| 62 | // Note: The implementation is inherently not thread safe. Do not use |
| 63 | // from multi-threaded code. |
| 64 | |
| 65 | class Zone { |
| 66 | public: |
yangguo@chromium.org | 5a11aaf | 2012-06-20 11:29:00 +0000 | [diff] [blame] | 67 | explicit Zone(Isolate* isolate); |
| 68 | ~Zone() { DeleteKeptSegment(); } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 69 | // Allocate 'size' bytes of memory in the Zone; expands the Zone by |
| 70 | // allocating new segments of memory on demand using malloc(). |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 71 | inline void* New(int size); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 72 | |
ager@chromium.org | 41826e7 | 2009-03-30 13:30:57 +0000 | [diff] [blame] | 73 | template <typename T> |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 74 | inline T* NewArray(int length); |
ager@chromium.org | 41826e7 | 2009-03-30 13:30:57 +0000 | [diff] [blame] | 75 | |
danno@chromium.org | b645116 | 2011-08-17 14:33:23 +0000 | [diff] [blame] | 76 | // Deletes all objects and free all memory allocated in the Zone. Keeps one |
| 77 | // small (size <= kMaximumKeptSegmentSize) segment around if it finds one. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 78 | void DeleteAll(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 79 | |
danno@chromium.org | b645116 | 2011-08-17 14:33:23 +0000 | [diff] [blame] | 80 | // Deletes the last small segment kept around by DeleteAll(). |
| 81 | void DeleteKeptSegment(); |
| 82 | |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 83 | // Returns true if more memory has been allocated in zones than |
| 84 | // the limit allows. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 85 | inline bool excess_allocation(); |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 86 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 87 | inline void adjust_segment_bytes_allocated(int delta); |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 88 | |
svenpanne@chromium.org | 84bcc55 | 2011-07-18 09:50:57 +0000 | [diff] [blame] | 89 | inline Isolate* isolate() { return isolate_; } |
| 90 | |
sgjesse@chromium.org | c6c5718 | 2011-01-17 12:24:25 +0000 | [diff] [blame] | 91 | static unsigned allocation_size_; |
| 92 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 93 | private: |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 94 | friend class Isolate; |
| 95 | friend class ZoneScope; |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 96 | |
danno@chromium.org | 50d79f3 | 2011-11-11 12:01:18 +0000 | [diff] [blame] | 97 | // All pointers returned from New() have this alignment. In addition, if the |
| 98 | // object being allocated has a size that is divisible by 8 then its alignment |
| 99 | // will be 8. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 100 | static const int kAlignment = kPointerSize; |
| 101 | |
| 102 | // Never allocate segments smaller than this size in bytes. |
| 103 | static const int kMinimumSegmentSize = 8 * KB; |
| 104 | |
ager@chromium.org | 8bb6058 | 2008-12-11 12:02:20 +0000 | [diff] [blame] | 105 | // Never allocate segments larger than this size in bytes. |
| 106 | static const int kMaximumSegmentSize = 1 * MB; |
| 107 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 108 | // Never keep segments larger than this size in bytes around. |
| 109 | static const int kMaximumKeptSegmentSize = 64 * KB; |
| 110 | |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 111 | // Report zone excess when allocation exceeds this limit. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 112 | int zone_excess_limit_; |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 113 | |
| 114 | // The number of bytes allocated in segments. Note that this number |
| 115 | // includes memory allocated from the OS but not yet allocated from |
| 116 | // the zone. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 117 | int segment_bytes_allocated_; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 118 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 119 | // Expand the Zone to hold at least 'size' more bytes and allocate |
| 120 | // the bytes. Returns the address of the newly allocated chunk of |
| 121 | // memory in the Zone. Should only be called if there isn't enough |
| 122 | // room in the Zone already. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 123 | Address NewExpand(int size); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 124 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 125 | // Creates a new segment, sets it size, and pushes it to the front |
| 126 | // of the segment chain. Returns the new segment. |
| 127 | Segment* NewSegment(int size); |
| 128 | |
| 129 | // Deletes the given segment. Does not touch the segment chain. |
| 130 | void DeleteSegment(Segment* segment, int size); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 131 | |
| 132 | // The free region in the current (front) segment is represented as |
| 133 | // the half-open interval [position, limit). The 'position' variable |
| 134 | // is guaranteed to be aligned as dictated by kAlignment. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 135 | Address position_; |
| 136 | Address limit_; |
| 137 | |
| 138 | int scope_nesting_; |
| 139 | |
| 140 | Segment* segment_head_; |
| 141 | Isolate* isolate_; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 142 | }; |
| 143 | |
| 144 | |
| 145 | // ZoneObject is an abstraction that helps define classes of objects |
| 146 | // allocated in the Zone. Use it as a base class; see ast.h. |
| 147 | class ZoneObject { |
| 148 | public: |
| 149 | // Allocate a new ZoneObject of 'size' bytes in the Zone. |
danno@chromium.org | 40cb878 | 2011-05-25 07:58:50 +0000 | [diff] [blame] | 150 | INLINE(void* operator new(size_t size, Zone* zone)); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 151 | |
| 152 | // Ideally, the delete operator should be private instead of |
ager@chromium.org | 3291210 | 2009-01-16 10:38:43 +0000 | [diff] [blame] | 153 | // public, but unfortunately the compiler sometimes synthesizes |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 154 | // (unused) destructors for classes derived from ZoneObject, which |
| 155 | // require the operator to be visible. MSVC requires the delete |
| 156 | // operator to be public. |
| 157 | |
| 158 | // ZoneObjects should never be deleted individually; use |
| 159 | // Zone::DeleteAll() to delete all zone objects in one go. |
| 160 | void operator delete(void*, size_t) { UNREACHABLE(); } |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 161 | void operator delete(void* pointer, Zone* zone) { UNREACHABLE(); } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 162 | }; |
| 163 | |
| 164 | |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 165 | // The ZoneAllocationPolicy is used to specialize generic data |
| 166 | // structures to allocate themselves and their elements in the Zone. |
| 167 | struct ZoneAllocationPolicy { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 168 | public: |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 169 | explicit ZoneAllocationPolicy(Zone* zone) : zone_(zone) { } |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 170 | INLINE(void* New(size_t size)); |
| 171 | INLINE(static void Delete(void *pointer)) { } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 172 | |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 173 | private: |
| 174 | Zone* zone_; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 175 | }; |
| 176 | |
| 177 | |
| 178 | // ZoneLists are growable lists with constant-time access to the |
| 179 | // elements. The list itself and all its elements are allocated in the |
| 180 | // Zone. ZoneLists cannot be deleted individually; you can delete all |
| 181 | // objects in the Zone by calling Zone::DeleteAll(). |
| 182 | template<typename T> |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 183 | class ZoneList: public List<T, ZoneAllocationPolicy> { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 184 | public: |
| 185 | // Construct a new ZoneList with the given capacity; the length is |
| 186 | // always zero. The capacity must be non-negative. |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 187 | ZoneList(int capacity, Zone* zone) |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 188 | : List<T, ZoneAllocationPolicy>(capacity, ZoneAllocationPolicy(zone)) { } |
| 189 | |
| 190 | INLINE(void* operator new(size_t size, Zone* zone)); |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 191 | |
| 192 | // Construct a new ZoneList by copying the elements of the given ZoneList. |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 193 | ZoneList(const ZoneList<T>& other, Zone* zone) |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 194 | : List<T, ZoneAllocationPolicy>(other.length(), |
| 195 | ZoneAllocationPolicy(zone)) { |
| 196 | AddAll(other, ZoneAllocationPolicy(zone)); |
| 197 | } |
| 198 | |
| 199 | // We add some convenience wrappers so that we can pass in a Zone |
| 200 | // instead of a (less convenient) ZoneAllocationPolicy. |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 201 | INLINE(void Add(const T& element, Zone* zone)) { |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 202 | List<T, ZoneAllocationPolicy>::Add(element, ZoneAllocationPolicy(zone)); |
| 203 | } |
| 204 | INLINE(void AddAll(const List<T, ZoneAllocationPolicy>& other, |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 205 | Zone* zone)) { |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 206 | List<T, ZoneAllocationPolicy>::AddAll(other, ZoneAllocationPolicy(zone)); |
| 207 | } |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 208 | INLINE(void AddAll(const Vector<T>& other, Zone* zone)) { |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 209 | List<T, ZoneAllocationPolicy>::AddAll(other, ZoneAllocationPolicy(zone)); |
| 210 | } |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 211 | INLINE(void InsertAt(int index, const T& element, Zone* zone)) { |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 212 | List<T, ZoneAllocationPolicy>::InsertAt(index, element, |
| 213 | ZoneAllocationPolicy(zone)); |
| 214 | } |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 215 | INLINE(Vector<T> AddBlock(T value, int count, Zone* zone)) { |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 216 | return List<T, ZoneAllocationPolicy>::AddBlock(value, count, |
| 217 | ZoneAllocationPolicy(zone)); |
| 218 | } |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 219 | INLINE(void Allocate(int length, Zone* zone)) { |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 220 | List<T, ZoneAllocationPolicy>::Allocate(length, ZoneAllocationPolicy(zone)); |
| 221 | } |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 222 | INLINE(void Initialize(int capacity, Zone* zone)) { |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 223 | List<T, ZoneAllocationPolicy>::Initialize(capacity, |
| 224 | ZoneAllocationPolicy(zone)); |
kasperl@chromium.org | a555126 | 2010-12-07 12:49:48 +0000 | [diff] [blame] | 225 | } |
ricow@chromium.org | 4668a2c | 2011-08-29 10:41:00 +0000 | [diff] [blame] | 226 | |
| 227 | void operator delete(void* pointer) { UNREACHABLE(); } |
| 228 | void operator delete(void* pointer, Zone* zone) { UNREACHABLE(); } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 229 | }; |
| 230 | |
| 231 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 232 | // ZoneScopes keep track of the current parsing and compilation |
| 233 | // nesting and cleans up generated ASTs in the Zone when exiting the |
| 234 | // outer-most scope. |
| 235 | class ZoneScope BASE_EMBEDDED { |
| 236 | public: |
yangguo@chromium.org | 5a11aaf | 2012-06-20 11:29:00 +0000 | [diff] [blame] | 237 | INLINE(ZoneScope(Zone* zone, ZoneScopeMode mode)); |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 238 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 239 | virtual ~ZoneScope(); |
kasperl@chromium.org | b3284ad | 2009-05-18 06:12:45 +0000 | [diff] [blame] | 240 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 241 | inline bool ShouldDeleteOnExit(); |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 242 | |
| 243 | // For ZoneScopes that do not delete on exit by default, call this |
| 244 | // method to request deletion on exit. |
| 245 | void DeleteOnExit() { |
| 246 | mode_ = DELETE_ON_EXIT; |
| 247 | } |
| 248 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 249 | inline static int nesting(); |
ager@chromium.org | a74f0da | 2008-12-03 16:05:52 +0000 | [diff] [blame] | 250 | |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 251 | private: |
yangguo@chromium.org | 5a11aaf | 2012-06-20 11:29:00 +0000 | [diff] [blame] | 252 | Zone* zone_; |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 253 | ZoneScopeMode mode_; |
mads.s.ager@gmail.com | 9a4089a | 2008-09-01 08:55:01 +0000 | [diff] [blame] | 254 | }; |
| 255 | |
| 256 | |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 257 | // A zone splay tree. The config type parameter encapsulates the |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 258 | // different configurations of a concrete splay tree (see splay-tree.h). |
| 259 | // The tree itself and all its elements are allocated in the Zone. |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 260 | template <typename Config> |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 261 | class ZoneSplayTree: public SplayTree<Config, ZoneAllocationPolicy> { |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 262 | public: |
mmassi@chromium.org | 7028c05 | 2012-06-13 11:51:58 +0000 | [diff] [blame] | 263 | explicit ZoneSplayTree(Zone* zone) |
| 264 | : SplayTree<Config, ZoneAllocationPolicy>(ZoneAllocationPolicy(zone)) {} |
ager@chromium.org | ce5e87b | 2010-03-10 10:24:18 +0000 | [diff] [blame] | 265 | ~ZoneSplayTree(); |
sgjesse@chromium.org | 0b6db59 | 2009-07-30 14:48:31 +0000 | [diff] [blame] | 266 | }; |
| 267 | |
| 268 | |
rossberg@chromium.org | 400388e | 2012-06-06 09:29:22 +0000 | [diff] [blame] | 269 | typedef TemplateHashMapImpl<ZoneAllocationPolicy> ZoneHashMap; |
yangguo@chromium.org | ab30bb8 | 2012-02-24 14:41:46 +0000 | [diff] [blame] | 270 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 271 | } } // namespace v8::internal |
| 272 | |
| 273 | #endif // V8_ZONE_H_ |