| 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 5028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5039 | 5039 |
| 5040 void LICM::Hoist(ForwardInstructionIterator* it, | 5040 void LICM::Hoist(ForwardInstructionIterator* it, |
| 5041 BlockEntryInstr* pre_header, | 5041 BlockEntryInstr* pre_header, |
| 5042 Instruction* current) { | 5042 Instruction* current) { |
| 5043 if (current->IsCheckClass()) { | 5043 if (current->IsCheckClass()) { |
| 5044 current->AsCheckClass()->set_licm_hoisted(true); | 5044 current->AsCheckClass()->set_licm_hoisted(true); |
| 5045 } else if (current->IsCheckSmi()) { | 5045 } else if (current->IsCheckSmi()) { |
| 5046 current->AsCheckSmi()->set_licm_hoisted(true); | 5046 current->AsCheckSmi()->set_licm_hoisted(true); |
| 5047 } else if (current->IsCheckEitherNonSmi()) { | 5047 } else if (current->IsCheckEitherNonSmi()) { |
| 5048 current->AsCheckEitherNonSmi()->set_licm_hoisted(true); | 5048 current->AsCheckEitherNonSmi()->set_licm_hoisted(true); |
| 5049 } else if (current->IsCheckArrayBound()) { |
| 5050 current->AsCheckArrayBound()->set_licm_hoisted(true); |
| 5049 } | 5051 } |
| 5050 // TODO(fschneider): Avoid repeated deoptimization when | |
| 5051 // speculatively hoisting checks. | |
| 5052 if (FLAG_trace_optimization) { | 5052 if (FLAG_trace_optimization) { |
| 5053 OS::Print("Hoisting instruction %s:%" Pd " from B%" Pd " to B%" Pd "\n", | 5053 OS::Print("Hoisting instruction %s:%" Pd " from B%" Pd " to B%" Pd "\n", |
| 5054 current->DebugName(), | 5054 current->DebugName(), |
| 5055 current->GetDeoptId(), | 5055 current->GetDeoptId(), |
| 5056 current->GetBlock()->block_id(), | 5056 current->GetBlock()->block_id(), |
| 5057 pre_header->block_id()); | 5057 pre_header->block_id()); |
| 5058 } | 5058 } |
| 5059 // Move the instruction out of the loop. | 5059 // Move the instruction out of the loop. |
| 5060 current->RemoveEnvironment(); | 5060 current->RemoveEnvironment(); |
| 5061 if (it != NULL) { | 5061 if (it != NULL) { |
| (...skipping 5045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10107 | 10107 |
| 10108 // Insert materializations at environment uses. | 10108 // Insert materializations at environment uses. |
| 10109 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 10109 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 10110 CreateMaterializationAt( | 10110 CreateMaterializationAt( |
| 10111 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); | 10111 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); |
| 10112 } | 10112 } |
| 10113 } | 10113 } |
| 10114 | 10114 |
| 10115 | 10115 |
| 10116 } // namespace dart | 10116 } // namespace dart |
| OLD | NEW |