| 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/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
| 9 #include "vm/compiler.h" | 9 #include "vm/compiler.h" |
| 10 #include "vm/constant_propagator.h" | 10 #include "vm/constant_propagator.h" |
| (...skipping 3170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3181 compiler->RecordAfterCall(this); | 3181 compiler->RecordAfterCall(this); |
| 3182 | 3182 |
| 3183 if (compiler->is_optimizing()) { | 3183 if (compiler->is_optimizing()) { |
| 3184 __ PopLocal(locs()->out(0).reg()); | 3184 __ PopLocal(locs()->out(0).reg()); |
| 3185 } | 3185 } |
| 3186 #endif // !defined(TARGET_ARCH_DBC) | 3186 #endif // !defined(TARGET_ARCH_DBC) |
| 3187 } | 3187 } |
| 3188 | 3188 |
| 3189 | 3189 |
| 3190 bool PolymorphicInstanceCallInstr::HasSingleRecognizedTarget() const { | 3190 bool PolymorphicInstanceCallInstr::HasSingleRecognizedTarget() const { |
| 3191 if (FLAG_precompiled_mode && with_checks()) return false; |
| 3192 |
| 3191 return ic_data().HasOneTarget() && | 3193 return ic_data().HasOneTarget() && |
| 3192 (MethodRecognizer::RecognizeKind( | 3194 (MethodRecognizer::RecognizeKind( |
| 3193 Function::Handle(ic_data().GetTargetAt(0))) != | 3195 Function::Handle(ic_data().GetTargetAt(0))) != |
| 3194 MethodRecognizer::kUnknown); | 3196 MethodRecognizer::kUnknown); |
| 3195 } | 3197 } |
| 3196 | 3198 |
| 3197 | 3199 |
| 3198 bool PolymorphicInstanceCallInstr::HasOnlyDispatcherTargets() const { | |
| 3199 for (intptr_t i = 0; i < ic_data().NumberOfChecks(); ++i) { | |
| 3200 const Function& target = Function::Handle(ic_data().GetTargetAt(i)); | |
| 3201 if (!target.IsNoSuchMethodDispatcher() && | |
| 3202 !target.IsInvokeFieldDispatcher()) { | |
| 3203 return false; | |
| 3204 } | |
| 3205 } | |
| 3206 return true; | |
| 3207 } | |
| 3208 | |
| 3209 | |
| 3210 // DBC does not support optimizing compiler and thus doesn't emit | 3200 // DBC does not support optimizing compiler and thus doesn't emit |
| 3211 // PolymorphicInstanceCallInstr. | 3201 // PolymorphicInstanceCallInstr. |
| 3212 #if !defined(TARGET_ARCH_DBC) | 3202 #if !defined(TARGET_ARCH_DBC) |
| 3213 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { | 3203 void PolymorphicInstanceCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) { |
| 3214 ASSERT(ic_data().NumArgsTested() == 1); | 3204 ASSERT(ic_data().NumArgsTested() == 1); |
| 3215 if (!with_checks()) { | 3205 if (!with_checks()) { |
| 3216 ASSERT(ic_data().HasOneTarget()); | 3206 ASSERT(ic_data().HasOneTarget()); |
| 3217 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); | 3207 const Function& target = Function::ZoneHandle(ic_data().GetTargetAt(0)); |
| 3218 compiler->GenerateStaticCall(deopt_id(), | 3208 compiler->GenerateStaticCall(deopt_id(), |
| 3219 instance_call()->token_pos(), | 3209 instance_call()->token_pos(), |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3871 set_native_c_function(native_function); | 3861 set_native_c_function(native_function); |
| 3872 function().SetIsNativeAutoSetupScope(auto_setup_scope); | 3862 function().SetIsNativeAutoSetupScope(auto_setup_scope); |
| 3873 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); | 3863 Dart_NativeEntryResolver resolver = library.native_entry_resolver(); |
| 3874 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); | 3864 bool is_bootstrap_native = Bootstrap::IsBootstapResolver(resolver); |
| 3875 set_is_bootstrap_native(is_bootstrap_native); | 3865 set_is_bootstrap_native(is_bootstrap_native); |
| 3876 } | 3866 } |
| 3877 | 3867 |
| 3878 #undef __ | 3868 #undef __ |
| 3879 | 3869 |
| 3880 } // namespace dart | 3870 } // namespace dart |
| OLD | NEW |