Lines Matching refs:node
5 #include "src/compiler/node.h"
34 Node* const node = Node::New(zone(), 1, &kOp0, 0, nullptr, false);
35 EXPECT_EQ(1U, node->id());
36 EXPECT_EQ(0, node->UseCount());
37 EXPECT_TRUE(node->uses().empty());
38 EXPECT_EQ(0, node->InputCount());
39 EXPECT_TRUE(node->inputs().empty());
40 EXPECT_EQ(&kOp0, node->op());
41 EXPECT_EQ(kOpcode0, node->opcode());
46 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
49 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
55 Node* n0_n1[] = {n0, n1};
56 Node* n2 = Node::New(zone(), 2, &kOp2, 2, n0_n1, false);
67 Node* node = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
68 EXPECT_EQ(node->inputs().begin(), node->inputs().end());
73 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
74 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
80 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
81 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
82 Node* n0_n1[] = {n0, n1};
83 Node* n2 = Node::New(zone(), 2, &kOp2, 2, n0_n1, false);
89 Node* node = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
90 EXPECT_EQ(node->uses().begin(), node->uses().end());
95 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
96 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
102 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
103 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
104 Node* n0_n1[] = {n0, n1};
105 Node* n2 = Node::New(zone(), 2, &kOp2, 2, n0_n1, false);
111 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
113 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
117 Node* n0_n1[] = {n0, n1};
118 Node* n2 = Node::New(zone(), 2, &kOp2, 2, n0_n1, false);
136 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
137 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
138 Node* n0_n1[] = {n0, n1};
139 Node* n2 = Node::New(zone(), 2, &kOp2, 2, n0_n1, false);
140 Node* node = Node::New(zone(), 42, &kOp0, 0, nullptr, false);
141 EXPECT_TRUE(node->uses().empty());
142 node->ReplaceUses(n0);
143 EXPECT_TRUE(node->uses().empty());
144 node->ReplaceUses(n1);
145 EXPECT_TRUE(node->uses().empty());
146 node->ReplaceUses(n2);
147 EXPECT_TRUE(node->uses().empty());
152 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
153 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
154 Node* node = Node::New(zone(), 12345, &kOp0, 0, nullptr, true);
155 EXPECT_TRUE(node->inputs().empty());
156 node->AppendInput(zone(), n0);
157 EXPECT_FALSE(node->inputs().empty());
158 EXPECT_THAT(node->inputs(), ElementsAre(n0));
159 node->AppendInput(zone(), n1);
160 EXPECT_THAT(node->inputs(), ElementsAre(n0, n1));
161 node->AppendInput(zone(), n0);
162 EXPECT_THAT(node->inputs(), ElementsAre(n0, n1, n0));
163 node->AppendInput(zone(), n0);
164 EXPECT_THAT(node->inputs(), ElementsAre(n0, n1, n0, n0));
165 node->AppendInput(zone(), n1);
166 EXPECT_THAT(node->inputs(), ElementsAre(n0, n1, n0, n0, n1));
171 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
172 Node* n1 = Node::New(zone(), 1, &kOp0, 0, nullptr, false);
173 Node* n2 = Node::New(zone(), 2, &kOp0, 0, nullptr, false);
174 Node* n3 = Node::New(zone(), 3, &kOp0, 0, nullptr, false);
175 Node* n4 = Node::New(zone(), 4, &kOp0, 0, nullptr, false);
176 Node* n5 = Node::New(zone(), 5, &kOp0, 0, nullptr, false);
177 Node* n6 = Node::New(zone(), 6, &kOp0, 0, nullptr, false);
178 Node* n7 = Node::New(zone(), 7, &kOp0, 0, nullptr, false);
179 Node* n8 = Node::New(zone(), 8, &kOp0, 0, nullptr, false);
180 Node* n9 = Node::New(zone(), 9, &kOp0, 0, nullptr, false);
181 Node* node = Node::New(zone(), 12345, &kOp0, 0, nullptr, true);
183 EXPECT_TRUE(node->inputs().empty());
185 node->AppendInput(zone(), n0);
186 EXPECT_FALSE(node->inputs().empty());
187 EXPECT_THAT(node->inputs(), ElementsAre(n0));
189 node->TrimInputCount(0);
190 EXPECT_TRUE(node->inputs().empty());
192 node->AppendInput(zone(), n1);
193 EXPECT_FALSE(node->inputs().empty());
194 EXPECT_THAT(node->inputs(), ElementsAre(n1));
196 node->AppendInput(zone(), n2);
197 EXPECT_FALSE(node->inputs().empty());
198 EXPECT_THAT(node->inputs(), ElementsAre(n1, n2));
200 node->TrimInputCount(1);
201 EXPECT_FALSE(node->inputs().empty());
202 EXPECT_THAT(node->inputs(), ElementsAre(n1));
204 node->AppendInput(zone(), n3);
205 EXPECT_FALSE(node->inputs().empty());
206 EXPECT_THAT(node->inputs(), ElementsAre(n1, n3));
208 node->AppendInput(zone(), n4);
209 EXPECT_FALSE(node->inputs().empty());
210 EXPECT_THAT(node->inputs(), ElementsAre(n1, n3, n4));
212 node->AppendInput(zone(), n5);
213 EXPECT_FALSE(node->inputs().empty());
214 EXPECT_THAT(node->inputs(), ElementsAre(n1, n3, n4, n5));
216 node->AppendInput(zone(), n6);
217 EXPECT_FALSE(node->inputs().empty());
218 EXPECT_THAT(node->inputs(), ElementsAre(n1, n3, n4, n5, n6));
220 node->AppendInput(zone(), n7);
221 EXPECT_FALSE(node->inputs().empty());
222 EXPECT_THAT(node->inputs(), ElementsAre(n1, n3, n4, n5, n6, n7));
224 node->TrimInputCount(4);
225 EXPECT_THAT(node->inputs(), ElementsAre(n1, n3, n4, n5));
227 node->AppendInput(zone(), n8);
228 EXPECT_FALSE(node->inputs().empty());
229 EXPECT_THAT(node->inputs(), ElementsAre(n1, n3, n4, n5, n8));
231 node->AppendInput(zone(), n9);
232 EXPECT_FALSE(node->inputs().empty());
233 EXPECT_THAT(node->inputs(), ElementsAre(n1, n3, n4, n5, n8, n9));
239 Node* inputs[kMaxSize];
241 Node* n0 = Node::New(zone(), 0, &kOp0, 0, nullptr, false);
242 Node* n1 = Node::New(zone(), 1, &kOp1, 1, &n0, false);
249 Node* node = Node::New(zone(), 12345, &kOp0, size, inputs, false);
250 EXPECT_EQ(size, node->InputCount());
253 EXPECT_EQ(inputs[i], node->InputAt(i));