| 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 5024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5035 LICM::LICM(FlowGraph* flow_graph) : flow_graph_(flow_graph) { | 5035 LICM::LICM(FlowGraph* flow_graph) : flow_graph_(flow_graph) { |
| 5036 ASSERT(flow_graph->is_licm_allowed()); | 5036 ASSERT(flow_graph->is_licm_allowed()); |
| 5037 } | 5037 } |
| 5038 | 5038 |
| 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()) { |
| 5046 current->AsCheckSmi()->set_licm_hoisted(true); |
| 5047 } else if (current->IsCheckEitherNonSmi()) { |
| 5048 current->AsCheckEitherNonSmi()->set_licm_hoisted(true); |
| 5045 } | 5049 } |
| 5046 // TODO(fschneider): Avoid repeated deoptimization when | 5050 // TODO(fschneider): Avoid repeated deoptimization when |
| 5047 // speculatively hoisting checks. | 5051 // speculatively hoisting checks. |
| 5048 if (FLAG_trace_optimization) { | 5052 if (FLAG_trace_optimization) { |
| 5049 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", |
| 5050 current->DebugName(), | 5054 current->DebugName(), |
| 5051 current->GetDeoptId(), | 5055 current->GetDeoptId(), |
| 5052 current->GetBlock()->block_id(), | 5056 current->GetBlock()->block_id(), |
| 5053 pre_header->block_id()); | 5057 pre_header->block_id()); |
| 5054 } | 5058 } |
| (...skipping 5048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10103 | 10107 |
| 10104 // Insert materializations at environment uses. | 10108 // Insert materializations at environment uses. |
| 10105 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 10109 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
| 10106 CreateMaterializationAt( | 10110 CreateMaterializationAt( |
| 10107 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); | 10111 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); |
| 10108 } | 10112 } |
| 10109 } | 10113 } |
| 10110 | 10114 |
| 10111 | 10115 |
| 10112 } // namespace dart | 10116 } // namespace dart |
| OLD | NEW |