summaryrefslogtreecommitdiff
path: root/deps/v8/src/global-handles.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/global-handles.h')
-rw-r--r--deps/v8/src/global-handles.h64
1 files changed, 7 insertions, 57 deletions
diff --git a/deps/v8/src/global-handles.h b/deps/v8/src/global-handles.h
index 2c20711ea1..5a4ad13e2f 100644
--- a/deps/v8/src/global-handles.h
+++ b/deps/v8/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.