| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/ast.h" | 5 #include "src/ast.h" |
| 6 #include "src/ast-numbering.h" | 6 #include "src/ast-numbering.h" |
| 7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
| 8 #include "src/compiler/ast-graph-builder.h" | 8 #include "src/compiler/ast-graph-builder.h" |
| 9 #include "src/compiler/common-operator.h" | 9 #include "src/compiler/common-operator.h" |
| 10 #include "src/compiler/generic-node-inl.h" | 10 #include "src/compiler/generic-node-inl.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 | 170 |
| 171 class CopyVisitor : public NullNodeVisitor { | 171 class CopyVisitor : public NullNodeVisitor { |
| 172 public: | 172 public: |
| 173 CopyVisitor(Graph* source_graph, Graph* target_graph, Zone* temp_zone) | 173 CopyVisitor(Graph* source_graph, Graph* target_graph, Zone* temp_zone) |
| 174 : copies_(source_graph->NodeCount(), NULL, temp_zone), | 174 : copies_(source_graph->NodeCount(), NULL, temp_zone), |
| 175 sentinels_(source_graph->NodeCount(), NULL, temp_zone), | 175 sentinels_(source_graph->NodeCount(), NULL, temp_zone), |
| 176 source_graph_(source_graph), | 176 source_graph_(source_graph), |
| 177 target_graph_(target_graph), | 177 target_graph_(target_graph), |
| 178 temp_zone_(temp_zone), | 178 temp_zone_(temp_zone), |
| 179 sentinel_op_(IrOpcode::kDead, Operator::kNoProperties, 0, 0, | 179 sentinel_op_(IrOpcode::kDead, Operator::kNoProperties, "sentinel", 0, 0, |
| 180 "sentinel") {} | 180 0, 0, 0, 0) {} |
| 181 | 181 |
| 182 GenericGraphVisit::Control Post(Node* original) { | 182 GenericGraphVisit::Control Post(Node* original) { |
| 183 NodeVector inputs(temp_zone_); | 183 NodeVector inputs(temp_zone_); |
| 184 for (InputIter it = original->inputs().begin(); | 184 for (InputIter it = original->inputs().begin(); |
| 185 it != original->inputs().end(); ++it) { | 185 it != original->inputs().end(); ++it) { |
| 186 inputs.push_back(GetCopy(*it)); | 186 inputs.push_back(GetCopy(*it)); |
| 187 } | 187 } |
| 188 | 188 |
| 189 // Reuse the operator in the copy. This assumes that op lives in a zone | 189 // Reuse the operator in the copy. This assumes that op lives in a zone |
| 190 // that lives longer than graph()'s zone. | 190 // that lives longer than graph()'s zone. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 sentinel = target_graph_->NewNode(&sentinel_op_); | 228 sentinel = target_graph_->NewNode(&sentinel_op_); |
| 229 } | 229 } |
| 230 return sentinel; | 230 return sentinel; |
| 231 } | 231 } |
| 232 | 232 |
| 233 NodeVector copies_; | 233 NodeVector copies_; |
| 234 NodeVector sentinels_; | 234 NodeVector sentinels_; |
| 235 Graph* source_graph_; | 235 Graph* source_graph_; |
| 236 Graph* target_graph_; | 236 Graph* target_graph_; |
| 237 Zone* temp_zone_; | 237 Zone* temp_zone_; |
| 238 SimpleOperator sentinel_op_; | 238 Operator sentinel_op_; |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 | 241 |
| 242 void Inlinee::InlineAtCall(JSGraph* jsgraph, Node* call) { | 242 void Inlinee::InlineAtCall(JSGraph* jsgraph, Node* call) { |
| 243 // The scheduler is smart enough to place our code; we just ensure {control} | 243 // The scheduler is smart enough to place our code; we just ensure {control} |
| 244 // becomes the control input of the start of the inlinee. | 244 // becomes the control input of the start of the inlinee. |
| 245 Node* control = NodeProperties::GetControlInput(call); | 245 Node* control = NodeProperties::GetControlInput(call); |
| 246 | 246 |
| 247 // The inlinee uses the context from the JSFunction object. This will | 247 // The inlinee uses the context from the JSFunction object. This will |
| 248 // also be the effect dependency for the inlinee as it produces an effect. | 248 // also be the effect dependency for the inlinee as it produces an effect. |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 info_->shared_info()->DebugName()->ToCString().get()); | 498 info_->shared_info()->DebugName()->ToCString().get()); |
| 499 } | 499 } |
| 500 NodeProperties::ReplaceWithValue(call_node, r.first, r.second); | 500 NodeProperties::ReplaceWithValue(call_node, r.first, r.second); |
| 501 call_node->RemoveAllInputs(); | 501 call_node->RemoveAllInputs(); |
| 502 DCHECK_EQ(0, call_node->UseCount()); | 502 DCHECK_EQ(0, call_node->UseCount()); |
| 503 } | 503 } |
| 504 } | 504 } |
| 505 } | 505 } |
| 506 } | 506 } |
| 507 } // namespace v8::internal::compiler | 507 } // namespace v8::internal::compiler |
| OLD | NEW |