fschneider@chromium.org | fb144a0 | 2011-05-04 12:43:48 +0000 | [diff] [blame] | 1 | // Copyright 2011 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_GLOBAL_HANDLES_H_ |
| 29 | #define V8_GLOBAL_HANDLES_H_ |
| 30 | |
ricow@chromium.org | 8b0c11e | 2011-04-12 05:56:07 +0000 | [diff] [blame] | 31 | #include "../include/v8-profiler.h" |
| 32 | |
fschneider@chromium.org | fb144a0 | 2011-05-04 12:43:48 +0000 | [diff] [blame] | 33 | #include "list.h" |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 34 | |
kasperl@chromium.org | 71affb5 | 2009-05-26 05:44:31 +0000 | [diff] [blame] | 35 | namespace v8 { |
| 36 | namespace internal { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 37 | |
| 38 | // Structure for tracking global handles. |
| 39 | // A single list keeps all the allocated global handles. |
| 40 | // Destroyed handles stay in the list but is added to the free list. |
| 41 | // At GC the destroyed global handles are removed from the free list |
| 42 | // and deallocated. |
| 43 | |
ager@chromium.org | 8bb6058 | 2008-12-11 12:02:20 +0000 | [diff] [blame] | 44 | // An object group is treated like a single JS object: if one of object in |
| 45 | // the group is alive, all objects in the same group are considered alive. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 46 | // An object group is used to simulate object relationship in a DOM tree. |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 47 | class ObjectGroup { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 48 | public: |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 49 | static ObjectGroup* New(Object*** handles, |
| 50 | size_t length, |
| 51 | v8::RetainedObjectInfo* info) { |
| 52 | ASSERT(length > 0); |
| 53 | ObjectGroup* group = reinterpret_cast<ObjectGroup*>( |
| 54 | malloc(OFFSET_OF(ObjectGroup, objects_[length]))); |
| 55 | group->length_ = length; |
| 56 | group->info_ = info; |
| 57 | CopyWords(group->objects_, handles, static_cast<int>(length)); |
| 58 | return group; |
| 59 | } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 60 | |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 61 | void Dispose() { |
ricow@chromium.org | 8b0c11e | 2011-04-12 05:56:07 +0000 | [diff] [blame] | 62 | if (info_ != NULL) info_->Dispose(); |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 63 | free(this); |
| 64 | } |
| 65 | |
| 66 | size_t length_; |
whesse@chromium.org | b08986c | 2011-03-14 16:13:42 +0000 | [diff] [blame] | 67 | v8::RetainedObjectInfo* info_; |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 68 | Object** objects_[1]; // Variable sized array. |
whesse@chromium.org | b08986c | 2011-03-14 16:13:42 +0000 | [diff] [blame] | 69 | |
| 70 | private: |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 71 | void* operator new(size_t size); |
| 72 | void operator delete(void* p); |
| 73 | ~ObjectGroup(); |
| 74 | DISALLOW_IMPLICIT_CONSTRUCTORS(ObjectGroup); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 75 | }; |
| 76 | |
| 77 | |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 78 | // An implicit references group consists of two parts: a parent object and |
| 79 | // a list of children objects. If the parent is alive, all the children |
| 80 | // are alive too. |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 81 | class ImplicitRefGroup { |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 82 | public: |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 83 | static ImplicitRefGroup* New(HeapObject** parent, |
| 84 | Object*** children, |
| 85 | size_t length) { |
| 86 | ASSERT(length > 0); |
| 87 | ImplicitRefGroup* group = reinterpret_cast<ImplicitRefGroup*>( |
| 88 | malloc(OFFSET_OF(ImplicitRefGroup, children_[length]))); |
| 89 | group->parent_ = parent; |
| 90 | group->length_ = length; |
| 91 | CopyWords(group->children_, children, static_cast<int>(length)); |
| 92 | return group; |
| 93 | } |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 94 | |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 95 | void Dispose() { |
| 96 | free(this); |
| 97 | } |
| 98 | |
| 99 | HeapObject** parent_; |
| 100 | size_t length_; |
| 101 | Object** children_[1]; // Variable sized array. |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 102 | |
| 103 | private: |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 104 | void* operator new(size_t size); |
| 105 | void operator delete(void* p); |
| 106 | ~ImplicitRefGroup(); |
| 107 | DISALLOW_IMPLICIT_CONSTRUCTORS(ImplicitRefGroup); |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 108 | }; |
| 109 | |
| 110 | |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 111 | typedef void (*WeakReferenceGuest)(Object* object, void* parameter); |
| 112 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 113 | class GlobalHandles { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 114 | public: |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 115 | ~GlobalHandles(); |
| 116 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 117 | // Creates a new global handle that is alive until Destroy is called. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 118 | Handle<Object> Create(Object* value); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 119 | |
| 120 | // Destroy a global handle. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 121 | void Destroy(Object** location); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 122 | |
| 123 | // Make the global handle weak and set the callback parameter for the |
| 124 | // handle. When the garbage collector recognizes that only weak global |
| 125 | // handles point to an object the handles are cleared and the callback |
| 126 | // function is invoked (for each handle) with the handle and corresponding |
| 127 | // parameter as arguments. Note: cleared means set to Smi::FromInt(0). The |
| 128 | // reason is that Smi::FromInt(0) does not change during garage collection. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 129 | void MakeWeak(Object** location, |
| 130 | void* parameter, |
| 131 | WeakReferenceCallback callback); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 132 | |
whesse@chromium.org | b08986c | 2011-03-14 16:13:42 +0000 | [diff] [blame] | 133 | static void SetWrapperClassId(Object** location, uint16_t class_id); |
| 134 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 135 | // Returns the current number of weak handles. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 136 | int NumberOfWeakHandles() { return number_of_weak_handles_; } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 137 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 138 | void RecordStats(HeapStats* stats); |
ager@chromium.org | 6012123 | 2009-12-03 11:25:37 +0000 | [diff] [blame] | 139 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 140 | // Returns the current number of weak handles to global objects. |
| 141 | // These handles are also included in NumberOfWeakHandles(). |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 142 | int NumberOfGlobalObjectWeakHandles() { |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 143 | return number_of_global_object_weak_handles_; |
| 144 | } |
| 145 | |
erik.corry@gmail.com | bbceb57 | 2012-03-09 10:52:05 +0000 | [diff] [blame] | 146 | // Returns the current number of handles to global objects. |
| 147 | int NumberOfGlobalHandles() { |
| 148 | return number_of_global_handles_; |
| 149 | } |
| 150 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 151 | // Clear the weakness of a global handle. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 152 | void ClearWeakness(Object** location); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 153 | |
kmillikin@chromium.org | c53e10d | 2011-05-18 09:12:58 +0000 | [diff] [blame] | 154 | // Clear the weakness of a global handle. |
| 155 | void MarkIndependent(Object** location); |
| 156 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 157 | // Tells whether global handle is near death. |
| 158 | static bool IsNearDeath(Object** location); |
| 159 | |
| 160 | // Tells whether global handle is weak. |
| 161 | static bool IsWeak(Object** location); |
| 162 | |
lrn@chromium.org | 303ada7 | 2010-10-27 09:33:13 +0000 | [diff] [blame] | 163 | // Process pending weak handles. |
whesse@chromium.org | f0ac72d | 2010-11-08 12:47:26 +0000 | [diff] [blame] | 164 | // Returns true if next major GC is likely to collect more garbage. |
kmillikin@chromium.org | c53e10d | 2011-05-18 09:12:58 +0000 | [diff] [blame] | 165 | bool PostGarbageCollectionProcessing(GarbageCollector collector); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 166 | |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 167 | // Iterates over all strong handles. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 168 | void IterateStrongRoots(ObjectVisitor* v); |
ager@chromium.org | c4c9272 | 2009-11-18 14:12:51 +0000 | [diff] [blame] | 169 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 170 | // Iterates over all handles. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 171 | void IterateAllRoots(ObjectVisitor* v); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 172 | |
whesse@chromium.org | b08986c | 2011-03-14 16:13:42 +0000 | [diff] [blame] | 173 | // Iterates over all handles that have embedder-assigned class ID. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 174 | void IterateAllRootsWithClassIds(ObjectVisitor* v); |
whesse@chromium.org | b08986c | 2011-03-14 16:13:42 +0000 | [diff] [blame] | 175 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 176 | // Iterates over all weak roots in heap. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 177 | void IterateWeakRoots(ObjectVisitor* v); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 178 | |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 179 | // Iterates over weak roots that are bound to a given callback. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 180 | void IterateWeakRoots(WeakReferenceGuest f, |
| 181 | WeakReferenceCallback callback); |
christian.plesner.hansen@gmail.com | 9d58c2b | 2009-10-16 11:48:38 +0000 | [diff] [blame] | 182 | |
ager@chromium.org | 9085a01 | 2009-05-11 19:22:57 +0000 | [diff] [blame] | 183 | // Find all weak handles satisfying the callback predicate, mark |
| 184 | // them as pending. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 185 | void IdentifyWeakHandles(WeakSlotCallback f); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 186 | |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 187 | // NOTE: Three ...NewSpace... functions below are used during |
| 188 | // scavenge collections and iterate over sets of handles that are |
| 189 | // guaranteed to contain all handles holding new space objects (but |
| 190 | // may also include old space objects). |
| 191 | |
| 192 | // Iterates over strong and dependent handles. See the node above. |
| 193 | void IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v); |
| 194 | |
| 195 | // Finds weak independent handles satisfying the callback predicate |
| 196 | // and marks them as pending. See the note above. |
| 197 | void IdentifyNewSpaceWeakIndependentHandles(WeakSlotCallbackWithHeap f); |
| 198 | |
| 199 | // Iterates over weak independent handles. See the note above. |
| 200 | void IterateNewSpaceWeakIndependentRoots(ObjectVisitor* v); |
kmillikin@chromium.org | c53e10d | 2011-05-18 09:12:58 +0000 | [diff] [blame] | 201 | |
ager@chromium.org | 8bb6058 | 2008-12-11 12:02:20 +0000 | [diff] [blame] | 202 | // Add an object group. |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 203 | // Should be only used in GC callback function before a collection. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 204 | // All groups are destroyed after a mark-compact collection. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 205 | void AddObjectGroup(Object*** handles, |
| 206 | size_t length, |
| 207 | v8::RetainedObjectInfo* info); |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 208 | |
| 209 | // Add an implicit references' group. |
| 210 | // Should be only used in GC callback function before a collection. |
| 211 | // All groups are destroyed after a mark-compact collection. |
karlklose@chromium.org | 44bc708 | 2011-04-11 12:33:05 +0000 | [diff] [blame] | 212 | void AddImplicitReferences(HeapObject** parent, |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 213 | Object*** children, |
| 214 | size_t length); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 215 | |
| 216 | // Returns the object groups. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 217 | List<ObjectGroup*>* object_groups() { return &object_groups_; } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 218 | |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 219 | // Returns the implicit references' groups. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 220 | List<ImplicitRefGroup*>* implicit_ref_groups() { |
| 221 | return &implicit_ref_groups_; |
| 222 | } |
ricow@chromium.org | badaffc | 2011-03-17 12:15:27 +0000 | [diff] [blame] | 223 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 224 | // Remove bags, this should only happen after GC. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 225 | void RemoveObjectGroups(); |
| 226 | void RemoveImplicitRefGroups(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 227 | |
| 228 | // Tear down the global handle structure. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 229 | void TearDown(); |
| 230 | |
| 231 | Isolate* isolate() { return isolate_; } |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 232 | |
| 233 | #ifdef DEBUG |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 234 | void PrintStats(); |
| 235 | void Print(); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 236 | #endif |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 237 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 238 | private: |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 239 | explicit GlobalHandles(Isolate* isolate); |
| 240 | |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 241 | // Internal node structures. |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 242 | class Node; |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 243 | class NodeBlock; |
| 244 | class NodeIterator; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 245 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 246 | Isolate* isolate_; |
| 247 | |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 248 | // Field always containing the number of weak and near-death handles. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 249 | int number_of_weak_handles_; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 250 | |
| 251 | // Field always containing the number of weak and near-death handles |
| 252 | // to global objects. These objects are also included in |
| 253 | // number_of_weak_handles_. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 254 | int number_of_global_object_weak_handles_; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 255 | |
erik.corry@gmail.com | bbceb57 | 2012-03-09 10:52:05 +0000 | [diff] [blame] | 256 | // Field always containing the number of handles to global objects. |
| 257 | int number_of_global_handles_; |
| 258 | |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 259 | // List of all allocated node blocks. |
| 260 | NodeBlock* first_block_; |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 261 | |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 262 | // List of node blocks with used nodes. |
| 263 | NodeBlock* first_used_block_; |
| 264 | |
| 265 | // Free list of nodes. |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 266 | Node* first_free_; |
ager@chromium.org | 3811b43 | 2009-10-28 14:53:37 +0000 | [diff] [blame] | 267 | |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 268 | // Contains all nodes holding new space objects. Note: when the list |
| 269 | // is accessed, some of the objects may have been promoted already. |
| 270 | List<Node*> new_space_nodes_; |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 271 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 272 | int post_gc_processing_count_; |
jkummerow@chromium.org | e297f59 | 2011-06-08 10:05:15 +0000 | [diff] [blame] | 273 | |
sgjesse@chromium.org | ea88ce9 | 2011-03-23 11:19:56 +0000 | [diff] [blame] | 274 | List<ObjectGroup*> object_groups_; |
| 275 | List<ImplicitRefGroup*> implicit_ref_groups_; |
| 276 | |
| 277 | friend class Isolate; |
| 278 | |
| 279 | DISALLOW_COPY_AND_ASSIGN(GlobalHandles); |
christian.plesner.hansen | 43d26ec | 2008-07-03 15:10:15 +0000 | [diff] [blame] | 280 | }; |
| 281 | |
| 282 | |
| 283 | } } // namespace v8::internal |
| 284 | |
| 285 | #endif // V8_GLOBAL_HANDLES_H_ |