Index: src/global-handles.h |
diff --git a/src/global-handles.h b/src/global-handles.h |
index cd75133a24367092ec07e87bd9fc451a8a9e9d64..deb04e7c3e94813c2db7a20c724e18b894f4665a 100644 |
--- a/src/global-handles.h |
+++ b/src/global-handles.h |
@@ -156,6 +156,8 @@ class GlobalHandles { |
return number_of_global_handles_; |
} |
+ int block_count() const { return number_of_blocks_; } |
Michael Starzinger
2013/08/01 12:29:02
nit: Let's add a short one-liner comment to the ac
|
+ |
// Clear the weakness of a global handle. |
static void ClearWeakness(Object** location); |
@@ -275,11 +277,14 @@ class GlobalHandles { |
#ifdef DEBUG |
void PrintStats(); |
void Print(); |
+ void VerifyBlockInvariants(); |
#endif |
private: |
explicit GlobalHandles(Isolate* isolate); |
+ void SortBlocks(bool shouldPrune); |
+ |
// Migrates data from the internal representation (object_group_connections_, |
// retainer_infos_ and implicit_ref_connections_) to the public and more |
// efficient representation (object_groups_ and implicit_ref_groups_). |
@@ -296,17 +301,19 @@ class GlobalHandles { |
Isolate* isolate_; |
+ // Field always containing the number of blocks allocated. |
+ int number_of_blocks_; |
// Field always containing the number of handles to global objects. |
int number_of_global_handles_; |
- // List of all allocated node blocks. |
+ // Ends of a doubly-linked list of blocks |
+ // which is sorted from fullest to emptiest during GC. |
NodeBlock* first_block_; |
+ NodeBlock* last_block_; |
- // List of node blocks with used nodes. |
- NodeBlock* first_used_block_; |
- |
- // Free list of nodes. |
- Node* first_free_; |
+ // All blocks before this one will always be full |
+ // and none after this will be full. |
+ NodeBlock* first_non_full_block_; |
// Contains all nodes holding new space objects. Note: when the list |
// is accessed, some of the objects may have been promoted already. |