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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 #ifdef DEBUG | 1037 #ifdef DEBUG |
1038 if (node->opcode() != IrOpcode::kLoadField && | 1038 if (node->opcode() != IrOpcode::kLoadField && |
1039 node->opcode() != IrOpcode::kLoadElement && | 1039 node->opcode() != IrOpcode::kLoadElement && |
1040 node->opcode() != IrOpcode::kLoad && IsDanglingEffectNode(node)) { | 1040 node->opcode() != IrOpcode::kLoad && IsDanglingEffectNode(node)) { |
1041 PrintF("Dangeling effect node: #%d (%s)\n", node->id(), | 1041 PrintF("Dangeling effect node: #%d (%s)\n", node->id(), |
1042 node->op()->mnemonic()); | 1042 node->op()->mnemonic()); |
1043 UNREACHABLE(); | 1043 UNREACHABLE(); |
1044 } | 1044 } |
1045 #endif // DEBUG | 1045 #endif // DEBUG |
1046 Node* effect = NodeProperties::GetEffectInput(node); | 1046 Node* effect = NodeProperties::GetEffectInput(node); |
1047 // Break the cycle for effect phis. | |
1048 if (effect->opcode() == IrOpcode::kEffectPhi && | |
1049 virtual_states_[effect->id()] == nullptr) { | |
1050 VirtualState* state = | |
1051 new (zone()) VirtualState(effect, zone(), AliasCount()); | |
1052 virtual_states_[effect->id()] = state; | |
1053 TRACE("Effect Phi #%d got new virtual state %p.\n", effect->id(), | |
1054 static_cast<void*>(virtual_states_[effect->id()])); | |
1055 } | |
1056 DCHECK_NOT_NULL(virtual_states_[effect->id()]); | 1047 DCHECK_NOT_NULL(virtual_states_[effect->id()]); |
1057 if (virtual_states_[node->id()]) { | 1048 if (virtual_states_[node->id()]) { |
1058 virtual_states_[node->id()]->UpdateFrom(virtual_states_[effect->id()], | 1049 virtual_states_[node->id()]->UpdateFrom(virtual_states_[effect->id()], |
1059 zone()); | 1050 zone()); |
1060 } else { | 1051 } else { |
1061 virtual_states_[node->id()] = virtual_states_[effect->id()]; | 1052 virtual_states_[node->id()] = virtual_states_[effect->id()]; |
1062 TRACE("Forwarding object state %p from %s#%d to %s#%d", | 1053 TRACE("Forwarding object state %p from %s#%d to %s#%d", |
1063 static_cast<void*>(virtual_states_[effect->id()]), | 1054 static_cast<void*>(virtual_states_[effect->id()]), |
1064 effect->op()->mnemonic(), effect->id(), node->op()->mnemonic(), | 1055 effect->op()->mnemonic(), effect->id(), node->op()->mnemonic(), |
1065 node->id()); | 1056 node->id()); |
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1533 return true; | 1524 return true; |
1534 } | 1525 } |
1535 } | 1526 } |
1536 } | 1527 } |
1537 return false; | 1528 return false; |
1538 } | 1529 } |
1539 | 1530 |
1540 } // namespace compiler | 1531 } // namespace compiler |
1541 } // namespace internal | 1532 } // namespace internal |
1542 } // namespace v8 | 1533 } // namespace v8 |
OLD | NEW |