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 1499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1510 UpdateReplacement(state, node, value); | 1510 UpdateReplacement(state, node, value); |
1511 } else { | 1511 } else { |
1512 UpdateReplacement(state, node, nullptr); | 1512 UpdateReplacement(state, node, nullptr); |
1513 } | 1513 } |
1514 } | 1514 } |
1515 | 1515 |
1516 void EscapeAnalysis::ProcessCheckMaps(Node* node) { | 1516 void EscapeAnalysis::ProcessCheckMaps(Node* node) { |
1517 DCHECK_EQ(node->opcode(), IrOpcode::kCheckMaps); | 1517 DCHECK_EQ(node->opcode(), IrOpcode::kCheckMaps); |
1518 ForwardVirtualState(node); | 1518 ForwardVirtualState(node); |
1519 Node* checked = ResolveReplacement(NodeProperties::GetValueInput(node, 0)); | 1519 Node* checked = ResolveReplacement(NodeProperties::GetValueInput(node, 0)); |
1520 VirtualState* state = virtual_states_[node->id()]; | 1520 if (FLAG_turbo_experimental) { |
1521 if (VirtualObject* object = GetVirtualObject(state, checked)) { | 1521 VirtualState* state = virtual_states_[node->id()]; |
1522 if (!object->IsTracked()) { | 1522 if (VirtualObject* object = GetVirtualObject(state, checked)) { |
1523 if (status_analysis_->SetEscaped(node)) { | 1523 if (!object->IsTracked()) { |
1524 TRACE( | 1524 if (status_analysis_->SetEscaped(node)) { |
1525 "Setting #%d (%s) to escaped because checked object #%i is not " | 1525 TRACE( |
1526 "tracked\n", | 1526 "Setting #%d (%s) to escaped because checked object #%i is not " |
1527 node->id(), node->op()->mnemonic(), object->id()); | 1527 "tracked\n", |
| 1528 node->id(), node->op()->mnemonic(), object->id()); |
| 1529 } |
| 1530 return; |
1528 } | 1531 } |
1529 return; | 1532 CheckMapsParameters params = CheckMapsParametersOf(node->op()); |
1530 } | |
1531 CheckMapsParameters params = CheckMapsParametersOf(node->op()); | |
1532 | 1533 |
1533 Node* value = object->GetField(HeapObject::kMapOffset / kPointerSize); | 1534 Node* value = object->GetField(HeapObject::kMapOffset / kPointerSize); |
1534 if (value) { | 1535 if (value) { |
1535 value = ResolveReplacement(value); | 1536 value = ResolveReplacement(value); |
1536 // TODO(tebbi): We want to extend this beyond constant folding with a | 1537 // TODO(tebbi): We want to extend this beyond constant folding with a |
1537 // CheckMapsValue operator that takes the load-eliminated map value as | 1538 // CheckMapsValue operator that takes the load-eliminated map value as |
1538 // input. | 1539 // input. |
1539 if (value->opcode() == IrOpcode::kHeapConstant && | 1540 if (value->opcode() == IrOpcode::kHeapConstant && |
1540 params.maps().contains(ZoneHandleSet<Map>( | 1541 params.maps().contains(ZoneHandleSet<Map>( |
1541 Handle<Map>::cast(OpParameter<Handle<HeapObject>>(value))))) { | 1542 Handle<Map>::cast(OpParameter<Handle<HeapObject>>(value))))) { |
1542 TRACE("CheckMaps #%i seems to be redundant (until now).\n", node->id()); | 1543 TRACE("CheckMaps #%i seems to be redundant (until now).\n", |
1543 return; | 1544 node->id()); |
| 1545 return; |
| 1546 } |
1544 } | 1547 } |
1545 } | 1548 } |
1546 } | 1549 } |
1547 if (status_analysis_->SetEscaped(node)) { | 1550 if (status_analysis_->SetEscaped(node)) { |
1548 TRACE("Setting #%d (%s) to escaped (checking #%i)\n", node->id(), | 1551 TRACE("Setting #%d (%s) to escaped (checking #%i)\n", node->id(), |
1549 node->op()->mnemonic(), checked->id()); | 1552 node->op()->mnemonic(), checked->id()); |
1550 } | 1553 } |
1551 } | 1554 } |
1552 | 1555 |
1553 void EscapeAnalysis::ProcessLoadElement(Node* node) { | 1556 void EscapeAnalysis::ProcessLoadElement(Node* node) { |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 } | 1786 } |
1784 } | 1787 } |
1785 return false; | 1788 return false; |
1786 } | 1789 } |
1787 | 1790 |
1788 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } | 1791 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } |
1789 | 1792 |
1790 } // namespace compiler | 1793 } // namespace compiler |
1791 } // namespace internal | 1794 } // namespace internal |
1792 } // namespace v8 | 1795 } // namespace v8 |
OLD | NEW |