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 1560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1571 return object_state; | 1571 return object_state; |
1572 } else { | 1572 } else { |
1573 cache_->fields().clear(); | 1573 cache_->fields().clear(); |
1574 for (size_t i = 0; i < vobj->field_count(); ++i) { | 1574 for (size_t i = 0; i < vobj->field_count(); ++i) { |
1575 if (Node* field = vobj->GetField(i)) { | 1575 if (Node* field = vobj->GetField(i)) { |
1576 cache_->fields().push_back(field); | 1576 cache_->fields().push_back(field); |
1577 } | 1577 } |
1578 } | 1578 } |
1579 int input_count = static_cast<int>(cache_->fields().size()); | 1579 int input_count = static_cast<int>(cache_->fields().size()); |
1580 Node* new_object_state = | 1580 Node* new_object_state = |
1581 graph()->NewNode(common()->ObjectState(input_count, vobj->id()), | 1581 graph()->NewNode(common()->ObjectState(input_count), input_count, |
1582 input_count, &cache_->fields().front()); | 1582 &cache_->fields().front()); |
1583 vobj->SetObjectState(new_object_state); | 1583 vobj->SetObjectState(new_object_state); |
1584 TRACE( | 1584 TRACE( |
1585 "Creating object state #%d for vobj %p (from node #%d) at effect " | 1585 "Creating object state #%d for vobj %p (from node #%d) at effect " |
1586 "#%d\n", | 1586 "#%d\n", |
1587 new_object_state->id(), static_cast<void*>(vobj), node->id(), | 1587 new_object_state->id(), static_cast<void*>(vobj), node->id(), |
1588 effect->id()); | 1588 effect->id()); |
1589 // Now fix uses of other objects. | 1589 // Now fix uses of other objects. |
1590 for (size_t i = 0; i < vobj->field_count(); ++i) { | 1590 for (size_t i = 0; i < vobj->field_count(); ++i) { |
1591 if (Node* field = vobj->GetField(i)) { | 1591 if (Node* field = vobj->GetField(i)) { |
1592 if (Node* field_object_state = | 1592 if (Node* field_object_state = |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1672 } | 1672 } |
1673 } | 1673 } |
1674 return false; | 1674 return false; |
1675 } | 1675 } |
1676 | 1676 |
1677 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } | 1677 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } |
1678 | 1678 |
1679 } // namespace compiler | 1679 } // namespace compiler |
1680 } // namespace internal | 1680 } // namespace internal |
1681 } // namespace v8 | 1681 } // namespace v8 |
OLD | NEW |