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

Unified Diff: src/global-handles.h

Issue 22970004: Revert "Make GlobalHandle::NodeBlock deletable" (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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') | no next file with comments »
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 2c20711ea179594abffd515f4abc6a19e3b5dcb8..5a4ad13e2f59c3b8342a6b03328f2336f4bcb06f 100644
--- a/src/global-handles.h
+++ b/src/global-handles.h
@@ -157,9 +157,6 @@ class GlobalHandles {
return number_of_global_handles_;
}
- // Returns the current number of allocated blocks
- int block_count() const { return number_of_blocks_; }
-
// Clear the weakness of a global handle.
static void ClearWeakness(Object** location);
@@ -279,14 +276,11 @@ 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_).
@@ -300,64 +294,20 @@ class GlobalHandles {
class Node;
class NodeBlock;
class NodeIterator;
- class BlockListIterator;
- // Base class for NodeBlock
- class BlockList {
- public:
- BlockList();
- ~BlockList() { ASSERT(IsDetached()); }
- void Detach();
- void InsertAsHead(BlockList* block) {
- ASSERT(IsAnchor());
- InsertAsNext(block);
- }
- void InsertAsTail(BlockList* block) {
- ASSERT(IsAnchor());
- prev_block_->InsertAsNext(block);
- }
- inline bool IsAnchor() { return first_free_ == NULL && used_nodes_ == 0; }
- inline bool IsDetached() {
- ASSERT_EQ(prev_block_ == this, next_block_ == this);
- return prev_block_ == this;
- }
- bool HasAtLeastLength(int length);
- bool IsUnused() { return used_nodes_ == 0; }
- int used_nodes() const { return used_nodes_; }
- BlockList* next() { return next_block_; }
- BlockList* prev() { return prev_block_; }
-#ifdef DEBUG
- int LengthOfFreeList();
-#endif
- static void SortBlocks(GlobalHandles* global_handles, bool prune);
-
- protected:
- BlockList* prev_block_;
- BlockList* next_block_;
- Node* first_free_;
- int used_nodes_;
-
- private:
- // Needed for quicksort
- static int CompareBlocks(const void* a, const void* b);
- void InsertAsNext(BlockList* block);
- DISALLOW_COPY_AND_ASSIGN(BlockList);
- };
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_;
- // Anchors for doubly linked lists of blocks
- BlockList full_blocks_;
- BlockList non_full_blocks_;
+ // List of all allocated node blocks.
+ NodeBlock* first_block_;
+
+ // List of node blocks with used nodes.
+ NodeBlock* first_used_block_;
- // An array of all the anchors held by GlobalHandles.
- // This simplifies iteration across all blocks.
- static const int kAllAnchorsSize = 2;
- BlockList* all_anchors_[kAllAnchorsSize];
+ // Free list of nodes.
+ Node* first_free_;
// 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698