OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 // Ideally, the delete operator should be private instead of | 146 // Ideally, the delete operator should be private instead of |
147 // public, but unfortunately the compiler sometimes synthesizes | 147 // public, but unfortunately the compiler sometimes synthesizes |
148 // (unused) destructors for classes derived from ZoneObject, which | 148 // (unused) destructors for classes derived from ZoneObject, which |
149 // require the operator to be visible. MSVC requires the delete | 149 // require the operator to be visible. MSVC requires the delete |
150 // operator to be public. | 150 // operator to be public. |
151 | 151 |
152 // ZoneObjects should never be deleted individually; use | 152 // ZoneObjects should never be deleted individually; use |
153 // Zone::DeleteAll() to delete all zone objects in one go. | 153 // Zone::DeleteAll() to delete all zone objects in one go. |
154 void operator delete(void*, size_t) { UNREACHABLE(); } | 154 void operator delete(void*, size_t) { UNREACHABLE(); } |
| 155 void operator delete(void* pointer, Zone* zone) { UNREACHABLE(); } |
155 }; | 156 }; |
156 | 157 |
157 | 158 |
158 class AssertNoZoneAllocation { | 159 class AssertNoZoneAllocation { |
159 public: | 160 public: |
160 inline AssertNoZoneAllocation(); | 161 inline AssertNoZoneAllocation(); |
161 inline ~AssertNoZoneAllocation(); | 162 inline ~AssertNoZoneAllocation(); |
162 private: | 163 private: |
163 bool prev_; | 164 bool prev_; |
164 }; | 165 }; |
(...skipping 25 matching lines...) Expand all Loading... |
190 // Construct a new ZoneList with the given capacity; the length is | 191 // Construct a new ZoneList with the given capacity; the length is |
191 // always zero. The capacity must be non-negative. | 192 // always zero. The capacity must be non-negative. |
192 explicit ZoneList(int capacity) | 193 explicit ZoneList(int capacity) |
193 : List<T, ZoneListAllocationPolicy>(capacity) { } | 194 : List<T, ZoneListAllocationPolicy>(capacity) { } |
194 | 195 |
195 // Construct a new ZoneList by copying the elements of the given ZoneList. | 196 // Construct a new ZoneList by copying the elements of the given ZoneList. |
196 explicit ZoneList(const ZoneList<T>& other) | 197 explicit ZoneList(const ZoneList<T>& other) |
197 : List<T, ZoneListAllocationPolicy>(other.length()) { | 198 : List<T, ZoneListAllocationPolicy>(other.length()) { |
198 AddAll(other); | 199 AddAll(other); |
199 } | 200 } |
| 201 |
| 202 void operator delete(void* pointer) { UNREACHABLE(); } |
| 203 void operator delete(void* pointer, Zone* zone) { UNREACHABLE(); } |
200 }; | 204 }; |
201 | 205 |
202 | 206 |
203 // ZoneScopes keep track of the current parsing and compilation | 207 // ZoneScopes keep track of the current parsing and compilation |
204 // nesting and cleans up generated ASTs in the Zone when exiting the | 208 // nesting and cleans up generated ASTs in the Zone when exiting the |
205 // outer-most scope. | 209 // outer-most scope. |
206 class ZoneScope BASE_EMBEDDED { | 210 class ZoneScope BASE_EMBEDDED { |
207 public: | 211 public: |
208 INLINE(ZoneScope(Isolate* isolate, ZoneScopeMode mode)); | 212 INLINE(ZoneScope(Isolate* isolate, ZoneScopeMode mode)); |
209 | 213 |
(...skipping 23 matching lines...) Expand all Loading... |
233 public: | 237 public: |
234 ZoneSplayTree() | 238 ZoneSplayTree() |
235 : SplayTree<Config, ZoneListAllocationPolicy>() {} | 239 : SplayTree<Config, ZoneListAllocationPolicy>() {} |
236 ~ZoneSplayTree(); | 240 ~ZoneSplayTree(); |
237 }; | 241 }; |
238 | 242 |
239 | 243 |
240 } } // namespace v8::internal | 244 } } // namespace v8::internal |
241 | 245 |
242 #endif // V8_ZONE_H_ | 246 #endif // V8_ZONE_H_ |
OLD | NEW |