diff options
author | Dmitrii Ishcheikin <ishcheikin@google.com> | 2024-01-17 15:08:42 +0000 |
---|---|---|
committer | Dmitrii Ishcheikin <ishcheikin@google.com> | 2024-01-18 13:01:29 +0000 |
commit | af043ec9177fe7b181cb9d5f8cb5b86c79b454f2 (patch) | |
tree | 86059311e9a581c5e6322d70cddfe57173cb8a32 | |
parent | 2f826c5f3512a11d7d3567127fbd29bbb9c45d95 (diff) | |
download | art-af043ec9177fe7b181cb9d5f8cb5b86c79b454f2.tar.gz |
Add visibility attributes in runtime/d*
Bug: 260881207
Test: presubmit
Test: abtd app_compat_drm
Test: abtd app_compat_top_100
Test: abtd app_compat_banking
Change-Id: I0fa27c33f27c118c6d1c28321a1c5be6d76d4fe0
-rw-r--r-- | runtime/debug_print.cc | 2 | ||||
-rw-r--r-- | runtime/debug_print.h | 5 | ||||
-rw-r--r-- | runtime/debugger.cc | 2 | ||||
-rw-r--r-- | runtime/debugger.h | 24 | ||||
-rw-r--r-- | runtime/deoptimization_kind.h | 3 | ||||
-rw-r--r-- | runtime/dex/dex_file_annotations.cc | 2 | ||||
-rw-r--r-- | runtime/dex/dex_file_annotations.h | 24 | ||||
-rw-r--r-- | runtime/dex2oat_environment_test.h | 3 | ||||
-rw-r--r-- | runtime/dex_reference_collection.h | 2 | ||||
-rw-r--r-- | runtime/dex_register_location.cc | 2 | ||||
-rw-r--r-- | runtime/dex_register_location.h | 5 | ||||
-rw-r--r-- | runtime/dexopt_test.cc | 2 | ||||
-rw-r--r-- | runtime/dexopt_test.h | 3 |
13 files changed, 42 insertions, 37 deletions
diff --git a/runtime/debug_print.cc b/runtime/debug_print.cc index fd9e050a7d..ef4143a177 100644 --- a/runtime/debug_print.cc +++ b/runtime/debug_print.cc @@ -31,7 +31,7 @@ #include "thread-current-inl.h" #include "well_known_classes-inl.h" -namespace art { +namespace art HIDDEN { std::string DescribeSpace(ObjPtr<mirror::Class> klass) { std::ostringstream oss; diff --git a/runtime/debug_print.h b/runtime/debug_print.h index 7c6840284d..b4c3bba431 100644 --- a/runtime/debug_print.h +++ b/runtime/debug_print.h @@ -18,13 +18,14 @@ #define ART_RUNTIME_DEBUG_PRINT_H_ #include "base/locks.h" +#include "base/macros.h" #include "mirror/object.h" // Helper functions for printing extra information for certain hard to diagnose bugs. -namespace art { +namespace art HIDDEN { -std::string DescribeSpace(ObjPtr<mirror::Class> klass) +EXPORT std::string DescribeSpace(ObjPtr<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR; std::string DescribeLoaders(ObjPtr<mirror::ClassLoader> loader, const char* class_descriptor) REQUIRES_SHARED(Locks::mutator_lock_) COLD_ATTR; diff --git a/runtime/debugger.cc b/runtime/debugger.cc index e5535156c1..3a30cb87e4 100644 --- a/runtime/debugger.cc +++ b/runtime/debugger.cc @@ -83,7 +83,7 @@ #include "thread_pool.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/debugger.h b/runtime/debugger.h index a79add9b8e..fd261ab51a 100644 --- a/runtime/debugger.h +++ b/runtime/debugger.h @@ -27,18 +27,19 @@ #include "base/array_ref.h" #include "base/locks.h" #include "base/logging.h" +#include "base/macros.h" #include "jni.h" #include "runtime.h" #include "runtime_callbacks.h" #include "thread.h" #include "thread_state.h" -namespace art { +namespace art HIDDEN { class Dbg { public: - static void SetJdwpAllowed(bool allowed); - static bool IsJdwpAllowed(); + EXPORT static void SetJdwpAllowed(bool allowed); + EXPORT static bool IsJdwpAllowed(); // Invoked by the GC in case we need to keep DDMS informed. static void GcDidFinish() REQUIRES(!Locks::mutator_lock_); @@ -82,15 +83,14 @@ class Dbg { REQUIRES_SHARED(Locks::mutator_lock_); static void DdmSetThreadNotification(bool enable) REQUIRES(!Locks::thread_list_lock_); - static bool DdmHandleChunk( - JNIEnv* env, - uint32_t type, - const ArrayRef<const jbyte>& data, - /*out*/uint32_t* out_type, - /*out*/std::vector<uint8_t>* out_data); - - static void DdmConnected() REQUIRES_SHARED(Locks::mutator_lock_); - static void DdmDisconnected() REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT static bool DdmHandleChunk(JNIEnv* env, + uint32_t type, + const ArrayRef<const jbyte>& data, + /*out*/ uint32_t* out_type, + /*out*/ std::vector<uint8_t>* out_data); + + EXPORT static void DdmConnected() REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT static void DdmDisconnected() REQUIRES_SHARED(Locks::mutator_lock_); /* * Allocation tracking support. diff --git a/runtime/deoptimization_kind.h b/runtime/deoptimization_kind.h index 65a1cf1f2f..76a11b349c 100644 --- a/runtime/deoptimization_kind.h +++ b/runtime/deoptimization_kind.h @@ -18,8 +18,9 @@ #define ART_RUNTIME_DEOPTIMIZATION_KIND_H_ #include "base/logging.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { enum class DeoptimizationKind { kAotInlineCache = 0, diff --git a/runtime/dex/dex_file_annotations.cc b/runtime/dex/dex_file_annotations.cc index 827ced9545..76cea993b2 100644 --- a/runtime/dex/dex_file_annotations.cc +++ b/runtime/dex/dex_file_annotations.cc @@ -41,7 +41,7 @@ #include "thread.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/dex/dex_file_annotations.h b/runtime/dex/dex_file_annotations.h index cffeb25e57..3a79e11256 100644 --- a/runtime/dex/dex_file_annotations.h +++ b/runtime/dex/dex_file_annotations.h @@ -23,7 +23,7 @@ #include "mirror/object_array.h" #include "obj_ptr.h" -namespace art { +namespace art HIDDEN { namespace mirror { class ClassLoader; @@ -40,7 +40,7 @@ ObjPtr<mirror::Object> GetAnnotationForField(ArtField* field, REQUIRES_SHARED(Locks::mutator_lock_); ObjPtr<mirror::ObjectArray<mirror::Object>> GetAnnotationsForField(ArtField* field) REQUIRES_SHARED(Locks::mutator_lock_); -ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForField(ArtField* field) +EXPORT ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForField(ArtField* field) REQUIRES_SHARED(Locks::mutator_lock_); bool IsFieldAnnotationPresent(ArtField* field, Handle<mirror::Class> annotation_class) REQUIRES_SHARED(Locks::mutator_lock_); @@ -67,8 +67,8 @@ bool GetParametersMetadataForMethod( ArtMethod* method, /*out*/ MutableHandle<mirror::ObjectArray<mirror::String>>* names, /*out*/ MutableHandle<mirror::IntArray>* access_flags) REQUIRES_SHARED(Locks::mutator_lock_); -ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForMethod(ArtMethod* method) - REQUIRES_SHARED(Locks::mutator_lock_); +EXPORT ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForMethod( + ArtMethod* method) REQUIRES_SHARED(Locks::mutator_lock_); // Check whether `method` is annotated with `annotation_class`. // If `lookup_in_resolved_boot_classes` is true, look up any of the // method's annotations' classes in the bootstrap class loader's @@ -83,14 +83,14 @@ bool IsMethodAnnotationPresent(ArtMethod* method, // is annotated with @dalvik.annotation.optimization.FastNative or // @dalvik.annotation.optimization.CriticalNative with build visibility. // If yes, return the associated access flags, i.e. kAccFastNative or kAccCriticalNative. -uint32_t GetNativeMethodAnnotationAccessFlags(const DexFile& dex_file, - const dex::ClassDef& class_def, - uint32_t method_index); +EXPORT uint32_t GetNativeMethodAnnotationAccessFlags(const DexFile& dex_file, + const dex::ClassDef& class_def, + uint32_t method_index); // Is the method from the `dex_file` with the given `field_index` // annotated with @dalvik.annotation.optimization.NeverCompile? -bool MethodIsNeverCompile(const DexFile& dex_file, - const dex::ClassDef& class_def, - uint32_t method_index); +EXPORT bool MethodIsNeverCompile(const DexFile& dex_file, + const dex::ClassDef& class_def, + uint32_t method_index); // Is the method from the `dex_file` with the given `field_index` // annotated with @dalvik.annotation.optimization.NeverInline? bool MethodIsNeverInline(const DexFile& dex_file, @@ -137,9 +137,9 @@ bool GetInnerClass(Handle<mirror::Class> klass, /*out*/ ObjPtr<mirror::String>* REQUIRES_SHARED(Locks::mutator_lock_); bool GetInnerClassFlags(Handle<mirror::Class> klass, uint32_t* flags) REQUIRES_SHARED(Locks::mutator_lock_); -ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForClass( +EXPORT ObjPtr<mirror::ObjectArray<mirror::String>> GetSignatureAnnotationForClass( Handle<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_); -const char* GetSourceDebugExtension(Handle<mirror::Class> klass) +EXPORT const char* GetSourceDebugExtension(Handle<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_); ObjPtr<mirror::Class> GetNestHost(Handle<mirror::Class> klass) REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/runtime/dex2oat_environment_test.h b/runtime/dex2oat_environment_test.h index 54a007f891..202f8cf92a 100644 --- a/runtime/dex2oat_environment_test.h +++ b/runtime/dex2oat_environment_test.h @@ -23,6 +23,7 @@ #include <vector> #include "base/file_utils.h" +#include "base/macros.h" #include "base/os.h" #include "base/stl_util.h" #include "base/utils.h" @@ -38,7 +39,7 @@ #include "runtime.h" #include "ziparchive/zip_writer.h" -namespace art { +namespace art HIDDEN { static constexpr bool kDebugArgs = false; diff --git a/runtime/dex_reference_collection.h b/runtime/dex_reference_collection.h index 047771f4a5..d571cf0ce4 100644 --- a/runtime/dex_reference_collection.h +++ b/runtime/dex_reference_collection.h @@ -22,7 +22,7 @@ #include "base/macros.h" -namespace art { +namespace art HIDDEN { class DexFile; diff --git a/runtime/dex_register_location.cc b/runtime/dex_register_location.cc index f3b09733b9..a425b683d4 100644 --- a/runtime/dex_register_location.cc +++ b/runtime/dex_register_location.cc @@ -16,7 +16,7 @@ #include "dex_register_location.h" -namespace art { +namespace art HIDDEN { std::ostream& operator<<(std::ostream& stream, DexRegisterLocation::Kind kind) { return stream << "Kind<" << static_cast<int32_t>(kind) << ">"; diff --git a/runtime/dex_register_location.h b/runtime/dex_register_location.h index 98b4d41e2d..f33fd44608 100644 --- a/runtime/dex_register_location.h +++ b/runtime/dex_register_location.h @@ -21,9 +21,10 @@ #include <cstdint> #include "base/dchecked_vector.h" +#include "base/macros.h" #include "base/memory_region.h" -namespace art { +namespace art HIDDEN { // Dex register location container used by DexRegisterMap and StackMapStream. class DexRegisterLocation { @@ -85,7 +86,7 @@ class DexRegisterLocation { friend class DexRegisterMap; // Allow creation of uninitialized array of locations. }; -std::ostream& operator<<(std::ostream& stream, DexRegisterLocation::Kind kind); +EXPORT std::ostream& operator<<(std::ostream& stream, DexRegisterLocation::Kind kind); std::ostream& operator<<(std::ostream& stream, const DexRegisterLocation& reg); } // namespace art diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc index 3eee9e03e0..970590fda8 100644 --- a/runtime/dexopt_test.cc +++ b/runtime/dexopt_test.cc @@ -38,7 +38,7 @@ #include "oat_file_assistant.h" #include "profile/profile_compilation_info.h" -namespace art { +namespace art HIDDEN { void DexoptTest::SetUp() { ReserveImageSpace(); Dex2oatEnvironmentTest::SetUp(); diff --git a/runtime/dexopt_test.h b/runtime/dexopt_test.h index a2363939ea..cf32785c0b 100644 --- a/runtime/dexopt_test.h +++ b/runtime/dexopt_test.h @@ -20,9 +20,10 @@ #include <string> #include <vector> +#include "base/macros.h" #include "dex2oat_environment_test.h" -namespace art { +namespace art HIDDEN { class DexoptTest : public Dex2oatEnvironmentTest { public: |