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/aot_optimizer.h" | 5 #include "vm/aot_optimizer.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/branch_optimizer.h" | 8 #include "vm/branch_optimizer.h" |
9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
(...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2016 } | 2016 } |
2017 | 2017 |
2018 | 2018 |
2019 void AotOptimizer::VisitPolymorphicInstanceCall( | 2019 void AotOptimizer::VisitPolymorphicInstanceCall( |
2020 PolymorphicInstanceCallInstr* call) { | 2020 PolymorphicInstanceCallInstr* call) { |
2021 const intptr_t receiver_cid = | 2021 const intptr_t receiver_cid = |
2022 call->PushArgumentAt(0)->value()->Type()->ToCid(); | 2022 call->PushArgumentAt(0)->value()->Type()->ToCid(); |
2023 if (receiver_cid != kDynamicCid) { | 2023 if (receiver_cid != kDynamicCid) { |
2024 const Class& receiver_class = | 2024 const Class& receiver_class = |
2025 Class::Handle(Z, isolate()->class_table()->At(receiver_cid)); | 2025 Class::Handle(Z, isolate()->class_table()->At(receiver_cid)); |
2026 const Function& function = Function::Handle( | 2026 const Function& function = Function::ZoneHandle( |
2027 Z, call->instance_call()->ResolveForReceiverClass(receiver_class)); | 2027 Z, call->instance_call()->ResolveForReceiverClass(receiver_class)); |
2028 if (!function.IsNull()) { | 2028 if (!function.IsNull()) { |
2029 // Only one target. Replace by static call. | 2029 // Only one target. Replace by static call. |
2030 StaticCallInstr* new_call = StaticCallInstr::FromCall(Z, call, function); | 2030 StaticCallInstr* new_call = StaticCallInstr::FromCall(Z, call, function); |
2031 call->ReplaceWith(new_call, current_iterator()); | 2031 call->ReplaceWith(new_call, current_iterator()); |
2032 } | 2032 } |
2033 } | 2033 } |
2034 } | 2034 } |
2035 | 2035 |
2036 | 2036 |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2198 FlowGraph::kEffect); | 2198 FlowGraph::kEffect); |
2199 current_iterator()->RemoveCurrentFromGraph(); | 2199 current_iterator()->RemoveCurrentFromGraph(); |
2200 } | 2200 } |
2201 } | 2201 } |
2202 } | 2202 } |
2203 } | 2203 } |
2204 | 2204 |
2205 #endif // DART_PRECOMPILER | 2205 #endif // DART_PRECOMPILER |
2206 | 2206 |
2207 } // namespace dart | 2207 } // namespace dart |
OLD | NEW |