| 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/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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 Function& target = Function::Handle(); | 518 Function& target = Function::Handle(); |
| 519 const intptr_t len = ic_data.NumberOfChecks(); | 519 const intptr_t len = ic_data.NumberOfChecks(); |
| 520 for (intptr_t i = 0; i < len; i++) { | 520 for (intptr_t i = 0; i < len; i++) { |
| 521 ic_data.GetCheckAt(i, &class_ids, &target); | 521 ic_data.GetCheckAt(i, &class_ids, &target); |
| 522 if (class_ids[arg_n] != kSmiCid) return false; | 522 if (class_ids[arg_n] != kSmiCid) return false; |
| 523 } | 523 } |
| 524 return true; | 524 return true; |
| 525 } | 525 } |
| 526 | 526 |
| 527 | 527 |
| 528 // Returns array classid to load from, array and idnex value | 528 // Returns array classid to load from, array and index value |
| 529 | 529 |
| 530 intptr_t FlowGraphOptimizer::PrepareIndexedOp(InstanceCallInstr* call, | 530 intptr_t FlowGraphOptimizer::PrepareIndexedOp(InstanceCallInstr* call, |
| 531 intptr_t class_id, | 531 intptr_t class_id, |
| 532 Value** array, | 532 Value** array, |
| 533 Value** index) { | 533 Value** index) { |
| 534 *array = call->ArgumentAt(0)->value(); | 534 *array = call->ArgumentAt(0)->value(); |
| 535 *index = call->ArgumentAt(1)->value(); | 535 *index = call->ArgumentAt(1)->value(); |
| 536 // Insert class check and index smi checks and attach a copy of the | 536 // Insert class check and index smi checks and attach a copy of the |
| 537 // original environment because the operation can still deoptimize. | 537 // original environment because the operation can still deoptimize. |
| 538 AddCheckClass(call, (*array)->Copy()); | 538 AddCheckClass(call, (*array)->Copy()); |
| (...skipping 4022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4561 | 4561 |
| 4562 if (FLAG_trace_constant_propagation) { | 4562 if (FLAG_trace_constant_propagation) { |
| 4563 OS::Print("\n==== After constant propagation ====\n"); | 4563 OS::Print("\n==== After constant propagation ====\n"); |
| 4564 FlowGraphPrinter printer(*graph_); | 4564 FlowGraphPrinter printer(*graph_); |
| 4565 printer.PrintBlocks(); | 4565 printer.PrintBlocks(); |
| 4566 } | 4566 } |
| 4567 } | 4567 } |
| 4568 | 4568 |
| 4569 | 4569 |
| 4570 } // namespace dart | 4570 } // namespace dart |
| OLD | NEW |