Lines Matching refs:Node
9 #include "src/compiler/node-matchers.h"
10 #include "src/compiler/node-properties.h"
31 Node* node = queue_.front();
33 if (node->IsDead()) continue;
34 switch (node->opcode()) {
36 VisitBranch(node);
39 VisitNode(node);
46 void ControlFlowOptimizer::Enqueue(Node* node) {
47 DCHECK_NOT_NULL(node);
48 if (node->IsDead() || queued_.Get(node)) return;
49 queued_.Set(node, true);
50 queue_.push(node);
54 void ControlFlowOptimizer::VisitNode(Node* node) {
55 for (Edge edge : node->use_edges()) {
63 void ControlFlowOptimizer::VisitBranch(Node* node) {
64 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
65 if (TryBuildSwitch(node)) return;
66 VisitNode(node);
70 bool ControlFlowOptimizer::TryBuildSwitch(Node* node) {
71 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
73 Node* branch = node;
75 Node* cond = NodeProperties::GetValueInput(branch, 0);
78 Node* index = m.left().node();
84 Node* if_false;
85 Node* if_true;
95 Node* branch1 = *it++;
99 Node* cond1 = branch1->InputAt(0);
102 if (m1.left().node() != index) break;
108 if (branch != node) {
110 if_true->ReplaceInput(0, node);
121 DCHECK_EQ(IrOpcode::kBranch, node->opcode());
123 if (branch == node) {
128 node->ReplaceInput(0, index);
129 NodeProperties::ChangeOp(node, common()->Switch(values.size() + 1));
130 if_true->ReplaceInput(0, node);
133 if_false->ReplaceInput(0, node);