OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/compiler/graph-builder.h" | 5 #include "src/compiler/graph-builder.h" |
6 | 6 |
7 #include "src/compiler.h" | 7 #include "src/compiler.h" |
8 #include "src/compiler/generic-graph.h" | 8 #include "src/compiler/generic-graph.h" |
9 #include "src/compiler/generic-node.h" | 9 #include "src/compiler/generic-node.h" |
10 #include "src/compiler/generic-node-inl.h" | 10 #include "src/compiler/generic-node-inl.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 Node* effect = builder_->NewEffectPhi(1, GetEffectDependency(), control); | 160 Node* effect = builder_->NewEffectPhi(1, GetEffectDependency(), control); |
161 UpdateEffectDependency(effect); | 161 UpdateEffectDependency(effect); |
162 } | 162 } |
163 | 163 |
164 | 164 |
165 Node* StructuredGraphBuilder::NewPhi(int count, Node* input, Node* control) { | 165 Node* StructuredGraphBuilder::NewPhi(int count, Node* input, Node* control) { |
166 const Operator* phi_op = common()->Phi(kMachAnyTagged, count); | 166 const Operator* phi_op = common()->Phi(kMachAnyTagged, count); |
167 Node** buffer = local_zone()->NewArray<Node*>(count + 1); | 167 Node** buffer = local_zone()->NewArray<Node*>(count + 1); |
168 MemsetPointer(buffer, input, count); | 168 MemsetPointer(buffer, input, count); |
169 buffer[count] = control; | 169 buffer[count] = control; |
170 return graph()->NewNode(phi_op, count + 1, buffer); | 170 return graph()->NewNode(phi_op, count + 1, buffer, true); |
171 } | 171 } |
172 | 172 |
173 | 173 |
174 // TODO(mstarzinger): Revisit this once we have proper effect states. | 174 // TODO(mstarzinger): Revisit this once we have proper effect states. |
175 Node* StructuredGraphBuilder::NewEffectPhi(int count, Node* input, | 175 Node* StructuredGraphBuilder::NewEffectPhi(int count, Node* input, |
176 Node* control) { | 176 Node* control) { |
177 const Operator* phi_op = common()->EffectPhi(count); | 177 const Operator* phi_op = common()->EffectPhi(count); |
178 Node** buffer = local_zone()->NewArray<Node*>(count + 1); | 178 Node** buffer = local_zone()->NewArray<Node*>(count + 1); |
179 MemsetPointer(buffer, input, count); | 179 MemsetPointer(buffer, input, count); |
180 buffer[count] = control; | 180 buffer[count] = control; |
181 return graph()->NewNode(phi_op, count + 1, buffer); | 181 return graph()->NewNode(phi_op, count + 1, buffer, true); |
182 } | 182 } |
183 | 183 |
184 | 184 |
185 Node* StructuredGraphBuilder::MergeControl(Node* control, Node* other) { | 185 Node* StructuredGraphBuilder::MergeControl(Node* control, Node* other) { |
186 int inputs = OperatorProperties::GetControlInputCount(control->op()) + 1; | 186 int inputs = OperatorProperties::GetControlInputCount(control->op()) + 1; |
187 if (control->opcode() == IrOpcode::kLoop) { | 187 if (control->opcode() == IrOpcode::kLoop) { |
188 // Control node for loop exists, add input. | 188 // Control node for loop exists, add input. |
189 const Operator* op = common()->Loop(inputs); | 189 const Operator* op = common()->Loop(inputs); |
190 control->AppendInput(graph_zone(), other); | 190 control->AppendInput(graph_zone(), other); |
191 control->set_op(op); | 191 control->set_op(op); |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (!dead_control_.is_set()) { | 241 if (!dead_control_.is_set()) { |
242 Node* dead_node = graph()->NewNode(common_->Dead()); | 242 Node* dead_node = graph()->NewNode(common_->Dead()); |
243 dead_control_.set(dead_node); | 243 dead_control_.set(dead_node); |
244 return dead_node; | 244 return dead_node; |
245 } | 245 } |
246 return dead_control_.get(); | 246 return dead_control_.get(); |
247 } | 247 } |
248 } | 248 } |
249 } | 249 } |
250 } // namespace v8::internal::compiler | 250 } // namespace v8::internal::compiler |
OLD | NEW |