| 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 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1522 ProcessLoadFromPhi(offset, from, node, state); | 1522 ProcessLoadFromPhi(offset, from, node, state); |
| 1523 } else { | 1523 } else { |
| 1524 UpdateReplacement(state, node, nullptr); | 1524 UpdateReplacement(state, node, nullptr); |
| 1525 } | 1525 } |
| 1526 } | 1526 } |
| 1527 | 1527 |
| 1528 void EscapeAnalysis::ProcessCheckMaps(Node* node) { | 1528 void EscapeAnalysis::ProcessCheckMaps(Node* node) { |
| 1529 DCHECK_EQ(node->opcode(), IrOpcode::kCheckMaps); | 1529 DCHECK_EQ(node->opcode(), IrOpcode::kCheckMaps); |
| 1530 ForwardVirtualState(node); | 1530 ForwardVirtualState(node); |
| 1531 Node* checked = ResolveReplacement(NodeProperties::GetValueInput(node, 0)); | 1531 Node* checked = ResolveReplacement(NodeProperties::GetValueInput(node, 0)); |
| 1532 VirtualState* state = virtual_states_[node->id()]; | 1532 if (FLAG_turbo_experimental) { |
| 1533 if (VirtualObject* object = GetVirtualObject(state, checked)) { | 1533 VirtualState* state = virtual_states_[node->id()]; |
| 1534 if (!object->IsTracked()) { | 1534 if (VirtualObject* object = GetVirtualObject(state, checked)) { |
| 1535 if (status_analysis_->SetEscaped(node)) { | 1535 if (!object->IsTracked()) { |
| 1536 TRACE( | 1536 if (status_analysis_->SetEscaped(node)) { |
| 1537 "Setting #%d (%s) to escaped because checked object #%i is not " | 1537 TRACE( |
| 1538 "tracked\n", | 1538 "Setting #%d (%s) to escaped because checked object #%i is not " |
| 1539 node->id(), node->op()->mnemonic(), object->id()); | 1539 "tracked\n", |
| 1540 node->id(), node->op()->mnemonic(), object->id()); |
| 1541 } |
| 1542 return; |
| 1540 } | 1543 } |
| 1541 return; | 1544 CheckMapsParameters params = CheckMapsParametersOf(node->op()); |
| 1542 } | |
| 1543 CheckMapsParameters params = CheckMapsParametersOf(node->op()); | |
| 1544 | 1545 |
| 1545 Node* value = object->GetField(HeapObject::kMapOffset / kPointerSize); | 1546 Node* value = object->GetField(HeapObject::kMapOffset / kPointerSize); |
| 1546 if (value) { | 1547 if (value) { |
| 1547 value = ResolveReplacement(value); | 1548 value = ResolveReplacement(value); |
| 1548 // TODO(tebbi): We want to extend this beyond constant folding with a | 1549 // TODO(tebbi): We want to extend this beyond constant folding with a |
| 1549 // CheckMapsValue operator that takes the load-eliminated map value as | 1550 // CheckMapsValue operator that takes the load-eliminated map value as |
| 1550 // input. | 1551 // input. |
| 1551 if (value->opcode() == IrOpcode::kHeapConstant && | 1552 if (value->opcode() == IrOpcode::kHeapConstant && |
| 1552 params.maps().contains(ZoneHandleSet<Map>( | 1553 params.maps().contains(ZoneHandleSet<Map>( |
| 1553 Handle<Map>::cast(OpParameter<Handle<HeapObject>>(value))))) { | 1554 Handle<Map>::cast(OpParameter<Handle<HeapObject>>(value))))) { |
| 1554 TRACE("CheckMaps #%i seems to be redundant (until now).\n", node->id()); | 1555 TRACE("CheckMaps #%i seems to be redundant (until now).\n", |
| 1555 return; | 1556 node->id()); |
| 1557 return; |
| 1558 } |
| 1556 } | 1559 } |
| 1557 } | 1560 } |
| 1558 } | 1561 } |
| 1559 if (status_analysis_->SetEscaped(node)) { | 1562 if (status_analysis_->SetEscaped(node)) { |
| 1560 TRACE("Setting #%d (%s) to escaped (checking #%i)\n", node->id(), | 1563 TRACE("Setting #%d (%s) to escaped (checking #%i)\n", node->id(), |
| 1561 node->op()->mnemonic(), checked->id()); | 1564 node->op()->mnemonic(), checked->id()); |
| 1562 } | 1565 } |
| 1563 } | 1566 } |
| 1564 | 1567 |
| 1565 void EscapeAnalysis::ProcessLoadElement(Node* node) { | 1568 void EscapeAnalysis::ProcessLoadElement(Node* node) { |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1796 } | 1799 } |
| 1797 } | 1800 } |
| 1798 return false; | 1801 return false; |
| 1799 } | 1802 } |
| 1800 | 1803 |
| 1801 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } | 1804 Graph* EscapeAnalysis::graph() const { return status_analysis_->graph(); } |
| 1802 | 1805 |
| 1803 } // namespace compiler | 1806 } // namespace compiler |
| 1804 } // namespace internal | 1807 } // namespace internal |
| 1805 } // namespace v8 | 1808 } // namespace v8 |
| OLD | NEW |