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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
6 | 6 |
7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
9 #include "vm/cpu.h" | 9 #include "vm/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 2142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2153 | 2153 |
2154 | 2154 |
2155 bool PolymorphicInstanceCallInstr::HasSingleRecognizedTarget() const { | 2155 bool PolymorphicInstanceCallInstr::HasSingleRecognizedTarget() const { |
2156 return ic_data().HasOneTarget() && | 2156 return ic_data().HasOneTarget() && |
2157 (MethodRecognizer::RecognizeKind( | 2157 (MethodRecognizer::RecognizeKind( |
2158 Function::Handle(ic_data().GetTargetAt(0))) != | 2158 Function::Handle(ic_data().GetTargetAt(0))) != |
2159 MethodRecognizer::kUnknown); | 2159 MethodRecognizer::kUnknown); |
2160 } | 2160 } |
2161 | 2161 |
2162 | 2162 |
| 2163 bool PolymorphicInstanceCallInstr::HasSingleDispatcherTarget() const { |
| 2164 if (!ic_data().HasOneTarget()) return false; |
| 2165 const Function& target = Function::Handle(ic_data().GetTargetAt(0)); |
| 2166 return target.IsNoSuchMethodDispatcher() || target.IsInvokeFieldDispatcher(); |
| 2167 } |
| 2168 |
| 2169 |
2163 LocationSummary* StaticCallInstr::MakeLocationSummary(bool optimizing) const { | 2170 LocationSummary* StaticCallInstr::MakeLocationSummary(bool optimizing) const { |
2164 return MakeCallSummary(); | 2171 return MakeCallSummary(); |
2165 } | 2172 } |
2166 | 2173 |
2167 | 2174 |
2168 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 2175 void StaticCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
2169 if (!compiler->is_optimizing()) { | 2176 if (!compiler->is_optimizing()) { |
2170 // Some static calls can be optimized by the optimizing compiler (e.g. sqrt) | 2177 // Some static calls can be optimized by the optimizing compiler (e.g. sqrt) |
2171 // and therefore need a deoptimization descriptor. | 2178 // and therefore need a deoptimization descriptor. |
2172 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, | 2179 compiler->AddCurrentDescriptor(PcDescriptors::kDeopt, |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3244 case Token::kTRUNCDIV: return 0; | 3251 case Token::kTRUNCDIV: return 0; |
3245 case Token::kMOD: return 1; | 3252 case Token::kMOD: return 1; |
3246 default: UNIMPLEMENTED(); return -1; | 3253 default: UNIMPLEMENTED(); return -1; |
3247 } | 3254 } |
3248 } | 3255 } |
3249 | 3256 |
3250 | 3257 |
3251 #undef __ | 3258 #undef __ |
3252 | 3259 |
3253 } // namespace dart | 3260 } // namespace dart |
OLD | NEW |