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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 int NumberOfWeakHandles() { return number_of_weak_handles_; } | 136 int NumberOfWeakHandles() { return number_of_weak_handles_; } |
137 | 137 |
138 void RecordStats(HeapStats* stats); | 138 void RecordStats(HeapStats* stats); |
139 | 139 |
140 // Returns the current number of weak handles to global objects. | 140 // Returns the current number of weak handles to global objects. |
141 // These handles are also included in NumberOfWeakHandles(). | 141 // These handles are also included in NumberOfWeakHandles(). |
142 int NumberOfGlobalObjectWeakHandles() { | 142 int NumberOfGlobalObjectWeakHandles() { |
143 return number_of_global_object_weak_handles_; | 143 return number_of_global_object_weak_handles_; |
144 } | 144 } |
145 | 145 |
| 146 // Returns the current number of handles to global objects. |
| 147 int NumberOfGlobalHandles() { |
| 148 return number_of_global_handles_; |
| 149 } |
| 150 |
146 // Clear the weakness of a global handle. | 151 // Clear the weakness of a global handle. |
147 void ClearWeakness(Object** location); | 152 void ClearWeakness(Object** location); |
148 | 153 |
149 // Clear the weakness of a global handle. | 154 // Clear the weakness of a global handle. |
150 void MarkIndependent(Object** location); | 155 void MarkIndependent(Object** location); |
151 | 156 |
152 // Tells whether global handle is near death. | 157 // Tells whether global handle is near death. |
153 static bool IsNearDeath(Object** location); | 158 static bool IsNearDeath(Object** location); |
154 | 159 |
155 // Tells whether global handle is weak. | 160 // Tells whether global handle is weak. |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 Isolate* isolate_; | 246 Isolate* isolate_; |
242 | 247 |
243 // Field always containing the number of weak and near-death handles. | 248 // Field always containing the number of weak and near-death handles. |
244 int number_of_weak_handles_; | 249 int number_of_weak_handles_; |
245 | 250 |
246 // Field always containing the number of weak and near-death handles | 251 // Field always containing the number of weak and near-death handles |
247 // to global objects. These objects are also included in | 252 // to global objects. These objects are also included in |
248 // number_of_weak_handles_. | 253 // number_of_weak_handles_. |
249 int number_of_global_object_weak_handles_; | 254 int number_of_global_object_weak_handles_; |
250 | 255 |
| 256 // Field always containing the number of handles to global objects. |
| 257 int number_of_global_handles_; |
| 258 |
251 // List of all allocated node blocks. | 259 // List of all allocated node blocks. |
252 NodeBlock* first_block_; | 260 NodeBlock* first_block_; |
253 | 261 |
254 // List of node blocks with used nodes. | 262 // List of node blocks with used nodes. |
255 NodeBlock* first_used_block_; | 263 NodeBlock* first_used_block_; |
256 | 264 |
257 // Free list of nodes. | 265 // Free list of nodes. |
258 Node* first_free_; | 266 Node* first_free_; |
259 | 267 |
260 // Contains all nodes holding new space objects. Note: when the list | 268 // Contains all nodes holding new space objects. Note: when the list |
261 // is accessed, some of the objects may have been promoted already. | 269 // is accessed, some of the objects may have been promoted already. |
262 List<Node*> new_space_nodes_; | 270 List<Node*> new_space_nodes_; |
263 | 271 |
264 int post_gc_processing_count_; | 272 int post_gc_processing_count_; |
265 | 273 |
266 List<ObjectGroup*> object_groups_; | 274 List<ObjectGroup*> object_groups_; |
267 List<ImplicitRefGroup*> implicit_ref_groups_; | 275 List<ImplicitRefGroup*> implicit_ref_groups_; |
268 | 276 |
269 friend class Isolate; | 277 friend class Isolate; |
270 | 278 |
271 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); | 279 DISALLOW_COPY_AND_ASSIGN(GlobalHandles); |
272 }; | 280 }; |
273 | 281 |
274 | 282 |
275 } } // namespace v8::internal | 283 } } // namespace v8::internal |
276 | 284 |
277 #endif // V8_GLOBAL_HANDLES_H_ | 285 #endif // V8_GLOBAL_HANDLES_H_ |
OLD | NEW |