Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| (...skipping 5505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5516 current->GetDeoptId(), | 5516 current->GetDeoptId(), |
| 5517 current->GetBlock()->block_id(), | 5517 current->GetBlock()->block_id(), |
| 5518 pre_header->block_id()); | 5518 pre_header->block_id()); |
| 5519 } | 5519 } |
| 5520 // Move the instruction out of the loop. | 5520 // Move the instruction out of the loop. |
| 5521 current->RemoveEnvironment(); | 5521 current->RemoveEnvironment(); |
| 5522 it->RemoveCurrentFromGraph(); | 5522 it->RemoveCurrentFromGraph(); |
| 5523 GotoInstr* last = pre_header->last_instruction()->AsGoto(); | 5523 GotoInstr* last = pre_header->last_instruction()->AsGoto(); |
| 5524 // Using kind kEffect will not assign a fresh ssa temporary index. | 5524 // Using kind kEffect will not assign a fresh ssa temporary index. |
| 5525 flow_graph()->InsertBefore(last, current, last->env(), FlowGraph::kEffect); | 5525 flow_graph()->InsertBefore(last, current, last->env(), FlowGraph::kEffect); |
| 5526 current->deopt_id_ = last->GetDeoptId(); | 5526 if (current->CanDeoptimize()) { |
| 5527 // Do not change characteristic of a non-deoptimizing instruction. | |
| 5528 current->deopt_id_ = last->GetDeoptId(); | |
|
Vyacheslav Egorov (Google)
2014/07/25 08:38:43
Question: what if instruction can't deoptimize by
| |
| 5529 } | |
| 5527 } | 5530 } |
| 5528 | 5531 |
| 5529 | 5532 |
| 5530 void LICM::TryHoistCheckSmiThroughPhi(ForwardInstructionIterator* it, | 5533 void LICM::TryHoistCheckSmiThroughPhi(ForwardInstructionIterator* it, |
| 5531 BlockEntryInstr* header, | 5534 BlockEntryInstr* header, |
| 5532 BlockEntryInstr* pre_header, | 5535 BlockEntryInstr* pre_header, |
| 5533 CheckSmiInstr* current) { | 5536 CheckSmiInstr* current) { |
| 5534 PhiInstr* phi = current->value()->definition()->AsPhi(); | 5537 PhiInstr* phi = current->value()->definition()->AsPhi(); |
| 5535 if (!header->loop_info()->Contains(phi->block()->preorder_number())) { | 5538 if (!header->loop_info()->Contains(phi->block()->preorder_number())) { |
| 5536 return; | 5539 return; |
| (...skipping 4880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 10417 | 10420 |
| 10418 // Insert materializations at environment uses. | 10421 // Insert materializations at environment uses. |
| 10419 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 10422 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 10420 CreateMaterializationAt( | 10423 CreateMaterializationAt( |
| 10421 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); | 10424 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); |
| 10422 } | 10425 } |
| 10423 } | 10426 } |
| 10424 | 10427 |
| 10425 | 10428 |
| 10426 } // namespace dart | 10429 } // namespace dart |
| OLD | NEW |