Commit 65b66634 authored by titzer's avatar titzer Committed by Commit bot

[turbofan] Rework Node guts to save space.

This reduces the storage per-Node storage from 7 words to 6 and per-edge
storage from 6 words to 4.
On average this is about 10%-15% space savings over the whole graph.

Remove the use of std::deque as the out-of-line storage for inputs.
Reduce size of Use links and use pointer arithmetic to find Node
from Use.

R=mstarzinger@chromium.org,jarin@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1150923003

Cr-Commit-Position: refs/heads/master@{#28583}
parent dd5a93cd
This diff is collapsed.
This diff is collapsed.
......@@ -864,8 +864,8 @@ TEST(CMergeReduce_dead_rm1b) {
Node* t = R.graph.NewNode(R.common.IfTrue(), R.start);
Node* f = R.graph.NewNode(R.common.IfTrue(), R.start);
for (int i = 0; i < 2; i++) {
Node* merge = R.graph.NewNode(R.common.Merge(3), R.dead, R.dead, R.dead);
for (int j = i + 1; j < 3; j++) {
Node* merge = R.graph.NewNode(R.common.Merge(3), R.dead, R.dead, R.dead);
merge->ReplaceInput(i, t);
merge->ReplaceInput(j, f);
R.ReduceMerge(merge, merge);
......
......@@ -233,6 +233,29 @@ TEST_F(NodeTest, TrimThenAppend) {
EXPECT_THAT(node->inputs(), ElementsAre(n1, n3, n4, n5, n8, n9));
}
TEST_F(NodeTest, BigNodes) {
static const int kMaxSize = 512;
Node* inputs[kMaxSize];
Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
for (int i = 0; i < kMaxSize; i++) {
inputs[i] = i & 1 ? n0 : n1;
}
for (int size = 13; size <= kMaxSize; size += 9) {
Node* node = Node::New(zone(), 12345, &kOp0, size, inputs, false);
EXPECT_EQ(size, node->InputCount());
for (int i = 0; i < size; i++) {
EXPECT_EQ(inputs[i], node->InputAt(i));
}
}
}
} // namespace compiler
} // namespace internal
} // namespace v8
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