| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 // Tear down the global handle structure. | 218 // Tear down the global handle structure. |
| 219 void TearDown(); | 219 void TearDown(); |
| 220 | 220 |
| 221 Isolate* isolate() { return isolate_; } | 221 Isolate* isolate() { return isolate_; } |
| 222 | 222 |
| 223 #ifdef DEBUG | 223 #ifdef DEBUG |
| 224 void PrintStats(); | 224 void PrintStats(); |
| 225 void Print(); | 225 void Print(); |
| 226 #endif | 226 #endif |
| 227 class Pool; | 227 |
| 228 private: | 228 private: |
| 229 explicit GlobalHandles(Isolate* isolate); | 229 explicit GlobalHandles(Isolate* isolate); |
| 230 | 230 |
| 231 // Internal node structure, one for each global handle. | 231 // Internal node structures. |
| 232 class Node; | 232 class Node; |
| 233 class NodeBlock; |
| 234 class NodeIterator; |
| 233 | 235 |
| 234 Isolate* isolate_; | 236 Isolate* isolate_; |
| 235 | 237 |
| 236 // Field always containing the number of weak and near-death handles. | 238 // Field always containing the number of weak and near-death handles. |
| 237 int number_of_weak_handles_; | 239 int number_of_weak_handles_; |
| 238 | 240 |
| 239 // Field always containing the number of weak and near-death handles | 241 // Field always containing the number of weak and near-death handles |
| 240 // to global objects. These objects are also included in | 242 // to global objects. These objects are also included in |
| 241 // number_of_weak_handles_. | 243 // number_of_weak_handles_. |
| 242 int number_of_global_object_weak_handles_; | 244 int number_of_global_object_weak_handles_; |
| 243 | 245 |
| 244 // Global handles are kept in a single linked list pointed to by head_. | 246 NodeBlock* first_block_; |
| 245 Node* head_; | 247 NodeBlock* first_used_block_; |
| 246 Node* head() { return head_; } | 248 Node* first_free_; |
| 247 void set_head(Node* value) { head_ = value; } | |
| 248 | 249 |
| 249 // Free list for DESTROYED global handles not yet deallocated. | 250 int post_gc_processing_count_; |
| 250 Node* first_free_; | |
| 251 Node* first_free() { return first_free_; } | |
| 252 void set_first_free(Node* value) { first_free_ = value; } | |
| 253 | 251 |
| 254 // List of deallocated nodes. | |
| 255 // Deallocated nodes form a prefix of all the nodes and | |
| 256 // |first_deallocated| points to last deallocated node before | |
| 257 // |head|. Those deallocated nodes are additionally linked | |
| 258 // by |next_free|: | |
| 259 // 1st deallocated head | |
| 260 // | | | |
| 261 // V V | |
| 262 // node node ... node node | |
| 263 // .next -> .next -> .next -> | |
| 264 // <- .next_free <- .next_free <- .next_free | |
| 265 Node* first_deallocated_; | |
| 266 Node* first_deallocated() { return first_deallocated_; } | |
| 267 void set_first_deallocated(Node* value) { | |
| 268 first_deallocated_ = value; | |
| 269 } | |
| 270 | |
| 271 Pool* pool_; | |
| 272 int post_gc_processing_count_; | |
| 273 List<ObjectGroup*> object_groups_; | 252 List<ObjectGroup*> object_groups_; |
| 274 List<ImplicitRefGroup*> implicit_ref_groups_; | 253 List<ImplicitRefGroup*> implicit_ref_groups_; |
| 254 List<Node*> new_space_independent_; |
| 275 | 255 |
| 276 friend class Isolate; | 256 friend class Isolate; |
| 277 | 257 |
| 278 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); | 258 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); |
| 279 }; | 259 }; |
| 280 | 260 |
| 281 | 261 |
| 282 } } // namespace v8::internal | 262 } } // namespace v8::internal |
| 283 | 263 |
| 284 #endif // V8_GLOBAL_HANDLES_H_ | 264 #endif // V8_GLOBAL_HANDLES_H_ |
| OLD | NEW |