diff options
| author | 2017-11-07 14:56:18 +0000 | |
|---|---|---|
| committer | 2017-11-07 14:56:18 +0000 | |
| commit | 3b5df92d613bb72c8e6f8a766c60835d8313414f (patch) | |
| tree | 01d2991f340fd72ae548c05bd01c4d51654f80ab /runtime/art_method.cc | |
| parent | 962d2e8d3b4f4f596392c07f2b058fc60b5d8144 (diff) | |
| parent | eb4d19bc3fde3a4736b61253bccfd4a49d8b3697 (diff) | |
Merge "ART: Remove ArtMethod::IsAnnotatedWithPolymorphicSignature"
Diffstat (limited to 'runtime/art_method.cc')
| -rw-r--r-- | runtime/art_method.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/runtime/art_method.cc b/runtime/art_method.cc index 80f5c348ee..b5e0f66575 100644 --- a/runtime/art_method.cc +++ b/runtime/art_method.cc @@ -417,6 +417,17 @@ bool ArtMethod::IsOverridableByDefaultMethod() { return GetDeclaringClass()->IsInterface(); } +bool ArtMethod::IsPolymorphicSignature() { + // Methods with a polymorphic signature have constraints that they + // are native and varargs and belong to either MethodHandle or VarHandle. + if (!IsNative() || !IsVarargs()) { + return false; + } + mirror::Class* cls = GetDeclaringClass(); + return (cls == WellKnownClasses::ToClass(WellKnownClasses::java_lang_invoke_MethodHandle) || + cls == WellKnownClasses::ToClass(WellKnownClasses::java_lang_invoke_VarHandle)); +} + bool ArtMethod::IsAnnotatedWithFastNative() { return IsAnnotatedWith(WellKnownClasses::dalvik_annotation_optimization_FastNative, DexFile::kDexVisibilityBuild, @@ -429,12 +440,6 @@ bool ArtMethod::IsAnnotatedWithCriticalNative() { /* lookup_in_resolved_boot_classes */ true); } -bool ArtMethod::IsAnnotatedWithPolymorphicSignature() { - return IsAnnotatedWith(WellKnownClasses::java_lang_invoke_MethodHandle_PolymorphicSignature, - DexFile::kDexVisibilityRuntime, - /* lookup_in_resolved_boot_classes */ true); -} - bool ArtMethod::IsAnnotatedWith(jclass klass, uint32_t visibility, bool lookup_in_resolved_boot_classes) { |