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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 node->opcode() == IrOpcode::kAllocate) && | 1579 node->opcode() == IrOpcode::kAllocate) && |
1580 IsVirtual(node)) { | 1580 IsVirtual(node)) { |
1581 if (VirtualObject* vobj = GetVirtualObject(virtual_states_[effect->id()], | 1581 if (VirtualObject* vobj = GetVirtualObject(virtual_states_[effect->id()], |
1582 ResolveReplacement(node))) { | 1582 ResolveReplacement(node))) { |
1583 if (Node* object_state = vobj->GetObjectState()) { | 1583 if (Node* object_state = vobj->GetObjectState()) { |
1584 return object_state; | 1584 return object_state; |
1585 } else { | 1585 } else { |
1586 cache_->fields().clear(); | 1586 cache_->fields().clear(); |
1587 for (size_t i = 0; i < vobj->field_count(); ++i) { | 1587 for (size_t i = 0; i < vobj->field_count(); ++i) { |
1588 if (Node* field = vobj->GetField(i)) { | 1588 if (Node* field = vobj->GetField(i)) { |
1589 cache_->fields().push_back(field); | 1589 cache_->fields().push_back(ResolveReplacement(field)); |
1590 } | 1590 } |
1591 } | 1591 } |
1592 int input_count = static_cast<int>(cache_->fields().size()); | 1592 int input_count = static_cast<int>(cache_->fields().size()); |
1593 Node* new_object_state = | 1593 Node* new_object_state = |
1594 graph()->NewNode(common()->ObjectState(input_count), input_count, | 1594 graph()->NewNode(common()->ObjectState(input_count), input_count, |
1595 &cache_->fields().front()); | 1595 &cache_->fields().front()); |
1596 vobj->SetObjectState(new_object_state); | 1596 vobj->SetObjectState(new_object_state); |
1597 TRACE( | 1597 TRACE( |
1598 "Creating object state #%d for vobj %p (from node #%d) at effect " | 1598 "Creating object state #%d for vobj %p (from node #%d) at effect " |
1599 "#%d\n", | 1599 "#%d\n", |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 } | 1685 } |
1686 } | 1686 } |
1687 return false; | 1687 return false; |
1688 } | 1688 } |
1689 | 1689 |
1690 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } | 1690 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } |
1691 | 1691 |
1692 } // namespace compiler | 1692 } // namespace compiler |
1693 } // namespace internal | 1693 } // namespace internal |
1694 } // namespace v8 | 1694 } // namespace v8 |
OLD | NEW |