| 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 672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 // TODO(fschneider): Add support for other array types. | 683 // TODO(fschneider): Add support for other array types. |
| 684 UNREACHABLE(); | 684 UNREACHABLE(); |
| 685 } | 685 } |
| 686 AssertAssignableInstr* assert_value = | 686 AssertAssignableInstr* assert_value = |
| 687 new AssertAssignableInstr(call->token_pos(), | 687 new AssertAssignableInstr(call->token_pos(), |
| 688 value->Copy(), | 688 value->Copy(), |
| 689 instantiator, | 689 instantiator, |
| 690 type_args, | 690 type_args, |
| 691 value_type, | 691 value_type, |
| 692 Symbols::Value()); | 692 Symbols::Value()); |
| 693 InsertBefore(call, assert_value, NULL, Definition::kValue); | 693 // Newly inserted instructions that can deoptimize or throw an exception |
| 694 // must have a deoptimization id that is valid for lookup in the unoptimized |
| 695 // code. |
| 696 assert_value->deopt_id_ = call->deopt_id(); |
| 697 InsertBefore(call, assert_value, call->env(), Definition::kValue); |
| 694 } | 698 } |
| 695 | 699 |
| 696 Value* array = NULL; | 700 Value* array = NULL; |
| 697 Value* index = NULL; | 701 Value* index = NULL; |
| 698 intptr_t array_cid = PrepareIndexedOp(call, class_id, &array, &index); | 702 intptr_t array_cid = PrepareIndexedOp(call, class_id, &array, &index); |
| 699 Value* value = call->ArgumentAt(2)->value(); | 703 Value* value = call->ArgumentAt(2)->value(); |
| 700 // Check if store barrier is needed. | 704 // Check if store barrier is needed. |
| 701 bool needs_store_barrier = true; | 705 bool needs_store_barrier = true; |
| 702 if (!value_check.IsNull()) { | 706 if (!value_check.IsNull()) { |
| 703 needs_store_barrier = false; | 707 needs_store_barrier = false; |
| (...skipping 3893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4597 | 4601 |
| 4598 if (FLAG_trace_constant_propagation) { | 4602 if (FLAG_trace_constant_propagation) { |
| 4599 OS::Print("\n==== After constant propagation ====\n"); | 4603 OS::Print("\n==== After constant propagation ====\n"); |
| 4600 FlowGraphPrinter printer(*graph_); | 4604 FlowGraphPrinter printer(*graph_); |
| 4601 printer.PrintBlocks(); | 4605 printer.PrintBlocks(); |
| 4602 } | 4606 } |
| 4603 } | 4607 } |
| 4604 | 4608 |
| 4605 | 4609 |
| 4606 } // namespace dart | 4610 } // namespace dart |
| OLD | NEW |