From 2bb2fbd2879d0a6d9ebf7acff817079dde89b417 Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Tue, 13 Nov 2018 18:24:26 +0000 Subject: Create SdkVersion enum, migrate users to it Creates a new SdkVersion enum with integer codes of known Android SDK versions, together with helper functions for common predicates. Also converts target_sdk_version_ in Runtime to uint32_t and cleans up its uses. Test: m test-art Change-Id: Idc6e518c8675068bf952d0256686c88bb0eb833e --- runtime/entrypoints/entrypoint_utils-inl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/entrypoints/entrypoint_utils-inl.h') diff --git a/runtime/entrypoints/entrypoint_utils-inl.h b/runtime/entrypoints/entrypoint_utils-inl.h index 0b005e0851..2236e61d75 100644 --- a/runtime/entrypoints/entrypoint_utils-inl.h +++ b/runtime/entrypoints/entrypoint_utils-inl.h @@ -22,6 +22,7 @@ #include "art_field-inl.h" #include "art_method-inl.h" #include "base/enums.h" +#include "base/sdk_version.h" #include "class_linker-inl.h" #include "common_throws.h" #include "dex/dex_file.h" @@ -94,8 +95,9 @@ inline ArtMethod* GetResolvedMethod(ArtMethod* outer_method, // even going back from boot image methods to the same oat file. However, this is // not currently implemented in the compiler. Therefore crossing dex file boundary // indicates that the inlined definition is not the same as the one used at runtime. - bool target_sdk_pre_p = Runtime::Current()->GetTargetSdkVersion() < 28; - LOG(target_sdk_pre_p ? WARNING : FATAL) + bool target_sdk_at_least_p = + IsSdkVersionSetAndAtLeast(Runtime::Current()->GetTargetSdkVersion(), SdkVersion::kP); + LOG(target_sdk_at_least_p ? FATAL : WARNING) << "Inlined method resolution crossed dex file boundary: from " << method->PrettyMethod() << " in " << method->GetDexFile()->GetLocation() << "/" -- cgit v1.2.3-59-g8ed1b