| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/escape-analysis.h" | 5 #include "src/compiler/escape-analysis.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "src/base/flags.h" | 9 #include "src/base/flags.h" |
| 10 #include "src/bootstrapper.h" | 10 #include "src/bootstrapper.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 | 434 |
| 435 } // namespace | 435 } // namespace |
| 436 | 436 |
| 437 bool VirtualObject::MergeFields(size_t i, Node* at, MergeCache* cache, | 437 bool VirtualObject::MergeFields(size_t i, Node* at, MergeCache* cache, |
| 438 Graph* graph, CommonOperatorBuilder* common) { | 438 Graph* graph, CommonOperatorBuilder* common) { |
| 439 bool changed = false; | 439 bool changed = false; |
| 440 int value_input_count = static_cast<int>(cache->fields().size()); | 440 int value_input_count = static_cast<int>(cache->fields().size()); |
| 441 Node* rep = GetField(i); | 441 Node* rep = GetField(i); |
| 442 if (!rep || !IsCreatedPhi(i)) { | 442 if (!rep || !IsCreatedPhi(i)) { |
| 443 Node* control = NodeProperties::GetControlInput(at); | 443 Node* control = NodeProperties::GetControlInput(at); |
| 444 | |
| 445 // Check to debug canary. | |
| 446 CHECK_NOT_NULL(control); | |
| 447 CHECK(!control->IsDead()); | |
| 448 for (Node* input : cache->fields()) { | |
| 449 CHECK_NOT_NULL(input); | |
| 450 CHECK(!input->IsDead()); | |
| 451 } | |
| 452 | |
| 453 cache->fields().push_back(control); | 444 cache->fields().push_back(control); |
| 454 Node* phi = graph->NewNode( | 445 Node* phi = graph->NewNode( |
| 455 common->Phi(MachineRepresentation::kTagged, value_input_count), | 446 common->Phi(MachineRepresentation::kTagged, value_input_count), |
| 456 value_input_count + 1, &cache->fields().front()); | 447 value_input_count + 1, &cache->fields().front()); |
| 457 SetField(i, phi, true); | 448 SetField(i, phi, true); |
| 458 #ifdef DEBUG | 449 #ifdef DEBUG |
| 459 if (FLAG_trace_turbo_escape) { | 450 if (FLAG_trace_turbo_escape) { |
| 460 PrintF(" Creating Phi #%d as merge of", phi->id()); | 451 PrintF(" Creating Phi #%d as merge of", phi->id()); |
| 461 for (int i = 0; i < value_input_count; i++) { | 452 for (int i = 0; i < value_input_count; i++) { |
| 462 PrintF(" #%d (%s)", cache->fields()[i]->id(), | 453 PrintF(" #%d (%s)", cache->fields()[i]->id(), |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1694 } | 1685 } |
| 1695 } | 1686 } |
| 1696 return false; | 1687 return false; |
| 1697 } | 1688 } |
| 1698 | 1689 |
| 1699 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } | 1690 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } |
| 1700 | 1691 |
| 1701 } // namespace compiler | 1692 } // namespace compiler |
| 1702 } // namespace internal | 1693 } // namespace internal |
| 1703 } // namespace v8 | 1694 } // namespace v8 |
| OLD | NEW |