| 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 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1863 } | 1863 } |
| 1864 const String& dst_name = String::ZoneHandle( | 1864 const String& dst_name = String::ZoneHandle( |
| 1865 Symbols::New(Exceptions::kCastErrorDstName)); | 1865 Symbols::New(Exceptions::kCastErrorDstName)); |
| 1866 AssertAssignableInstr* assert_as = | 1866 AssertAssignableInstr* assert_as = |
| 1867 new AssertAssignableInstr(call->token_pos(), | 1867 new AssertAssignableInstr(call->token_pos(), |
| 1868 new Value(left), | 1868 new Value(left), |
| 1869 new Value(instantiator), | 1869 new Value(instantiator), |
| 1870 new Value(type_args), | 1870 new Value(type_args), |
| 1871 type, | 1871 type, |
| 1872 dst_name); | 1872 dst_name); |
| 1873 assert_as->deopt_id_ = call->deopt_id(); |
| 1873 ReplaceCall(call, assert_as); | 1874 ReplaceCall(call, assert_as); |
| 1874 } | 1875 } |
| 1875 | 1876 |
| 1876 | 1877 |
| 1877 // Tries to optimize instance call by replacing it with a faster instruction | 1878 // Tries to optimize instance call by replacing it with a faster instruction |
| 1878 // (e.g, binary op, field load, ..). | 1879 // (e.g, binary op, field load, ..). |
| 1879 void FlowGraphOptimizer::VisitInstanceCall(InstanceCallInstr* instr) { | 1880 void FlowGraphOptimizer::VisitInstanceCall(InstanceCallInstr* instr) { |
| 1880 if (!instr->HasICData() || (instr->ic_data()->NumberOfChecks() == 0)) { | 1881 if (!instr->HasICData() || (instr->ic_data()->NumberOfChecks() == 0)) { |
| 1881 return; | 1882 return; |
| 1882 } | 1883 } |
| (...skipping 2786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4669 if (changed) { | 4670 if (changed) { |
| 4670 // We may have changed the block order and the dominator tree. | 4671 // We may have changed the block order and the dominator tree. |
| 4671 flow_graph->DiscoverBlocks(); | 4672 flow_graph->DiscoverBlocks(); |
| 4672 GrowableArray<BitVector*> dominance_frontier; | 4673 GrowableArray<BitVector*> dominance_frontier; |
| 4673 flow_graph->ComputeDominators(&dominance_frontier); | 4674 flow_graph->ComputeDominators(&dominance_frontier); |
| 4674 } | 4675 } |
| 4675 } | 4676 } |
| 4676 | 4677 |
| 4677 | 4678 |
| 4678 } // namespace dart | 4679 } // namespace dart |
| OLD | NEW |