summaryrefslogtreecommitdiff
path: root/runtime/art_method.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/art_method.cc')
-rw-r--r--runtime/art_method.cc17
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) {