| 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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 Isolate* isolate_; | 126 Isolate* isolate_; |
| 127 }; | 127 }; |
| 128 | 128 |
| 129 | 129 |
| 130 // ZoneObject is an abstraction that helps define classes of objects | 130 // ZoneObject is an abstraction that helps define classes of objects |
| 131 // allocated in the Zone. Use it as a base class; see ast.h. | 131 // allocated in the Zone. Use it as a base class; see ast.h. |
| 132 class ZoneObject { | 132 class ZoneObject { |
| 133 public: | 133 public: |
| 134 // Allocate a new ZoneObject of 'size' bytes in the Zone. | 134 // Allocate a new ZoneObject of 'size' bytes in the Zone. |
| 135 inline void* operator new(size_t size); | 135 inline void* operator new(size_t size); |
| 136 inline void* operator new(size_t size, Zone* zone); |
| 136 | 137 |
| 137 // Ideally, the delete operator should be private instead of | 138 // Ideally, the delete operator should be private instead of |
| 138 // public, but unfortunately the compiler sometimes synthesizes | 139 // public, but unfortunately the compiler sometimes synthesizes |
| 139 // (unused) destructors for classes derived from ZoneObject, which | 140 // (unused) destructors for classes derived from ZoneObject, which |
| 140 // require the operator to be visible. MSVC requires the delete | 141 // require the operator to be visible. MSVC requires the delete |
| 141 // operator to be public. | 142 // operator to be public. |
| 142 | 143 |
| 143 // ZoneObjects should never be deleted individually; use | 144 // ZoneObjects should never be deleted individually; use |
| 144 // Zone::DeleteAll() to delete all zone objects in one go. | 145 // Zone::DeleteAll() to delete all zone objects in one go. |
| 145 void operator delete(void*, size_t) { UNREACHABLE(); } | 146 void operator delete(void*, size_t) { UNREACHABLE(); } |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 public: | 227 public: |
| 227 ZoneSplayTree() | 228 ZoneSplayTree() |
| 228 : SplayTree<Config, ZoneListAllocationPolicy>() {} | 229 : SplayTree<Config, ZoneListAllocationPolicy>() {} |
| 229 ~ZoneSplayTree(); | 230 ~ZoneSplayTree(); |
| 230 }; | 231 }; |
| 231 | 232 |
| 232 | 233 |
| 233 } } // namespace v8::internal | 234 } } // namespace v8::internal |
| 234 | 235 |
| 235 #endif // V8_ZONE_H_ | 236 #endif // V8_ZONE_H_ |
| OLD | NEW |