Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(888)

Unified Diff: src/global-handles.h

Issue 21042004: Make GlobalHandle::NodeBlock deletable (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: added weak callbacks to test Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/global-handles.cc » ('j') | src/global-handles.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | src/global-handles.cc » ('j') | src/global-handles.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698