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