Commit 489d2a18 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[global-handles] Refactor to allow for different node type

- Introduce NodeSpace that holds allocation related logic.
- Provide std compatible iterator for node iteration.

This allows for creating a different internal node type.

The change is just a refactoring without functional changes.

Bug: chromium:923361
Change-Id: I424f821d96b3a82f64024aedff6c289d3eec11a2
Reviewed-on: https://chromium-review.googlesource.com/c/1418192
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58931}
parent 9026d671
This diff is collapsed.
......@@ -185,8 +185,12 @@ class GlobalHandles {
private:
// Internal node structures.
class Node;
template <class NodeType>
class NodeBlock;
template <class BlockType>
class NodeIterator;
template <class NodeType>
class NodeSpace;
class PendingPhantomCallback;
explicit GlobalHandles(Isolate* isolate);
......@@ -201,15 +205,7 @@ class GlobalHandles {
Isolate* isolate_;
// List of all allocated node blocks.
NodeBlock* first_block_;
// List of node blocks with used nodes.
NodeBlock* first_used_block_;
// Free list of nodes.
Node* first_free_;
std::unique_ptr<NodeSpace<Node>> regular_nodes_;
// Contains all nodes holding new space objects. Note: when the list
// is accessed, some of the objects may have been promoted already.
std::vector<Node*> new_space_nodes_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment