diff options
author | 2024-01-16 18:09:15 +0000 | |
---|---|---|
committer | 2024-01-24 15:49:35 +0000 | |
commit | ddfb9fa668c40e6fd6f4c4aa7627e9d3619d59ac (patch) | |
tree | 578ef6c6cc4fbd02fbf8dc2c63b037c6b7cd542d | |
parent | 1be176f5a78750e2f0e32470f8c83e3d1643954d (diff) |
Add visibility attributes in runtime/mirror
Bug: 260881207
Test: presubmit
Test: abtd app_compat_drm
Test: abtd app_compat_top_100
Test: abtd app_compat_banking
Change-Id: I6f5eacb96d0ead8144f090624aa99610f78fe57c
72 files changed, 131 insertions, 106 deletions
diff --git a/runtime/mirror/accessible_object.h b/runtime/mirror/accessible_object.h index 1e434a124b..84e1e88bc3 100644 --- a/runtime/mirror/accessible_object.h +++ b/runtime/mirror/accessible_object.h @@ -17,10 +17,11 @@ #ifndef ART_RUNTIME_MIRROR_ACCESSIBLE_OBJECT_H_ #define ART_RUNTIME_MIRROR_ACCESSIBLE_OBJECT_H_ +#include "base/macros.h" #include "object.h" #include "read_barrier_option.h" -namespace art { +namespace art HIDDEN { namespace mirror { diff --git a/runtime/mirror/array-alloc-inl.h b/runtime/mirror/array-alloc-inl.h index 32840d4b78..b905fd1727 100644 --- a/runtime/mirror/array-alloc-inl.h +++ b/runtime/mirror/array-alloc-inl.h @@ -30,7 +30,7 @@ #include "obj_ptr-inl.h" #include "runtime.h" -namespace art { +namespace art HIDDEN { namespace mirror { static inline size_t ComputeArraySize(int32_t component_count, size_t component_size_shift) { diff --git a/runtime/mirror/array-inl.h b/runtime/mirror/array-inl.h index 8f81ae5c1a..579b1536a3 100644 --- a/runtime/mirror/array-inl.h +++ b/runtime/mirror/array-inl.h @@ -28,7 +28,7 @@ #include "runtime.h" #include "thread-current-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline uint32_t Array::ClassSize(PointerSize pointer_size) { diff --git a/runtime/mirror/array.cc b/runtime/mirror/array.cc index 7b61b86416..a4f6c88e4c 100644 --- a/runtime/mirror/array.cc +++ b/runtime/mirror/array.cc @@ -31,7 +31,7 @@ #include "object_array-inl.h" #include "thread.h" -namespace art { +namespace art HIDDEN { namespace mirror { using android::base::StringPrintf; diff --git a/runtime/mirror/array.h b/runtime/mirror/array.h index e7cfb92bdc..b8724cca70 100644 --- a/runtime/mirror/array.h +++ b/runtime/mirror/array.h @@ -19,10 +19,11 @@ #include "base/bit_utils.h" #include "base/enums.h" +#include "base/macros.h" #include "obj_ptr.h" #include "object.h" -namespace art { +namespace art HIDDEN { namespace gc { enum AllocatorType : char; @@ -127,15 +128,15 @@ class MANAGED Array : public Object { template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags> ALWAYS_INLINE bool CheckIsValidIndex(int32_t index) REQUIRES_SHARED(Locks::mutator_lock_); - static ObjPtr<Array> CopyOf(Handle<Array> h_this, Thread* self, int32_t new_length) + EXPORT static ObjPtr<Array> CopyOf(Handle<Array> h_this, Thread* self, int32_t new_length) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); protected: - void ThrowArrayStoreException(ObjPtr<Object> object) REQUIRES_SHARED(Locks::mutator_lock_) + EXPORT void ThrowArrayStoreException(ObjPtr<Object> object) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); private: - void ThrowArrayIndexOutOfBoundsException(int32_t index) + EXPORT void ThrowArrayIndexOutOfBoundsException(int32_t index) REQUIRES_SHARED(Locks::mutator_lock_); // The number of array elements. @@ -162,13 +163,14 @@ class MANAGED PrimitiveArray : public Array { using ElementType = T; - static ObjPtr<PrimitiveArray<T>> Alloc(Thread* self, size_t length) + EXPORT static ObjPtr<PrimitiveArray<T>> Alloc(Thread* self, size_t length) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); - static ObjPtr<PrimitiveArray<T>> AllocateAndFill(Thread* self, const T* data, size_t length) + EXPORT static ObjPtr<PrimitiveArray<T>> AllocateAndFill(Thread* self, + const T* data, + size_t length) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); - const T* GetData() const ALWAYS_INLINE REQUIRES_SHARED(Locks::mutator_lock_) { return reinterpret_cast<const T*>(GetRawData<sizeof(T)>(0)); } @@ -211,7 +213,7 @@ class MANAGED PrimitiveArray : public Array { * smaller than element size copies). Arguments are assumed to be within the bounds of the array * and the arrays non-null. */ - void Memcpy(int32_t dst_pos, ObjPtr<PrimitiveArray<T>> src, int32_t src_pos, int32_t count) + EXPORT void Memcpy(int32_t dst_pos, ObjPtr<PrimitiveArray<T>> src, int32_t src_pos, int32_t count) REQUIRES_SHARED(Locks::mutator_lock_); private: diff --git a/runtime/mirror/call_site-inl.h b/runtime/mirror/call_site-inl.h index dbbd4d1a41..d38d47b222 100644 --- a/runtime/mirror/call_site-inl.h +++ b/runtime/mirror/call_site-inl.h @@ -21,7 +21,7 @@ #include "object-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline ObjPtr<MethodHandle> CallSite::GetTarget() { diff --git a/runtime/mirror/call_site.h b/runtime/mirror/call_site.h index 88387a3e83..1ec766c866 100644 --- a/runtime/mirror/call_site.h +++ b/runtime/mirror/call_site.h @@ -17,10 +17,11 @@ #ifndef ART_RUNTIME_MIRROR_CALL_SITE_H_ #define ART_RUNTIME_MIRROR_CALL_SITE_H_ +#include "base/macros.h" #include "mirror/method_handle_impl.h" #include "obj_ptr.h" -namespace art { +namespace art HIDDEN { struct CallSiteOffsets; diff --git a/runtime/mirror/class-alloc-inl.h b/runtime/mirror/class-alloc-inl.h index ed3967b798..d1dd5db448 100644 --- a/runtime/mirror/class-alloc-inl.h +++ b/runtime/mirror/class-alloc-inl.h @@ -24,7 +24,7 @@ #include "object-inl.h" #include "runtime.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline void Class::CheckObjectAlloc() { diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h index e2fd82f83a..9c58ff6e7a 100644 --- a/runtime/mirror/class-inl.h +++ b/runtime/mirror/class-inl.h @@ -42,7 +42,7 @@ #include "subtype_check.h" #include "thread-current-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { template<VerifyObjectFlags kVerifyFlags> diff --git a/runtime/mirror/class-refvisitor-inl.h b/runtime/mirror/class-refvisitor-inl.h index ee5c11f99f..21ed1cd636 100644 --- a/runtime/mirror/class-refvisitor-inl.h +++ b/runtime/mirror/class-refvisitor-inl.h @@ -22,7 +22,7 @@ #include "art_field-inl.h" #include "class_ext-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { template <bool kVisitNativeRoots, diff --git a/runtime/mirror/class.cc b/runtime/mirror/class.cc index 296eeed58a..6e472c5485 100644 --- a/runtime/mirror/class.cc +++ b/runtime/mirror/class.cc @@ -58,7 +58,7 @@ #include "throwable.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { namespace mirror { diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index 9f74066bc9..15f0fd306f 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -30,7 +30,7 @@ #include "object_array.h" #include "read_barrier_option.h" -namespace art { +namespace art HIDDEN { namespace dex { struct ClassDef; @@ -82,7 +82,7 @@ using StringDexCachePair = DexCachePair<String>; using StringDexCacheType = std::atomic<StringDexCachePair>; // C++ mirror of java.lang.Class -class MANAGED Class final : public Object { +class EXPORT MANAGED Class final : public Object { public: MIRROR_CLASS("Ljava/lang/Class;"); diff --git a/runtime/mirror/class_ext-inl.h b/runtime/mirror/class_ext-inl.h index 6a62f78f9a..1fba26cd65 100644 --- a/runtime/mirror/class_ext-inl.h +++ b/runtime/mirror/class_ext-inl.h @@ -32,7 +32,7 @@ #include "object-inl.h" #include "verify_object.h" -namespace art { +namespace art HIDDEN { namespace mirror { template <VerifyObjectFlags kVerifyFlags, ReadBarrierOption kReadBarrierOption> diff --git a/runtime/mirror/class_ext.cc b/runtime/mirror/class_ext.cc index 097e0de2fc..4d915f71bb 100644 --- a/runtime/mirror/class_ext.cc +++ b/runtime/mirror/class_ext.cc @@ -33,7 +33,7 @@ #include "stack_trace_element.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { namespace mirror { uint32_t ClassExt::ClassSize(PointerSize pointer_size) { diff --git a/runtime/mirror/class_ext.h b/runtime/mirror/class_ext.h index b025eb21af..302e172458 100644 --- a/runtime/mirror/class_ext.h +++ b/runtime/mirror/class_ext.h @@ -18,13 +18,14 @@ #define ART_RUNTIME_MIRROR_CLASS_EXT_H_ #include "array.h" +#include "base/macros.h" #include "class.h" #include "dex_cache.h" #include "object.h" #include "object_array.h" #include "string.h" -namespace art { +namespace art HIDDEN { struct ClassExtOffsets; class DexCacheVisitor; @@ -104,29 +105,31 @@ class MANAGED ClassExt : public Object { // Used to manually initialize the ext-ids arrays for the ClassExt associated // with the Class<ClassExt>. This simplifies the id allocation path. - void SetIdsArraysForClassExtExtData(ObjPtr<Object> marker) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT void SetIdsArraysForClassExtExtData(ObjPtr<Object> marker) + REQUIRES_SHARED(Locks::mutator_lock_); - void SetOriginalDexFile(ObjPtr<Object> bytes) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT void SetOriginalDexFile(ObjPtr<Object> bytes) REQUIRES_SHARED(Locks::mutator_lock_); uint16_t GetPreRedefineClassDefIndex() REQUIRES_SHARED(Locks::mutator_lock_) { return static_cast<uint16_t>( GetField32(OFFSET_OF_OBJECT_MEMBER(ClassExt, pre_redefine_class_def_index_))); } - void SetPreRedefineClassDefIndex(uint16_t index) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT void SetPreRedefineClassDefIndex(uint16_t index) REQUIRES_SHARED(Locks::mutator_lock_); const DexFile* GetPreRedefineDexFile() REQUIRES_SHARED(Locks::mutator_lock_) { return reinterpret_cast<const DexFile*>(static_cast<uintptr_t>( GetField64(OFFSET_OF_OBJECT_MEMBER(ClassExt, pre_redefine_dex_file_ptr_)))); } - void SetPreRedefineDexFile(const DexFile* dex_file) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT void SetPreRedefineDexFile(const DexFile* dex_file) REQUIRES_SHARED(Locks::mutator_lock_); - void SetObsoleteArrays(ObjPtr<PointerArray> methods, ObjPtr<ObjectArray<DexCache>> dex_caches) + EXPORT void SetObsoleteArrays(ObjPtr<PointerArray> methods, + ObjPtr<ObjectArray<DexCache>> dex_caches) REQUIRES_SHARED(Locks::mutator_lock_); // Extend the obsolete arrays by the given amount. - static bool ExtendObsoleteArrays(Handle<ClassExt> h_this, Thread* self, uint32_t increase) + EXPORT static bool ExtendObsoleteArrays(Handle<ClassExt> h_this, Thread* self, uint32_t increase) REQUIRES_SHARED(Locks::mutator_lock_); template<ReadBarrierOption kReadBarrierOption = kWithReadBarrier, @@ -156,7 +159,7 @@ class MANAGED ClassExt : public Object { template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags, ReadBarrierOption kReadBarrierOption = kWithReadBarrier> ObjPtr<Class> GetObsoleteClass() REQUIRES_SHARED(Locks::mutator_lock_); - void SetObsoleteClass(ObjPtr<Class> classes) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT void SetObsoleteClass(ObjPtr<Class> classes) REQUIRES_SHARED(Locks::mutator_lock_); template<ReadBarrierOption kReadBarrierOption = kWithReadBarrier, typename Visitor> inline void VisitJFieldIDs(Visitor v) REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/runtime/mirror/class_flags.h b/runtime/mirror/class_flags.h index c85b9e0eee..26a87c9546 100644 --- a/runtime/mirror/class_flags.h +++ b/runtime/mirror/class_flags.h @@ -19,7 +19,9 @@ #include <stdint.h> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { namespace mirror { // Normal instance with at least one ref field other than the class. diff --git a/runtime/mirror/class_loader-inl.h b/runtime/mirror/class_loader-inl.h index 1c98e0aa68..00dfdc7135 100644 --- a/runtime/mirror/class_loader-inl.h +++ b/runtime/mirror/class_loader-inl.h @@ -22,7 +22,7 @@ #include "class_table-inl.h" #include "object-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline ObjPtr<ClassLoader> ClassLoader::GetParent() { diff --git a/runtime/mirror/class_loader.h b/runtime/mirror/class_loader.h index 62b258cb13..0e925f4598 100644 --- a/runtime/mirror/class_loader.h +++ b/runtime/mirror/class_loader.h @@ -18,12 +18,13 @@ #define ART_RUNTIME_MIRROR_CLASS_LOADER_H_ #include "base/locks.h" +#include "base/macros.h" #include "obj_ptr.h" #include "object.h" #include "object_reference.h" #include "string.h" -namespace art { +namespace art HIDDEN { struct ClassLoaderOffsets; class ClassTable; diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h index dbc091d2af..48a41e6b6a 100644 --- a/runtime/mirror/dex_cache-inl.h +++ b/runtime/mirror/dex_cache-inl.h @@ -40,7 +40,7 @@ #include <atomic> -namespace art { +namespace art HIDDEN { namespace mirror { template<typename DexCachePair> diff --git a/runtime/mirror/dex_cache.cc b/runtime/mirror/dex_cache.cc index 3b887668a3..b981f08d97 100644 --- a/runtime/mirror/dex_cache.cc +++ b/runtime/mirror/dex_cache.cc @@ -33,7 +33,7 @@ #include "thread.h" #include "write_barrier.h" -namespace art { +namespace art HIDDEN { namespace mirror { // Whether to allocate full dex cache arrays during startup. Currently disabled diff --git a/runtime/mirror/dex_cache.h b/runtime/mirror/dex_cache.h index 2b5aa8e911..921d8028e7 100644 --- a/runtime/mirror/dex_cache.h +++ b/runtime/mirror/dex_cache.h @@ -22,6 +22,7 @@ #include "base/atomic_pair.h" #include "base/bit_utils.h" #include "base/locks.h" +#include "base/macros.h" #include "dex/dex_file.h" #include "dex/dex_file_types.h" #include "gc_root.h" // Note: must not use -inl here to avoid circular dependency. @@ -29,7 +30,7 @@ #include "object.h" #include "object_array.h" -namespace art { +namespace art HIDDEN { namespace linker { class ImageWriter; @@ -300,13 +301,12 @@ class MANAGED DexCache final : public Object { DexCachePair<Object>* pairs_end) REQUIRES_SHARED(Locks::mutator_lock_); - void Initialize(const DexFile* dex_file, ObjPtr<ClassLoader> class_loader) - REQUIRES_SHARED(Locks::mutator_lock_) - REQUIRES(Locks::dex_lock_); + EXPORT void Initialize(const DexFile* dex_file, ObjPtr<ClassLoader> class_loader) + REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(Locks::dex_lock_); // Zero all array references. // WARNING: This does not free the memory since it is in LinearAlloc. - void ResetNativeArrays() REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT void ResetNativeArrays() REQUIRES_SHARED(Locks::mutator_lock_); template<VerifyObjectFlags kVerifyFlags = kDefaultVerifyFlags, ReadBarrierOption kReadBarrierOption = kWithReadBarrier> @@ -368,7 +368,7 @@ class MANAGED DexCache final : public Object { SetFieldPtr<false>(OFFSET_OF_OBJECT_MEMBER(DexCache, dex_file_), dex_file); } - void SetLocation(ObjPtr<String> location) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT void SetLocation(ObjPtr<String> location) REQUIRES_SHARED(Locks::mutator_lock_); void VisitReflectiveTargets(ReflectiveValueVisitor* visitor) REQUIRES(Locks::mutator_lock_); diff --git a/runtime/mirror/dex_cache_test.cc b/runtime/mirror/dex_cache_test.cc index bc521f5604..9ca8d307ba 100644 --- a/runtime/mirror/dex_cache_test.cc +++ b/runtime/mirror/dex_cache_test.cc @@ -27,7 +27,7 @@ #include "mirror/dex_cache-inl.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { class DexCacheTest : public CommonRuntimeTest { diff --git a/runtime/mirror/emulated_stack_frame-inl.h b/runtime/mirror/emulated_stack_frame-inl.h index 8dc4c709ae..58c1064a88 100644 --- a/runtime/mirror/emulated_stack_frame-inl.h +++ b/runtime/mirror/emulated_stack_frame-inl.h @@ -23,7 +23,7 @@ #include "object-inl.h" #include "object_array-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline ObjPtr<mirror::MethodType> EmulatedStackFrame::GetType() { diff --git a/runtime/mirror/emulated_stack_frame.cc b/runtime/mirror/emulated_stack_frame.cc index 4bae657cfd..a4fde7237b 100644 --- a/runtime/mirror/emulated_stack_frame.cc +++ b/runtime/mirror/emulated_stack_frame.cc @@ -29,7 +29,7 @@ #include "object_array-inl.h" #include "reflection-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { // Calculates the size of a stack frame based on the size of its argument diff --git a/runtime/mirror/emulated_stack_frame.h b/runtime/mirror/emulated_stack_frame.h index 590f653506..93c543c77a 100644 --- a/runtime/mirror/emulated_stack_frame.h +++ b/runtime/mirror/emulated_stack_frame.h @@ -18,12 +18,13 @@ #define ART_RUNTIME_MIRROR_EMULATED_STACK_FRAME_H_ #include "base/utils.h" +#include "base/macros.h" #include "dex/dex_instruction.h" #include "handle.h" #include "object.h" #include "stack.h" -namespace art { +namespace art HIDDEN { struct EmulatedStackFrameOffsets; diff --git a/runtime/mirror/executable-inl.h b/runtime/mirror/executable-inl.h index 77669dace8..fa4fa64a79 100644 --- a/runtime/mirror/executable-inl.h +++ b/runtime/mirror/executable-inl.h @@ -23,7 +23,7 @@ #include "reflective_value_visitor.h" #include "verify_object.h" -namespace art { +namespace art HIDDEN { namespace mirror { template <bool kTransactionActive, diff --git a/runtime/mirror/executable.cc b/runtime/mirror/executable.cc index 3996f49e1a..96b633a31a 100644 --- a/runtime/mirror/executable.cc +++ b/runtime/mirror/executable.cc @@ -19,7 +19,7 @@ #include "art_method-inl.h" #include "object-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { template <PointerSize kPointerSize> diff --git a/runtime/mirror/executable.h b/runtime/mirror/executable.h index 079efc3320..241fea34df 100644 --- a/runtime/mirror/executable.h +++ b/runtime/mirror/executable.h @@ -18,10 +18,11 @@ #define ART_RUNTIME_MIRROR_EXECUTABLE_H_ #include "accessible_object.h" +#include "base/macros.h" #include "object.h" #include "read_barrier_option.h" -namespace art { +namespace art HIDDEN { struct ExecutableOffsets; class ArtMethod; diff --git a/runtime/mirror/field-inl.h b/runtime/mirror/field-inl.h index f1f8b259f1..d47e8c66c7 100644 --- a/runtime/mirror/field-inl.h +++ b/runtime/mirror/field-inl.h @@ -24,7 +24,7 @@ #include "class_root-inl.h" #include "object-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { diff --git a/runtime/mirror/field.cc b/runtime/mirror/field.cc index 7faa55c469..5ad59fadf4 100644 --- a/runtime/mirror/field.cc +++ b/runtime/mirror/field.cc @@ -22,7 +22,7 @@ #include "object_array-inl.h" #include "write_barrier.h" -namespace art { +namespace art HIDDEN { namespace mirror { void Field::VisitTarget(ReflectiveValueVisitor* v) { diff --git a/runtime/mirror/field.h b/runtime/mirror/field.h index bbae8cea9d..dc5e911a9d 100644 --- a/runtime/mirror/field.h +++ b/runtime/mirror/field.h @@ -19,13 +19,14 @@ #include "accessible_object.h" #include "base/enums.h" +#include "base/macros.h" #include "dex/modifiers.h" #include "dex/primitive.h" #include "obj_ptr.h" #include "object.h" #include "read_barrier_option.h" -namespace art { +namespace art HIDDEN { class ArtField; struct FieldOffsets; diff --git a/runtime/mirror/iftable-inl.h b/runtime/mirror/iftable-inl.h index ce9d3f8515..631f74fcd5 100644 --- a/runtime/mirror/iftable-inl.h +++ b/runtime/mirror/iftable-inl.h @@ -21,7 +21,7 @@ #include "obj_ptr-inl.h" #include "object_array-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { template<VerifyObjectFlags kVerifyFlags, diff --git a/runtime/mirror/iftable.h b/runtime/mirror/iftable.h index 30fed566aa..09fdea8df2 100644 --- a/runtime/mirror/iftable.h +++ b/runtime/mirror/iftable.h @@ -18,9 +18,10 @@ #define ART_RUNTIME_MIRROR_IFTABLE_H_ #include "base/casts.h" +#include "base/macros.h" #include "object_array.h" -namespace art { +namespace art HIDDEN { namespace mirror { class MANAGED IfTable final : public ObjectArray<Object> { diff --git a/runtime/mirror/method.cc b/runtime/mirror/method.cc index f83f03c296..2511941175 100644 --- a/runtime/mirror/method.cc +++ b/runtime/mirror/method.cc @@ -22,7 +22,7 @@ #include "mirror/object-inl.h" #include "obj_ptr-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { template <PointerSize kPointerSize> diff --git a/runtime/mirror/method.h b/runtime/mirror/method.h index 4b8dcffdf9..e72ffc9fd3 100644 --- a/runtime/mirror/method.h +++ b/runtime/mirror/method.h @@ -17,9 +17,10 @@ #ifndef ART_RUNTIME_MIRROR_METHOD_H_ #define ART_RUNTIME_MIRROR_METHOD_H_ +#include "base/macros.h" #include "executable.h" -namespace art { +namespace art HIDDEN { template<class MirrorType> class ObjPtr; diff --git a/runtime/mirror/method_handle_impl-inl.h b/runtime/mirror/method_handle_impl-inl.h index 8c5e4799b9..54ce8bdbcd 100644 --- a/runtime/mirror/method_handle_impl-inl.h +++ b/runtime/mirror/method_handle_impl-inl.h @@ -22,7 +22,7 @@ #include "art_method-inl.h" #include "object-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline MethodHandle::Kind MethodHandle::GetHandleKind() REQUIRES_SHARED(Locks::mutator_lock_) { diff --git a/runtime/mirror/method_handle_impl.cc b/runtime/mirror/method_handle_impl.cc index 79ed2b0be3..0a37f95af8 100644 --- a/runtime/mirror/method_handle_impl.cc +++ b/runtime/mirror/method_handle_impl.cc @@ -19,7 +19,7 @@ #include "class-alloc-inl.h" #include "class_root-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { const char* MethodHandle::GetReturnTypeDescriptor(const char* invoke_method_name) { diff --git a/runtime/mirror/method_handle_impl.h b/runtime/mirror/method_handle_impl.h index ef354a9d0a..ba1763afe3 100644 --- a/runtime/mirror/method_handle_impl.h +++ b/runtime/mirror/method_handle_impl.h @@ -19,12 +19,13 @@ #include "art_field.h" #include "art_method.h" +#include "base/macros.h" #include "class.h" #include "method_type.h" #include "obj_ptr.h" #include "object.h" -namespace art { +namespace art HIDDEN { struct MethodHandleOffsets; struct MethodHandleImplOffsets; @@ -117,10 +118,10 @@ class MANAGED MethodHandleImpl : public MethodHandle { public: MIRROR_CLASS("Ljava/lang/invoke/MethodHandleImpl;"); - static ObjPtr<mirror::MethodHandleImpl> Create(Thread* const self, - uintptr_t art_field_or_method, - MethodHandle::Kind kind, - Handle<MethodType> method_type) + EXPORT static ObjPtr<mirror::MethodHandleImpl> Create(Thread* const self, + uintptr_t art_field_or_method, + MethodHandle::Kind kind, + Handle<MethodType> method_type) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); private: diff --git a/runtime/mirror/method_handles_lookup.cc b/runtime/mirror/method_handles_lookup.cc index 62c35df5d9..702588c8a4 100644 --- a/runtime/mirror/method_handles_lookup.cc +++ b/runtime/mirror/method_handles_lookup.cc @@ -25,7 +25,7 @@ #include "object-inl.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { namespace mirror { ObjPtr<MethodHandlesLookup> MethodHandlesLookup::Create(Thread* const self, diff --git a/runtime/mirror/method_handles_lookup.h b/runtime/mirror/method_handles_lookup.h index 3ed150a817..9ee9dbeed9 100644 --- a/runtime/mirror/method_handles_lookup.h +++ b/runtime/mirror/method_handles_lookup.h @@ -18,11 +18,12 @@ #define ART_RUNTIME_MIRROR_METHOD_HANDLES_LOOKUP_H_ #include "base/utils.h" +#include "base/macros.h" #include "handle.h" #include "obj_ptr.h" #include "object.h" -namespace art { +namespace art HIDDEN { struct MethodHandlesLookupOffsets; class RootVisitor; diff --git a/runtime/mirror/method_type-inl.h b/runtime/mirror/method_type-inl.h index fca87fe944..d7b86472ef 100644 --- a/runtime/mirror/method_type-inl.h +++ b/runtime/mirror/method_type-inl.h @@ -23,7 +23,7 @@ #include "handle_scope-inl.h" #include "mirror/object-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline RawMethodType::RawMethodType(VariableSizedHandleScope* hs) diff --git a/runtime/mirror/method_type.cc b/runtime/mirror/method_type.cc index bd4b1db14e..a3785c1a74 100644 --- a/runtime/mirror/method_type.cc +++ b/runtime/mirror/method_type.cc @@ -25,7 +25,7 @@ #include "object_array-inl.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { namespace mirror { namespace { diff --git a/runtime/mirror/method_type.h b/runtime/mirror/method_type.h index bbb4a47f19..1efc0c5259 100644 --- a/runtime/mirror/method_type.h +++ b/runtime/mirror/method_type.h @@ -17,11 +17,12 @@ #ifndef ART_RUNTIME_MIRROR_METHOD_TYPE_H_ #define ART_RUNTIME_MIRROR_METHOD_TYPE_H_ +#include "base/macros.h" #include "object_array.h" #include "object.h" #include "string.h" -namespace art { +namespace art HIDDEN { struct MethodTypeOffsets; class VariableSizedHandleScope; @@ -54,9 +55,9 @@ class MANAGED MethodType : public Object { public: MIRROR_CLASS("Ljava/lang/invoke/MethodType;"); - static ObjPtr<MethodType> Create(Thread* self, - Handle<Class> return_type, - Handle<ObjectArray<Class>> param_types) + EXPORT static ObjPtr<MethodType> Create(Thread* self, + Handle<Class> return_type, + Handle<ObjectArray<Class>> param_types) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); // Create a `MethodType` from a `RawMethodType`. diff --git a/runtime/mirror/method_type_test.cc b/runtime/mirror/method_type_test.cc index c9d7e91a47..9d23f8f23d 100644 --- a/runtime/mirror/method_type_test.cc +++ b/runtime/mirror/method_type_test.cc @@ -29,7 +29,7 @@ #include "object_array-inl.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { class MethodTypeTest : public CommonRuntimeTest {}; diff --git a/runtime/mirror/object-inl.h b/runtime/mirror/object-inl.h index 318a811fa1..60b8a0512e 100644 --- a/runtime/mirror/object-inl.h +++ b/runtime/mirror/object-inl.h @@ -41,7 +41,7 @@ #include "throwable.h" #include "write_barrier-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline uint32_t Object::ClassSize(PointerSize pointer_size) { diff --git a/runtime/mirror/object-readbarrier-inl.h b/runtime/mirror/object-readbarrier-inl.h index 2895009d17..15179b93ff 100644 --- a/runtime/mirror/object-readbarrier-inl.h +++ b/runtime/mirror/object-readbarrier-inl.h @@ -26,7 +26,7 @@ #include "read_barrier.h" #include "runtime.h" -namespace art { +namespace art HIDDEN { namespace mirror { template<VerifyObjectFlags kVerifyFlags> diff --git a/runtime/mirror/object-refvisitor-inl.h b/runtime/mirror/object-refvisitor-inl.h index de60c8e1e7..fa2fbaec27 100644 --- a/runtime/mirror/object-refvisitor-inl.h +++ b/runtime/mirror/object-refvisitor-inl.h @@ -23,7 +23,7 @@ #include "class_loader-inl.h" #include "dex_cache-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { template <VerifyObjectFlags kVerifyFlags, diff --git a/runtime/mirror/object.cc b/runtime/mirror/object.cc index 995f06e14e..b28978603c 100644 --- a/runtime/mirror/object.cc +++ b/runtime/mirror/object.cc @@ -38,7 +38,7 @@ #include "throwable.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { namespace mirror { Atomic<uint32_t> Object::hash_code_seed(987654321U + std::time(nullptr)); diff --git a/runtime/mirror/object.h b/runtime/mirror/object.h index ecd8a48a96..f0b6a03eac 100644 --- a/runtime/mirror/object.h +++ b/runtime/mirror/object.h @@ -20,6 +20,7 @@ #include "base/atomic.h" #include "base/casts.h" #include "base/enums.h" +#include "base/macros.h" #include "dex/primitive.h" #include "obj_ptr.h" #include "object_reference.h" @@ -29,7 +30,7 @@ #include "runtime_globals.h" #include "verify_object.h" -namespace art { +namespace art HIDDEN { class ArtField; class ArtMethod; @@ -74,7 +75,7 @@ static constexpr bool kCheckFieldAssignments = false; static constexpr uint32_t kObjectHeaderSize = 8; // C++ mirror of java.lang.Object -class MANAGED LOCKABLE Object { +class EXPORT MANAGED LOCKABLE Object { public: MIRROR_CLASS("Ljava/lang/Object;"); diff --git a/runtime/mirror/object_array-alloc-inl.h b/runtime/mirror/object_array-alloc-inl.h index 594b0a6346..e79d154f84 100644 --- a/runtime/mirror/object_array-alloc-inl.h +++ b/runtime/mirror/object_array-alloc-inl.h @@ -29,7 +29,7 @@ #include "object-inl.h" #include "runtime.h" -namespace art { +namespace art HIDDEN { namespace mirror { template<class T> diff --git a/runtime/mirror/object_array-inl.h b/runtime/mirror/object_array-inl.h index 87f24eb230..b0ca6c2032 100644 --- a/runtime/mirror/object_array-inl.h +++ b/runtime/mirror/object_array-inl.h @@ -33,7 +33,7 @@ #include "thread-current-inl.h" #include "write_barrier-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { template<class T> template<VerifyObjectFlags kVerifyFlags, ReadBarrierOption kReadBarrierOption> diff --git a/runtime/mirror/object_array.h b/runtime/mirror/object_array.h index c6b1e01793..de12e65536 100644 --- a/runtime/mirror/object_array.h +++ b/runtime/mirror/object_array.h @@ -20,9 +20,10 @@ #include <iterator> #include "array.h" #include "base/iteration_range.h" +#include "base/macros.h" #include "obj_ptr.h" -namespace art { +namespace art HIDDEN { namespace mirror { template<typename T, typename Container> class ArrayIter; diff --git a/runtime/mirror/object_reference-inl.h b/runtime/mirror/object_reference-inl.h index 183a5af201..8f793b442a 100644 --- a/runtime/mirror/object_reference-inl.h +++ b/runtime/mirror/object_reference-inl.h @@ -21,7 +21,7 @@ #include "obj_ptr-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { template<bool kPoisonReferences, class MirrorType> diff --git a/runtime/mirror/object_reference.h b/runtime/mirror/object_reference.h index 251bcfd89a..177b96885e 100644 --- a/runtime/mirror/object_reference.h +++ b/runtime/mirror/object_reference.h @@ -23,11 +23,12 @@ #include "base/atomic.h" #include "base/casts.h" #include "base/locks.h" // For Locks::mutator_lock_. +#include "base/macros.h" #include "heap_poisoning.h" #include "obj_ptr.h" #include "runtime_globals.h" -namespace art { +namespace art HIDDEN { namespace mirror { class Object; diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc index 6f42c5b8b8..88b99241ad 100644 --- a/runtime/mirror/object_test.cc +++ b/runtime/mirror/object_test.cc @@ -45,7 +45,7 @@ #include "scoped_thread_state_change-inl.h" #include "string-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { class ObjectTest : public CommonRuntimeTest { diff --git a/runtime/mirror/proxy.h b/runtime/mirror/proxy.h index 3291669021..996c218ecf 100644 --- a/runtime/mirror/proxy.h +++ b/runtime/mirror/proxy.h @@ -17,9 +17,10 @@ #ifndef ART_RUNTIME_MIRROR_PROXY_H_ #define ART_RUNTIME_MIRROR_PROXY_H_ +#include "base/macros.h" #include "object.h" -namespace art { +namespace art HIDDEN { struct ProxyOffsets; diff --git a/runtime/mirror/reference-inl.h b/runtime/mirror/reference-inl.h index f8de6e6d90..c8a0957a0a 100644 --- a/runtime/mirror/reference-inl.h +++ b/runtime/mirror/reference-inl.h @@ -22,7 +22,7 @@ #include "obj_ptr-inl.h" #include "runtime.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline uint32_t Reference::ClassSize(PointerSize pointer_size) { diff --git a/runtime/mirror/reference.h b/runtime/mirror/reference.h index ef6d2734a1..9df0fb36d6 100644 --- a/runtime/mirror/reference.h +++ b/runtime/mirror/reference.h @@ -24,7 +24,7 @@ #include "object.h" #include "read_barrier_option.h" -namespace art { +namespace art HIDDEN { namespace gc { diff --git a/runtime/mirror/stack_frame_info.cc b/runtime/mirror/stack_frame_info.cc index dd3e8f7010..f15783a12e 100644 --- a/runtime/mirror/stack_frame_info.cc +++ b/runtime/mirror/stack_frame_info.cc @@ -24,7 +24,7 @@ #include "object-inl.h" #include "string.h" -namespace art { +namespace art HIDDEN { namespace mirror { void StackFrameInfo::AssignFields(Handle<Class> declaring_class, diff --git a/runtime/mirror/stack_frame_info.h b/runtime/mirror/stack_frame_info.h index 07f87c5c83..b9b1519969 100644 --- a/runtime/mirror/stack_frame_info.h +++ b/runtime/mirror/stack_frame_info.h @@ -17,11 +17,12 @@ #ifndef ART_RUNTIME_MIRROR_STACK_FRAME_INFO_H_ #define ART_RUNTIME_MIRROR_STACK_FRAME_INFO_H_ +#include "base/macros.h" #include "method_type.h" #include "object.h" #include "stack_trace_element.h" -namespace art { +namespace art HIDDEN { template<class T> class Handle; struct StackFrameInfoOffsets; diff --git a/runtime/mirror/stack_trace_element-inl.h b/runtime/mirror/stack_trace_element-inl.h index 0ce6866012..182793dbf3 100644 --- a/runtime/mirror/stack_trace_element-inl.h +++ b/runtime/mirror/stack_trace_element-inl.h @@ -21,7 +21,7 @@ #include "object-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline ObjPtr<String> StackTraceElement::GetDeclaringClass() { diff --git a/runtime/mirror/stack_trace_element.cc b/runtime/mirror/stack_trace_element.cc index 7fc6c0956a..180e0cd530 100644 --- a/runtime/mirror/stack_trace_element.cc +++ b/runtime/mirror/stack_trace_element.cc @@ -24,7 +24,7 @@ #include "object-inl.h" #include "string.h" -namespace art { +namespace art HIDDEN { namespace mirror { ObjPtr<StackTraceElement> StackTraceElement::Alloc(Thread* self, diff --git a/runtime/mirror/stack_trace_element.h b/runtime/mirror/stack_trace_element.h index c07e63ddab..e203c3ba3d 100644 --- a/runtime/mirror/stack_trace_element.h +++ b/runtime/mirror/stack_trace_element.h @@ -17,9 +17,10 @@ #ifndef ART_RUNTIME_MIRROR_STACK_TRACE_ELEMENT_H_ #define ART_RUNTIME_MIRROR_STACK_TRACE_ELEMENT_H_ +#include "base/macros.h" #include "object.h" -namespace art { +namespace art HIDDEN { template<class T> class Handle; struct StackTraceElementOffsets; diff --git a/runtime/mirror/string-alloc-inl.h b/runtime/mirror/string-alloc-inl.h index 9c2529cef4..944dea02c0 100644 --- a/runtime/mirror/string-alloc-inl.h +++ b/runtime/mirror/string-alloc-inl.h @@ -32,7 +32,7 @@ #include "runtime_globals.h" #include "thread.h" -namespace art { +namespace art HIDDEN { namespace mirror { // Sets string count in the allocation code path to ensure it is guarded by a CAS. diff --git a/runtime/mirror/string-inl.h b/runtime/mirror/string-inl.h index 72cd6c051d..c76ef69b1d 100644 --- a/runtime/mirror/string-inl.h +++ b/runtime/mirror/string-inl.h @@ -25,7 +25,7 @@ #include "dex/utf.h" #include "runtime_globals.h" -namespace art { +namespace art HIDDEN { namespace mirror { inline uint32_t String::ClassSize(PointerSize pointer_size) { diff --git a/runtime/mirror/string.cc b/runtime/mirror/string.cc index 2a26d50d79..f4d13ab9cb 100644 --- a/runtime/mirror/string.cc +++ b/runtime/mirror/string.cc @@ -32,7 +32,7 @@ #include "string-inl.h" #include "thread.h" -namespace art { +namespace art HIDDEN { namespace mirror { int32_t String::FastIndexOf(int32_t ch, int32_t start) { diff --git a/runtime/mirror/string.h b/runtime/mirror/string.h index c0f9b39b1f..62890f58fb 100644 --- a/runtime/mirror/string.h +++ b/runtime/mirror/string.h @@ -18,11 +18,12 @@ #define ART_RUNTIME_MIRROR_STRING_H_ #include "base/bit_utils.h" +#include "base/macros.h" #include "class.h" #include "object.h" #include "runtime_globals.h" -namespace art { +namespace art HIDDEN { namespace gc { enum AllocatorType : char; @@ -123,7 +124,7 @@ class MANAGED String final : public Object { static ObjPtr<String> DoReplace(Thread* self, Handle<String> src, uint16_t old_c, uint16_t new_c) REQUIRES_SHARED(Locks::mutator_lock_); - ObjPtr<String> Intern() REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT ObjPtr<String> Intern() REQUIRES_SHARED(Locks::mutator_lock_); template <bool kIsInstrumented = true, typename PreFenceVisitor> ALWAYS_INLINE static ObjPtr<String> Alloc(Thread* self, @@ -181,7 +182,7 @@ class MANAGED String final : public Object { const uint16_t* utf16_data_in) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); - static ObjPtr<String> AllocFromModifiedUtf8(Thread* self, const char* utf) + EXPORT static ObjPtr<String> AllocFromModifiedUtf8(Thread* self, const char* utf) REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_); static ObjPtr<String> AllocFromModifiedUtf8(Thread* self, @@ -204,10 +205,10 @@ class MANAGED String final : public Object { // A version that takes a mirror::String pointer instead of ObjPtr as it's being // called by the runtime app image code which can encode mirror::String at 64bit // addresses (ObjPtr only works with 32bit pointers). - bool Equals(mirror::String* that) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT bool Equals(mirror::String* that) REQUIRES_SHARED(Locks::mutator_lock_); // Create a modified UTF-8 encoded std::string from a java/lang/String object. - std::string ToModifiedUtf8() REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT std::string ToModifiedUtf8() REQUIRES_SHARED(Locks::mutator_lock_); int32_t FastIndexOf(int32_t ch, int32_t start) REQUIRES_SHARED(Locks::mutator_lock_); @@ -289,7 +290,7 @@ class MANAGED String final : public Object { static bool AllASCIIExcept(const uint16_t* chars, int32_t length, uint16_t non_ascii); // Computes, stores, and returns the hash code. - int32_t ComputeAndSetHashCode() REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT int32_t ComputeAndSetHashCode() REQUIRES_SHARED(Locks::mutator_lock_); void SetHashCode(int32_t new_hash_code) REQUIRES_SHARED(Locks::mutator_lock_) { if (kIsDebugBuild) { diff --git a/runtime/mirror/throwable.cc b/runtime/mirror/throwable.cc index a38ba1c45d..94567ef489 100644 --- a/runtime/mirror/throwable.cc +++ b/runtime/mirror/throwable.cc @@ -33,7 +33,7 @@ #include "string.h" #include "well_known_classes-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { using android::base::StringPrintf; diff --git a/runtime/mirror/throwable.h b/runtime/mirror/throwable.h index 995b04a6a0..fa5ead394e 100644 --- a/runtime/mirror/throwable.h +++ b/runtime/mirror/throwable.h @@ -19,7 +19,7 @@ #include "object.h" -namespace art { +namespace art HIDDEN { class RootVisitor; struct ThrowableOffsets; @@ -37,7 +37,7 @@ class MANAGED Throwable : public Object { ObjPtr<String> GetDetailMessage() REQUIRES_SHARED(Locks::mutator_lock_); - std::string Dump() REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT std::string Dump() REQUIRES_SHARED(Locks::mutator_lock_); // This is a runtime version of initCause, you shouldn't use it if initCause may have been // overridden. Also it asserts rather than throwing exceptions. Currently this is only used diff --git a/runtime/mirror/var_handle.cc b/runtime/mirror/var_handle.cc index c923075099..a623e42559 100644 --- a/runtime/mirror/var_handle.cc +++ b/runtime/mirror/var_handle.cc @@ -31,7 +31,7 @@ #include "obj_ptr-inl.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { namespace mirror { static constexpr bool kTransactionActive = true; diff --git a/runtime/mirror/var_handle.h b/runtime/mirror/var_handle.h index 1419bd013f..bf9329f5d7 100644 --- a/runtime/mirror/var_handle.h +++ b/runtime/mirror/var_handle.h @@ -22,7 +22,7 @@ #include "jvalue.h" #include "object.h" -namespace art { +namespace art HIDDEN { template<class T> class Handle; class InstructionOperands; diff --git a/runtime/mirror/var_handle_test.cc b/runtime/mirror/var_handle_test.cc index 859e86c1cb..22d1e4a6d4 100644 --- a/runtime/mirror/var_handle_test.cc +++ b/runtime/mirror/var_handle_test.cc @@ -34,7 +34,7 @@ #include "reflection.h" #include "scoped_thread_state_change-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { // Tests for mirror::VarHandle and it's descendents. |