Lines Matching refs:node
24 Reduction EscapeAnalysisReducer::Reduce(Node* node) { in Reduce() argument
25 switch (node->opcode()) { in Reduce()
28 return ReduceLoad(node); in Reduce()
31 return ReduceStore(node); in Reduce()
33 return ReduceAllocate(node); in Reduce()
35 return ReduceFinishRegion(node); in Reduce()
37 return ReduceReferenceEqual(node); in Reduce()
39 return ReduceObjectIsSmi(node); in Reduce()
44 if (node->op()->EffectInputCount() > 0) { in Reduce()
45 return ReduceFrameStateUses(node); in Reduce()
53 Reduction EscapeAnalysisReducer::ReduceLoad(Node* node) { in ReduceLoad() argument
54 DCHECK(node->opcode() == IrOpcode::kLoadField || in ReduceLoad()
55 node->opcode() == IrOpcode::kLoadElement); in ReduceLoad()
56 if (visited_.Contains(node->id())) return NoChange(); in ReduceLoad()
57 visited_.Add(node->id()); in ReduceLoad()
58 if (Node* rep = escape_analysis()->GetReplacement(node)) { in ReduceLoad()
59 visited_.Add(node->id()); in ReduceLoad()
62 PrintF("Replaced #%d (%s) with #%d (%s)\n", node->id(), in ReduceLoad()
63 node->op()->mnemonic(), rep->id(), rep->op()->mnemonic()); in ReduceLoad()
65 ReplaceWithValue(node, rep); in ReduceLoad()
72 Reduction EscapeAnalysisReducer::ReduceStore(Node* node) { in ReduceStore() argument
73 DCHECK(node->opcode() == IrOpcode::kStoreField || in ReduceStore()
74 node->opcode() == IrOpcode::kStoreElement); in ReduceStore()
75 if (visited_.Contains(node->id())) return NoChange(); in ReduceStore()
76 visited_.Add(node->id()); in ReduceStore()
77 if (escape_analysis()->IsVirtual(NodeProperties::GetValueInput(node, 0))) { in ReduceStore()
79 PrintF("Removed #%d (%s) from effect chain\n", node->id(), in ReduceStore()
80 node->op()->mnemonic()); in ReduceStore()
82 RelaxEffectsAndControls(node); in ReduceStore()
83 return Changed(node); in ReduceStore()
89 Reduction EscapeAnalysisReducer::ReduceAllocate(Node* node) { in ReduceAllocate() argument
90 DCHECK_EQ(node->opcode(), IrOpcode::kAllocate); in ReduceAllocate()
91 if (visited_.Contains(node->id())) return NoChange(); in ReduceAllocate()
92 visited_.Add(node->id()); in ReduceAllocate()
93 if (escape_analysis()->IsVirtual(node)) { in ReduceAllocate()
94 RelaxEffectsAndControls(node); in ReduceAllocate()
97 PrintF("Removed allocate #%d from effect chain\n", node->id()); in ReduceAllocate()
99 return Changed(node); in ReduceAllocate()
105 Reduction EscapeAnalysisReducer::ReduceFinishRegion(Node* node) { in ReduceFinishRegion() argument
106 DCHECK_EQ(node->opcode(), IrOpcode::kFinishRegion); in ReduceFinishRegion()
107 Node* effect = NodeProperties::GetEffectInput(node, 0); in ReduceFinishRegion()
110 RelaxEffectsAndControls(node); in ReduceFinishRegion()
113 node->id()); in ReduceFinishRegion()
114 PrintF(" %d user(s) of #%d remain(s):", node->UseCount(), node->id()); in ReduceFinishRegion()
115 for (Edge edge : node->use_edges()) { in ReduceFinishRegion()
120 return Changed(node); in ReduceFinishRegion()
126 Reduction EscapeAnalysisReducer::ReduceReferenceEqual(Node* node) { in ReduceReferenceEqual() argument
127 DCHECK_EQ(node->opcode(), IrOpcode::kReferenceEqual); in ReduceReferenceEqual()
128 Node* left = NodeProperties::GetValueInput(node, 0); in ReduceReferenceEqual()
129 Node* right = NodeProperties::GetValueInput(node, 1); in ReduceReferenceEqual()
133 ReplaceWithValue(node, jsgraph()->TrueConstant()); in ReduceReferenceEqual()
135 PrintF("Replaced ref eq #%d with true\n", node->id()); in ReduceReferenceEqual()
139 ReplaceWithValue(node, jsgraph()->FalseConstant()); in ReduceReferenceEqual()
141 PrintF("Replaced ref eq #%d with false\n", node->id()); in ReduceReferenceEqual()
143 return Replace(node); in ReduceReferenceEqual()
146 ReplaceWithValue(node, jsgraph()->FalseConstant()); in ReduceReferenceEqual()
148 PrintF("Replaced ref eq #%d with false\n", node->id()); in ReduceReferenceEqual()
155 Reduction EscapeAnalysisReducer::ReduceObjectIsSmi(Node* node) { in ReduceObjectIsSmi() argument
156 DCHECK_EQ(node->opcode(), IrOpcode::kObjectIsSmi); in ReduceObjectIsSmi()
157 Node* input = NodeProperties::GetValueInput(node, 0); in ReduceObjectIsSmi()
159 ReplaceWithValue(node, jsgraph()->FalseConstant()); in ReduceObjectIsSmi()
161 PrintF("Replaced ObjectIsSmi #%d with false\n", node->id()); in ReduceObjectIsSmi()
163 return Replace(node); in ReduceObjectIsSmi()
169 Reduction EscapeAnalysisReducer::ReduceFrameStateUses(Node* node) { in ReduceFrameStateUses() argument
170 if (visited_.Contains(node->id())) return NoChange(); in ReduceFrameStateUses()
171 visited_.Add(node->id()); in ReduceFrameStateUses()
172 DCHECK_GE(node->op()->EffectInputCount(), 1); in ReduceFrameStateUses()
174 for (int i = 0; i < node->InputCount(); ++i) { in ReduceFrameStateUses()
175 Node* input = node->InputAt(i); in ReduceFrameStateUses()
177 if (Node* ret = ReduceFrameState(input, node, false)) { in ReduceFrameStateUses()
178 node->ReplaceInput(i, ret); in ReduceFrameStateUses()
184 return Changed(node); in ReduceFrameStateUses()
191 Node* EscapeAnalysisReducer::ReduceFrameState(Node* node, Node* effect, in ReduceFrameState() argument
193 DCHECK(node->opcode() == IrOpcode::kFrameState); in ReduceFrameState()
195 PrintF("Reducing FrameState %d\n", node->id()); in ReduceFrameState()
198 for (int i = 0; i < node->op()->ValueInputCount(); ++i) { in ReduceFrameState()
199 Node* input = NodeProperties::GetValueInput(node, i); in ReduceFrameState()
202 ? ReduceStateValueInputs(input, effect, node->UseCount() > 1) in ReduceFrameState()
203 : ReduceStateValueInput(node, i, effect, node->UseCount() > 1); in ReduceFrameState()
205 if (node->UseCount() > 1 || multiple_users) { in ReduceFrameState()
207 PrintF(" Cloning #%d", node->id()); in ReduceFrameState()
209 node = clone = jsgraph()->graph()->CloneNode(node); in ReduceFrameState()
211 PrintF(" to #%d\n", node->id()); in ReduceFrameState()
215 NodeProperties::ReplaceValueInput(node, ret, i); in ReduceFrameState()
218 Node* outer_frame_state = NodeProperties::GetFrameStateInput(node, 0); in ReduceFrameState()
221 ReduceFrameState(outer_frame_state, effect, node->UseCount() > 1)) { in ReduceFrameState()
222 if (node->UseCount() > 1 || multiple_users) { in ReduceFrameState()
224 PrintF(" Cloning #%d", node->id()); in ReduceFrameState()
226 node = clone = jsgraph()->graph()->CloneNode(node); in ReduceFrameState()
228 PrintF(" to #%d\n", node->id()); in ReduceFrameState()
232 NodeProperties::ReplaceFrameStateInput(node, 0, ret); in ReduceFrameState()
240 Node* EscapeAnalysisReducer::ReduceStateValueInputs(Node* node, Node* effect, in ReduceStateValueInputs() argument
243 PrintF("Reducing StateValue #%d\n", node->id()); in ReduceStateValueInputs()
245 DCHECK(node->opcode() == IrOpcode::kStateValues); in ReduceStateValueInputs()
248 for (int i = 0; i < node->op()->ValueInputCount(); ++i) { in ReduceStateValueInputs()
249 Node* input = NodeProperties::GetValueInput(node, i); in ReduceStateValueInputs()
254 ret = ReduceStateValueInput(node, i, effect, multiple_users); in ReduceStateValueInputs()
257 node = ret; in ReduceStateValueInputs()
268 Node* EscapeAnalysisReducer::ReduceStateValueInput(Node* node, int node_index, in ReduceStateValueInput() argument
271 Node* input = NodeProperties::GetValueInput(node, node_index); in ReduceStateValueInput()
282 if (node->UseCount() > 1 || multiple_users) { in ReduceStateValueInput()
284 PrintF("Cloning #%d", node->id()); in ReduceStateValueInput()
286 node = clone = jsgraph()->graph()->CloneNode(node); in ReduceStateValueInput()
288 PrintF(" to #%d\n", node->id()); in ReduceStateValueInput()
291 NodeProperties::ReplaceValueInput(node, object_state, node_index); in ReduceStateValueInput()
294 node->id(), input->id(), object_state->id()); in ReduceStateValueInput()