diff options
author | 2024-01-24 16:27:53 +0000 | |
---|---|---|
committer | 2024-01-25 14:40:53 +0000 | |
commit | 6f30991b16d1dcd386b6073a41a314a0120c7f48 (patch) | |
tree | 04635126bb591100e842d8b0ddd93a2b78458459 | |
parent | f07ec3262629d15088c29e8182fd614a04f8afd3 (diff) |
Add visibility attributes in runtime/m*
Bug: 260881207
Test: presubmit
Test: abtd app_compat_drm
Test: abtd app_compat_top_100
Test: abtd app_compat_banking
Change-Id: Ice9204277b257c6e3c25adb690bddfd834d24689
-rw-r--r-- | runtime/managed_stack-inl.h | 2 | ||||
-rw-r--r-- | runtime/managed_stack.h | 2 | ||||
-rw-r--r-- | runtime/method_handles-inl.h | 2 | ||||
-rw-r--r-- | runtime/method_handles.cc | 2 | ||||
-rw-r--r-- | runtime/method_handles.h | 3 | ||||
-rw-r--r-- | runtime/method_handles_test.cc | 2 | ||||
-rw-r--r-- | runtime/metrics/reporter.cc | 2 | ||||
-rw-r--r-- | runtime/metrics/reporter.h | 3 | ||||
-rw-r--r-- | runtime/metrics/reporter_test.cc | 2 | ||||
-rw-r--r-- | runtime/metrics/statsd.cc | 2 | ||||
-rw-r--r-- | runtime/metrics/statsd.h | 4 | ||||
-rw-r--r-- | runtime/monitor-inl.h | 2 | ||||
-rw-r--r-- | runtime/monitor.cc | 2 | ||||
-rw-r--r-- | runtime/monitor.h | 41 | ||||
-rw-r--r-- | runtime/monitor_android.cc | 2 | ||||
-rw-r--r-- | runtime/monitor_linux.cc | 2 | ||||
-rw-r--r-- | runtime/monitor_objects_stack_visitor.cc | 2 | ||||
-rw-r--r-- | runtime/monitor_objects_stack_visitor.h | 3 | ||||
-rw-r--r-- | runtime/monitor_pool.cc | 2 | ||||
-rw-r--r-- | runtime/monitor_pool.h | 3 | ||||
-rw-r--r-- | runtime/monitor_pool_test.cc | 2 | ||||
-rw-r--r-- | runtime/monitor_test.cc | 2 |
22 files changed, 48 insertions, 41 deletions
diff --git a/runtime/managed_stack-inl.h b/runtime/managed_stack-inl.h index ca983eadc3..a57b75b70f 100644 --- a/runtime/managed_stack-inl.h +++ b/runtime/managed_stack-inl.h @@ -21,7 +21,7 @@ #include "interpreter/shadow_frame.h" -namespace art { +namespace art HIDDEN { inline ShadowFrame* ManagedStack::PushShadowFrame(ShadowFrame* new_top_frame) { DCHECK(!HasTopQuickFrame()); diff --git a/runtime/managed_stack.h b/runtime/managed_stack.h index a354d08bbb..5046e17386 100644 --- a/runtime/managed_stack.h +++ b/runtime/managed_stack.h @@ -27,7 +27,7 @@ #include "base/macros.h" #include "base/bit_utils.h" -namespace art { +namespace art HIDDEN { namespace mirror { class Object; diff --git a/runtime/method_handles-inl.h b/runtime/method_handles-inl.h index cdf9c837f8..be9f0d3411 100644 --- a/runtime/method_handles-inl.h +++ b/runtime/method_handles-inl.h @@ -30,7 +30,7 @@ #include "reflection.h" #include "stack.h" -namespace art { +namespace art HIDDEN { // A convenience class that allows for iteration through a list of // input argument registers. This is used to iterate over input diff --git a/runtime/method_handles.cc b/runtime/method_handles.cc index a8f7a84e94..f2ac3c89ca 100644 --- a/runtime/method_handles.cc +++ b/runtime/method_handles.cc @@ -37,7 +37,7 @@ #include "var_handles.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/method_handles.h b/runtime/method_handles.h index d439d6238e..efe6f69f48 100644 --- a/runtime/method_handles.h +++ b/runtime/method_handles.h @@ -19,12 +19,13 @@ #include <ostream> +#include "base/macros.h" #include "dex/dex_instruction.h" #include "handle.h" #include "jvalue.h" #include "mirror/class.h" -namespace art { +namespace art HIDDEN { class ShadowFrame; diff --git a/runtime/method_handles_test.cc b/runtime/method_handles_test.cc index d7740e3118..53604cd993 100644 --- a/runtime/method_handles_test.cc +++ b/runtime/method_handles_test.cc @@ -28,7 +28,7 @@ #include "scoped_thread_state_change-inl.h" #include "thread-current-inl.h" -namespace art { +namespace art HIDDEN { namespace { bool IsClassCastException(ObjPtr<mirror::Throwable> throwable) diff --git a/runtime/metrics/reporter.cc b/runtime/metrics/reporter.cc index d8cb69a310..91f28aa369 100644 --- a/runtime/metrics/reporter.cc +++ b/runtime/metrics/reporter.cc @@ -31,7 +31,7 @@ #pragma clang diagnostic push #pragma clang diagnostic error "-Wconversion" -namespace art { +namespace art HIDDEN { namespace metrics { std::unique_ptr<MetricsReporter> MetricsReporter::Create( diff --git a/runtime/metrics/reporter.h b/runtime/metrics/reporter.h index 865815e0bf..2de54fdfe2 100644 --- a/runtime/metrics/reporter.h +++ b/runtime/metrics/reporter.h @@ -18,13 +18,14 @@ #define ART_RUNTIME_METRICS_REPORTER_H_ #include "app_info.h" +#include "base/macros.h" #include "base/message_queue.h" #include "base/metrics/metrics.h" #pragma clang diagnostic push #pragma clang diagnostic error "-Wconversion" -namespace art { +namespace art HIDDEN { namespace metrics { /** diff --git a/runtime/metrics/reporter_test.cc b/runtime/metrics/reporter_test.cc index a61f8be75b..97a845c26a 100644 --- a/runtime/metrics/reporter_test.cc +++ b/runtime/metrics/reporter_test.cc @@ -24,7 +24,7 @@ #pragma clang diagnostic push #pragma clang diagnostic error "-Wconversion" -namespace art { +namespace art HIDDEN { namespace metrics { // Helper class to verify the metrics reporter. diff --git a/runtime/metrics/statsd.cc b/runtime/metrics/statsd.cc index 764550e648..67d677be9c 100644 --- a/runtime/metrics/statsd.cc +++ b/runtime/metrics/statsd.cc @@ -28,7 +28,7 @@ #pragma clang diagnostic push #pragma clang diagnostic error "-Wconversion" -namespace art { +namespace art HIDDEN { namespace metrics { namespace { diff --git a/runtime/metrics/statsd.h b/runtime/metrics/statsd.h index cb84825301..ae53a22e85 100644 --- a/runtime/metrics/statsd.h +++ b/runtime/metrics/statsd.h @@ -19,7 +19,9 @@ #include <memory> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { namespace metrics { class MetricsBackend; diff --git a/runtime/monitor-inl.h b/runtime/monitor-inl.h index 3b1a998c99..85ae063811 100644 --- a/runtime/monitor-inl.h +++ b/runtime/monitor-inl.h @@ -22,7 +22,7 @@ #include "gc_root-inl.h" #include "obj_ptr-inl.h" -namespace art { +namespace art HIDDEN { template<ReadBarrierOption kReadBarrierOption> inline ObjPtr<mirror::Object> Monitor::GetObject() REQUIRES_SHARED(Locks::mutator_lock_) { diff --git a/runtime/monitor.cc b/runtime/monitor.cc index 4e9e4d946e..8816b7b348 100644 --- a/runtime/monitor.cc +++ b/runtime/monitor.cc @@ -46,7 +46,7 @@ static_assert(ART_USE_FUTEXES); -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/monitor.h b/runtime/monitor.h index ad7a0b4406..d142212e18 100644 --- a/runtime/monitor.h +++ b/runtime/monitor.h @@ -28,6 +28,7 @@ #include "base/allocator.h" #include "base/atomic.h" +#include "base/macros.h" #include "base/mutex.h" #include "gc_root.h" #include "lock_word.h" @@ -36,7 +37,7 @@ #include "runtime_callbacks.h" #include "thread_state.h" -namespace art { +namespace art HIDDEN { class ArtMethod; class IsMarkedVisitor; @@ -72,20 +73,20 @@ class Monitor { static void Init(uint32_t lock_profiling_threshold, uint32_t stack_dump_lock_profiling_threshold); // Return the thread id of the lock owner or 0 when there is no owner. - static uint32_t GetLockOwnerThreadId(ObjPtr<mirror::Object> obj) + EXPORT static uint32_t GetLockOwnerThreadId(ObjPtr<mirror::Object> obj) NO_THREAD_SAFETY_ANALYSIS; // TODO: Reading lock owner without holding lock is racy. // NO_THREAD_SAFETY_ANALYSIS for mon->Lock. - static ObjPtr<mirror::Object> MonitorEnter(Thread* thread, - ObjPtr<mirror::Object> obj, - bool trylock) + EXPORT static ObjPtr<mirror::Object> MonitorEnter(Thread* thread, + ObjPtr<mirror::Object> obj, + bool trylock) EXCLUSIVE_LOCK_FUNCTION(obj.Ptr()) NO_THREAD_SAFETY_ANALYSIS REQUIRES(!Roles::uninterruptible_) REQUIRES_SHARED(Locks::mutator_lock_); // NO_THREAD_SAFETY_ANALYSIS for mon->Unlock. - static bool MonitorExit(Thread* thread, ObjPtr<mirror::Object> obj) + EXPORT static bool MonitorExit(Thread* thread, ObjPtr<mirror::Object> obj) NO_THREAD_SAFETY_ANALYSIS REQUIRES(!Roles::uninterruptible_) REQUIRES_SHARED(Locks::mutator_lock_) @@ -102,11 +103,12 @@ class Monitor { // Object.wait(). Also called for class init. // NO_THREAD_SAFETY_ANALYSIS for mon->Wait. - static void Wait(Thread* self, - ObjPtr<mirror::Object> obj, - int64_t ms, - int32_t ns, - bool interruptShouldThrow, ThreadState why) + EXPORT static void Wait(Thread* self, + ObjPtr<mirror::Object> obj, + int64_t ms, + int32_t ns, + bool interruptShouldThrow, + ThreadState why) REQUIRES_SHARED(Locks::mutator_lock_) NO_THREAD_SAFETY_ANALYSIS; static ThreadState FetchState(const Thread* thread, @@ -116,18 +118,17 @@ class Monitor { REQUIRES_SHARED(Locks::mutator_lock_); // Used to implement JDWP's ThreadReference.CurrentContendedMonitor. - static ObjPtr<mirror::Object> GetContendedMonitor(Thread* thread) + EXPORT static ObjPtr<mirror::Object> GetContendedMonitor(Thread* thread) REQUIRES_SHARED(Locks::mutator_lock_); // Calls 'callback' once for each lock held in the single stack frame represented by // the current state of 'stack_visitor'. // The abort_on_failure flag allows to not die when the state of the runtime is unorderly. This // is necessary when we have already aborted but want to dump the stack as much as we can. - static void VisitLocks(StackVisitor* stack_visitor, - void (*callback)(ObjPtr<mirror::Object>, void*), - void* callback_context, - bool abort_on_failure = true) - REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT static void VisitLocks(StackVisitor* stack_visitor, + void (*callback)(ObjPtr<mirror::Object>, void*), + void* callback_context, + bool abort_on_failure = true) REQUIRES_SHARED(Locks::mutator_lock_); static bool IsValidLockWord(LockWord lock_word); @@ -161,7 +162,7 @@ class Monitor { // Not exclusive because ImageWriter calls this during a Heap::VisitObjects() that // does not allow a thread suspension in the middle. TODO: maybe make this exclusive. // NO_THREAD_SAFETY_ANALYSIS for monitor->monitor_lock_. - static bool Deflate(Thread* self, ObjPtr<mirror::Object> obj) + EXPORT static bool Deflate(Thread* self, ObjPtr<mirror::Object> obj) REQUIRES_SHARED(Locks::mutator_lock_) NO_THREAD_SAFETY_ANALYSIS; #ifndef __LP64__ @@ -450,7 +451,7 @@ class MonitorList { void BroadcastForNewMonitors() REQUIRES(!monitor_list_lock_); // Returns how many monitors were deflated. size_t DeflateMonitors() REQUIRES(!monitor_list_lock_) REQUIRES(Locks::mutator_lock_); - size_t Size() REQUIRES(!monitor_list_lock_); + EXPORT size_t Size() REQUIRES(!monitor_list_lock_); using Monitors = std::list<Monitor*, TrackingAllocator<Monitor*, kAllocatorTagMonitorList>>; @@ -476,7 +477,7 @@ class MonitorInfo { MonitorInfo() : owner_(nullptr), entry_count_(0) {} MonitorInfo(const MonitorInfo&) = default; MonitorInfo& operator=(const MonitorInfo&) = default; - explicit MonitorInfo(ObjPtr<mirror::Object> o) REQUIRES(Locks::mutator_lock_); + EXPORT explicit MonitorInfo(ObjPtr<mirror::Object> o) REQUIRES(Locks::mutator_lock_); Thread* owner_; size_t entry_count_; diff --git a/runtime/monitor_android.cc b/runtime/monitor_android.cc index f661631789..aee157cfcd 100644 --- a/runtime/monitor_android.cc +++ b/runtime/monitor_android.cc @@ -30,7 +30,7 @@ #define EVENT_LOG_TAG_dvm_lock_sample 20003 -namespace art { +namespace art HIDDEN { void Monitor::LogContentionEvent(Thread* self, uint32_t wait_ms, diff --git a/runtime/monitor_linux.cc b/runtime/monitor_linux.cc index 667866149b..f711e960a8 100644 --- a/runtime/monitor_linux.cc +++ b/runtime/monitor_linux.cc @@ -16,7 +16,7 @@ #include "monitor.h" -namespace art { +namespace art HIDDEN { void Monitor::LogContentionEvent(Thread*, uint32_t, uint32_t, ArtMethod*, uint32_t) { } diff --git a/runtime/monitor_objects_stack_visitor.cc b/runtime/monitor_objects_stack_visitor.cc index 524c0ec62f..f53f6af040 100644 --- a/runtime/monitor_objects_stack_visitor.cc +++ b/runtime/monitor_objects_stack_visitor.cc @@ -20,7 +20,7 @@ #include "read_barrier-inl.h" #include "thread-current-inl.h" -namespace art { +namespace art HIDDEN { bool MonitorObjectsStackVisitor::VisitFrame() { ArtMethod* m = GetMethod(); diff --git a/runtime/monitor_objects_stack_visitor.h b/runtime/monitor_objects_stack_visitor.h index 8e148aa746..e3fe15396d 100644 --- a/runtime/monitor_objects_stack_visitor.h +++ b/runtime/monitor_objects_stack_visitor.h @@ -21,12 +21,13 @@ #include "art_method.h" #include "base/locks.h" +#include "base/macros.h" #include "monitor.h" #include "stack.h" #include "thread.h" #include "thread_state.h" -namespace art { +namespace art HIDDEN { namespace mirror { class Object; diff --git a/runtime/monitor_pool.cc b/runtime/monitor_pool.cc index b2b00242a7..0501ea5ef4 100644 --- a/runtime/monitor_pool.cc +++ b/runtime/monitor_pool.cc @@ -21,7 +21,7 @@ #include "monitor.h" #include "thread-current-inl.h" -namespace art { +namespace art HIDDEN { namespace mirror { class Object; diff --git a/runtime/monitor_pool.h b/runtime/monitor_pool.h index 133cde094d..b6340d76d7 100644 --- a/runtime/monitor_pool.h +++ b/runtime/monitor_pool.h @@ -20,6 +20,7 @@ #include "monitor.h" #include "base/allocator.h" +#include "base/macros.h" #ifdef __LP64__ #include <stdint.h> #include "base/atomic.h" @@ -28,7 +29,7 @@ #include "base/stl_util.h" // STLDeleteElements #endif -namespace art { +namespace art HIDDEN { // Abstraction to keep monitors small enough to fit in a lock word (32bits). On 32bit systems the // monitor id loses the alignment bits of the Monitor*. diff --git a/runtime/monitor_pool_test.cc b/runtime/monitor_pool_test.cc index 5463877b83..d6ddca9736 100644 --- a/runtime/monitor_pool_test.cc +++ b/runtime/monitor_pool_test.cc @@ -20,7 +20,7 @@ #include "scoped_thread_state_change-inl.h" #include "thread-current-inl.h" -namespace art { +namespace art HIDDEN { class MonitorPoolTest : public CommonRuntimeTest {}; diff --git a/runtime/monitor_test.cc b/runtime/monitor_test.cc index 42707406d5..00e30ff541 100644 --- a/runtime/monitor_test.cc +++ b/runtime/monitor_test.cc @@ -32,7 +32,7 @@ #include "scoped_thread_state_change-inl.h" #include "thread_pool.h" -namespace art { +namespace art HIDDEN { class MonitorTest : public CommonRuntimeTest { protected: |