| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 2349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2360 | 2360 |
| 2361 | 2361 |
| 2362 void LICM::Hoist(ForwardInstructionIterator* it, | 2362 void LICM::Hoist(ForwardInstructionIterator* it, |
| 2363 BlockEntryInstr* pre_header, | 2363 BlockEntryInstr* pre_header, |
| 2364 Instruction* current) { | 2364 Instruction* current) { |
| 2365 // TODO(fschneider): Avoid repeated deoptimization when | 2365 // TODO(fschneider): Avoid repeated deoptimization when |
| 2366 // speculatively hoisting checks. | 2366 // speculatively hoisting checks. |
| 2367 if (FLAG_trace_optimization) { | 2367 if (FLAG_trace_optimization) { |
| 2368 OS::Print("Hoisting instruction %s:%"Pd" from B%"Pd" to B%"Pd"\n", | 2368 OS::Print("Hoisting instruction %s:%"Pd" from B%"Pd" to B%"Pd"\n", |
| 2369 current->DebugName(), | 2369 current->DebugName(), |
| 2370 current->deopt_id(), | 2370 current->GetDeoptId(), |
| 2371 current->GetBlock()->block_id(), | 2371 current->GetBlock()->block_id(), |
| 2372 pre_header->block_id()); | 2372 pre_header->block_id()); |
| 2373 } | 2373 } |
| 2374 // Move the instruction out of the loop. | 2374 // Move the instruction out of the loop. |
| 2375 it->RemoveCurrentFromGraph(); | 2375 it->RemoveCurrentFromGraph(); |
| 2376 GotoInstr* last = pre_header->last_instruction()->AsGoto(); | 2376 GotoInstr* last = pre_header->last_instruction()->AsGoto(); |
| 2377 current->InsertBefore(last); | 2377 current->InsertBefore(last); |
| 2378 // Attach the environment of the Goto instruction to the hoisted | 2378 // Attach the environment of the Goto instruction to the hoisted |
| 2379 // instruction and set the correct deopt_id. | 2379 // instruction and set the correct deopt_id. |
| 2380 ASSERT(last->env() != NULL); | 2380 ASSERT(last->env() != NULL); |
| (...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3474 | 3474 |
| 3475 if (FLAG_trace_constant_propagation) { | 3475 if (FLAG_trace_constant_propagation) { |
| 3476 OS::Print("\n==== After constant propagation ====\n"); | 3476 OS::Print("\n==== After constant propagation ====\n"); |
| 3477 FlowGraphPrinter printer(*graph_); | 3477 FlowGraphPrinter printer(*graph_); |
| 3478 printer.PrintBlocks(); | 3478 printer.PrintBlocks(); |
| 3479 } | 3479 } |
| 3480 } | 3480 } |
| 3481 | 3481 |
| 3482 | 3482 |
| 3483 } // namespace dart | 3483 } // namespace dart |
| OLD | NEW |