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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 for (NodeId id = 0; id < source_graph_->NodeCount(); ++id) { | 202 for (NodeId id = 0; id < source_graph_->NodeCount(); ++id) { |
203 Node* sentinel = sentinels_[id]; | 203 Node* sentinel = sentinels_[id]; |
204 if (sentinel == NULL) continue; | 204 if (sentinel == NULL) continue; |
205 Node* copy = copies_[id]; | 205 Node* copy = copies_[id]; |
206 DCHECK_NE(NULL, copy); | 206 DCHECK_NE(NULL, copy); |
207 sentinel->ReplaceUses(copy); | 207 sentinel->ReplaceUses(copy); |
208 } | 208 } |
209 } | 209 } |
210 | 210 |
211 Node* GetSentinel(Node* original) { | 211 Node* GetSentinel(Node* original) { |
212 Node* sentinel = sentinels_[original->id()]; | 212 if (sentinels_[original->id()] == NULL) { |
213 if (sentinel == NULL) { | 213 sentinels_[original->id()] = target_graph_->NewNode(&sentinel_op_); |
214 sentinel = target_graph_->NewNode(&sentinel_op_); | |
215 } | 214 } |
216 return sentinel; | 215 return sentinels_[original->id()]; |
217 } | 216 } |
218 | 217 |
219 NodeVector copies_; | 218 NodeVector copies_; |
220 NodeVector sentinels_; | 219 NodeVector sentinels_; |
221 Graph* source_graph_; | 220 Graph* source_graph_; |
222 Graph* target_graph_; | 221 Graph* target_graph_; |
223 Zone* temp_zone_; | 222 Zone* temp_zone_; |
224 Operator sentinel_op_; | 223 Operator sentinel_op_; |
225 }; | 224 }; |
226 | 225 |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 info_->shared_info()->DebugName()->ToCString().get()); | 485 info_->shared_info()->DebugName()->ToCString().get()); |
487 } | 486 } |
488 NodeProperties::ReplaceWithValue(call_node, r.first, r.second); | 487 NodeProperties::ReplaceWithValue(call_node, r.first, r.second); |
489 call_node->RemoveAllInputs(); | 488 call_node->RemoveAllInputs(); |
490 DCHECK_EQ(0, call_node->UseCount()); | 489 DCHECK_EQ(0, call_node->UseCount()); |
491 } | 490 } |
492 } | 491 } |
493 } | 492 } |
494 } | 493 } |
495 } // namespace v8::internal::compiler | 494 } // namespace v8::internal::compiler |
OLD | NEW |