diff options
-rw-r--r-- | runtime/scoped_disable_public_sdk_checker.h | 4 | ||||
-rw-r--r-- | runtime/scoped_thread_state_change-inl.h | 2 | ||||
-rw-r--r-- | runtime/scoped_thread_state_change.cc | 2 | ||||
-rw-r--r-- | runtime/scoped_thread_state_change.h | 5 | ||||
-rw-r--r-- | runtime/sdk_checker.cc | 2 | ||||
-rw-r--r-- | runtime/sdk_checker.h | 5 | ||||
-rw-r--r-- | runtime/signal_catcher.cc | 2 | ||||
-rw-r--r-- | runtime/signal_catcher.h | 3 | ||||
-rw-r--r-- | runtime/signal_set.h | 4 | ||||
-rw-r--r-- | runtime/stack.cc | 2 | ||||
-rw-r--r-- | runtime/stack.h | 74 | ||||
-rw-r--r-- | runtime/stack_reference.h | 2 | ||||
-rw-r--r-- | runtime/startup_completed_task.cc | 2 | ||||
-rw-r--r-- | runtime/startup_completed_task.h | 3 | ||||
-rw-r--r-- | runtime/string_builder_append.cc | 2 | ||||
-rw-r--r-- | runtime/string_builder_append.h | 3 | ||||
-rw-r--r-- | runtime/subtype_check.h | 3 | ||||
-rw-r--r-- | runtime/subtype_check_bits.h | 3 | ||||
-rw-r--r-- | runtime/subtype_check_bits_and_status.h | 3 | ||||
-rw-r--r-- | runtime/subtype_check_info.h | 3 | ||||
-rw-r--r-- | runtime/subtype_check_info_test.cc | 2 | ||||
-rw-r--r-- | runtime/subtype_check_test.cc | 2 | ||||
-rw-r--r-- | runtime/suspend_reason.h | 4 |
23 files changed, 76 insertions, 61 deletions
diff --git a/runtime/scoped_disable_public_sdk_checker.h b/runtime/scoped_disable_public_sdk_checker.h index 4ec1af3fa4..5365d17439 100644 --- a/runtime/scoped_disable_public_sdk_checker.h +++ b/runtime/scoped_disable_public_sdk_checker.h @@ -19,7 +19,9 @@ #include "class_linker.h" -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { // Utility class to disabled the public sdk checker within a scope (if installed). class ScopedDisablePublicSdkChecker : public ValueObject { diff --git a/runtime/scoped_thread_state_change-inl.h b/runtime/scoped_thread_state_change-inl.h index 674d791f54..f4e2bf996f 100644 --- a/runtime/scoped_thread_state_change-inl.h +++ b/runtime/scoped_thread_state_change-inl.h @@ -28,7 +28,7 @@ #include "runtime.h" #include "thread-inl.h" -namespace art { +namespace art HIDDEN { inline ScopedThreadStateChange::ScopedThreadStateChange(Thread* self, ThreadState new_thread_state) : self_(self), thread_state_(new_thread_state), expected_has_no_thread_(false) { diff --git a/runtime/scoped_thread_state_change.cc b/runtime/scoped_thread_state_change.cc index 4051c31a34..cbca4e0e83 100644 --- a/runtime/scoped_thread_state_change.cc +++ b/runtime/scoped_thread_state_change.cc @@ -25,7 +25,7 @@ #include "obj_ptr-inl.h" #include "runtime-inl.h" -namespace art { +namespace art HIDDEN { // See ScopedObjectAccessAlreadyRunnable::ScopedObjectAccessAlreadyRunnable(JavaVM*). static_assert(std::is_base_of<JavaVM, JavaVMExt>::value, "JavaVMExt does not extend JavaVM"); diff --git a/runtime/scoped_thread_state_change.h b/runtime/scoped_thread_state_change.h index 7416d181bc..08aace9c82 100644 --- a/runtime/scoped_thread_state_change.h +++ b/runtime/scoped_thread_state_change.h @@ -24,7 +24,7 @@ #include "base/value_object.h" #include "thread_state.h" -namespace art { +namespace art HIDDEN { class JavaVMExt; class JNIEnvExt; @@ -58,7 +58,7 @@ class ScopedThreadStateChange : public ValueObject { const ThreadState thread_state_ = ThreadState::kTerminated; private: - void ScopedThreadChangeDestructorCheck(); + EXPORT void ScopedThreadChangeDestructorCheck(); ThreadState old_thread_state_ = ThreadState::kTerminated; const bool expected_has_no_thread_ = true; @@ -207,7 +207,6 @@ class ScopedThreadSuspension : public ValueObject { DISALLOW_COPY_AND_ASSIGN(ScopedThreadSuspension); }; - } // namespace art #endif // ART_RUNTIME_SCOPED_THREAD_STATE_CHANGE_H_ diff --git a/runtime/sdk_checker.cc b/runtime/sdk_checker.cc index 95023829a5..0ad8ce5c9e 100644 --- a/runtime/sdk_checker.cc +++ b/runtime/sdk_checker.cc @@ -21,7 +21,7 @@ #include "dex/art_dex_file_loader.h" #include "mirror/class-inl.h" -namespace art { +namespace art HIDDEN { SdkChecker::SdkChecker() : enabled_(true) {} diff --git a/runtime/sdk_checker.h b/runtime/sdk_checker.h index 8d82237a60..6bd0b2a15b 100644 --- a/runtime/sdk_checker.h +++ b/runtime/sdk_checker.h @@ -20,9 +20,10 @@ #include "art_field.h" #include "art_method.h" #include "base/locks.h" +#include "base/macros.h" #include "dex/dex_file.h" -namespace art { +namespace art HIDDEN { /** * The SdkChecker verifies if a given symbol is present in a given classpath. @@ -43,7 +44,7 @@ class SdkChecker { // format is the same as the classpath format (e.g. `dex1:dex2:dex3`). The // method will attempt to open the dex files and if there are errors it will // return a nullptr and set the error_msg appropriately. - static SdkChecker* Create(const std::string& public_sdk, std::string* error_msg); + EXPORT static SdkChecker* Create(const std::string& public_sdk, std::string* error_msg); // Verify if it should deny access to the given methods. // The decision is based on whether or not any of the API dex files declares a method diff --git a/runtime/signal_catcher.cc b/runtime/signal_catcher.cc index 7973cc9a89..3660ef3a19 100644 --- a/runtime/signal_catcher.cc +++ b/runtime/signal_catcher.cc @@ -46,7 +46,7 @@ #include "thread.h" #include "thread_list.h" -namespace art { +namespace art HIDDEN { static void DumpCmdLine(std::ostream& os) { #if defined(__linux__) diff --git a/runtime/signal_catcher.h b/runtime/signal_catcher.h index 50b001d2ca..79014ea022 100644 --- a/runtime/signal_catcher.h +++ b/runtime/signal_catcher.h @@ -21,8 +21,9 @@ #include "android-base/unique_fd.h" #include "base/mutex.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { class Runtime; class SignalSet; diff --git a/runtime/signal_set.h b/runtime/signal_set.h index 8e70a51cd1..470319c9cb 100644 --- a/runtime/signal_set.h +++ b/runtime/signal_set.h @@ -21,6 +21,8 @@ #include <android-base/logging.h> +#include "base/macros.h" + #if defined(__GLIBC__) || defined(ANDROID_HOST_MUSL) #define sigset64_t sigset_t #define sigemptyset64 sigemptyset @@ -29,7 +31,7 @@ #define sigwait64 sigwait #endif -namespace art { +namespace art HIDDEN { class SignalSet { public: diff --git a/runtime/stack.cc b/runtime/stack.cc index 4bd2719f44..942b155261 100644 --- a/runtime/stack.cc +++ b/runtime/stack.cc @@ -47,7 +47,7 @@ #include "thread.h" #include "thread_list.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/stack.h b/runtime/stack.h index 46f0d084fe..71948b25d3 100644 --- a/runtime/stack.h +++ b/runtime/stack.h @@ -29,7 +29,7 @@ #include "obj_ptr.h" #include "quick/quick_method_frame_info.h" -namespace art { +namespace art HIDDEN { namespace mirror { class Object; @@ -118,10 +118,10 @@ class StackVisitor { }; protected: - StackVisitor(Thread* thread, - Context* context, - StackWalkKind walk_kind, - bool check_suspended = true); + EXPORT StackVisitor(Thread* thread, + Context* context, + StackWalkKind walk_kind, + bool check_suspended = true); bool GetRegisterIfAccessible(uint32_t reg, DexRegisterLocation::Kind kind, uint32_t* val) const REQUIRES_SHARED(Locks::mutator_lock_); @@ -134,13 +134,13 @@ class StackVisitor { // Return 'true' if we should continue to visit more frames, 'false' to stop. virtual bool VisitFrame() REQUIRES_SHARED(Locks::mutator_lock_) = 0; - enum class CountTransitions { + enum class EXPORT CountTransitions { kYes, kNo, }; template <CountTransitions kCount = CountTransitions::kYes> - void WalkStack(bool include_transitions = false) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT void WalkStack(bool include_transitions = false) REQUIRES_SHARED(Locks::mutator_lock_); // Convenience helper function to walk the stack with a lambda as a visitor. template <CountTransitions kCountTransitions = CountTransitions::kYes, @@ -176,11 +176,11 @@ class StackVisitor { return thread_; } - ArtMethod* GetMethod() const REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT ArtMethod* GetMethod() const REQUIRES_SHARED(Locks::mutator_lock_); // Sets this stack frame's method pointer. This requires a full lock of the MutatorLock. This // doesn't work with inlined methods. - void SetMethod(ArtMethod* method) REQUIRES(Locks::mutator_lock_); + EXPORT void SetMethod(ArtMethod* method) REQUIRES(Locks::mutator_lock_); ArtMethod* GetOuterMethod() const { return *GetCurrentQuickFrame(); @@ -190,7 +190,8 @@ class StackVisitor { return cur_shadow_frame_ != nullptr; } - uint32_t GetDexPc(bool abort_on_failure = true) const REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT uint32_t GetDexPc(bool abort_on_failure = true) const + REQUIRES_SHARED(Locks::mutator_lock_); // Returns a vector of the inlined dex pcs, in order from outermost to innermost but it replaces // the innermost one with `handler_dex_pc`. In essence, (outermost dex pc, mid dex pc #1, ..., mid @@ -198,9 +199,9 @@ class StackVisitor { std::vector<uint32_t> ComputeDexPcList(uint32_t handler_dex_pc) const REQUIRES_SHARED(Locks::mutator_lock_); - ObjPtr<mirror::Object> GetThisObject() const REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT ObjPtr<mirror::Object> GetThisObject() const REQUIRES_SHARED(Locks::mutator_lock_); - size_t GetNativePcOffset() const REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT size_t GetNativePcOffset() const REQUIRES_SHARED(Locks::mutator_lock_); // Returns the height of the stack in the managed stack frames, including transitions. size_t GetFrameHeight() REQUIRES_SHARED(Locks::mutator_lock_) { @@ -227,35 +228,37 @@ class StackVisitor { bool GetNextMethodAndDexPc(ArtMethod** next_method, uint32_t* next_dex_pc) REQUIRES_SHARED(Locks::mutator_lock_); - bool GetVReg(ArtMethod* m, - uint16_t vreg, - VRegKind kind, - uint32_t* val, - std::optional<DexRegisterLocation> location = std::optional<DexRegisterLocation>(), - bool need_full_register_list = false) const REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT bool GetVReg( + ArtMethod* m, + uint16_t vreg, + VRegKind kind, + uint32_t* val, + std::optional<DexRegisterLocation> location = std::optional<DexRegisterLocation>(), + bool need_full_register_list = false) const REQUIRES_SHARED(Locks::mutator_lock_); - bool GetVRegPair(ArtMethod* m, uint16_t vreg, VRegKind kind_lo, VRegKind kind_hi, - uint64_t* val) const - REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT bool GetVRegPair(ArtMethod* m, + uint16_t vreg, + VRegKind kind_lo, + VRegKind kind_hi, + uint64_t* val) const REQUIRES_SHARED(Locks::mutator_lock_); // Values will be set in debugger shadow frames. Debugger will make sure deoptimization // is triggered to make the values effective. - bool SetVReg(ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind) + EXPORT bool SetVReg(ArtMethod* m, uint16_t vreg, uint32_t new_value, VRegKind kind) REQUIRES_SHARED(Locks::mutator_lock_); // Values will be set in debugger shadow frames. Debugger will make sure deoptimization // is triggered to make the values effective. - bool SetVRegReference(ArtMethod* m, uint16_t vreg, ObjPtr<mirror::Object> new_value) + EXPORT bool SetVRegReference(ArtMethod* m, uint16_t vreg, ObjPtr<mirror::Object> new_value) REQUIRES_SHARED(Locks::mutator_lock_); // Values will be set in debugger shadow frames. Debugger will make sure deoptimization // is triggered to make the values effective. - bool SetVRegPair(ArtMethod* m, - uint16_t vreg, - uint64_t new_value, - VRegKind kind_lo, - VRegKind kind_hi) - REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT bool SetVRegPair(ArtMethod* m, + uint16_t vreg, + uint64_t new_value, + VRegKind kind_lo, + VRegKind kind_hi) REQUIRES_SHARED(Locks::mutator_lock_); uintptr_t* GetGPRAddress(uint32_t reg) const; @@ -292,7 +295,7 @@ class StackVisitor { std::string DescribeLocation() const REQUIRES_SHARED(Locks::mutator_lock_); - static size_t ComputeNumFrames(Thread* thread, StackWalkKind walk_kind) + EXPORT static size_t ComputeNumFrames(Thread* thread, StackWalkKind walk_kind) REQUIRES_SHARED(Locks::mutator_lock_); static void DescribeStack(Thread* thread) REQUIRES_SHARED(Locks::mutator_lock_); @@ -330,12 +333,11 @@ class StackVisitor { private: // Private constructor known in the case that num_frames_ has already been computed. - StackVisitor(Thread* thread, - Context* context, - StackWalkKind walk_kind, - size_t num_frames, - bool check_suspended = true) - REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT StackVisitor(Thread* thread, + Context* context, + StackWalkKind walk_kind, + size_t num_frames, + bool check_suspended = true) REQUIRES_SHARED(Locks::mutator_lock_); bool IsAccessibleRegister(uint32_t reg, bool is_float) const { return is_float ? IsAccessibleFPR(reg) : IsAccessibleGPR(reg); diff --git a/runtime/stack_reference.h b/runtime/stack_reference.h index 3d37b764be..1bfcb92055 100644 --- a/runtime/stack_reference.h +++ b/runtime/stack_reference.h @@ -20,7 +20,7 @@ #include "base/macros.h" #include "mirror/object_reference.h" -namespace art { +namespace art HIDDEN { // A reference from the shadow stack to a MirrorType object within the Java heap. template<class MirrorType> diff --git a/runtime/startup_completed_task.cc b/runtime/startup_completed_task.cc index 4bd507f856..fa768d52df 100644 --- a/runtime/startup_completed_task.cc +++ b/runtime/startup_completed_task.cc @@ -32,7 +32,7 @@ #include "thread.h" #include "thread_list.h" -namespace art { +namespace art HIDDEN { class UnlinkStartupDexCacheVisitor : public DexCacheVisitor { public: diff --git a/runtime/startup_completed_task.h b/runtime/startup_completed_task.h index 8077561833..ac9c8584fe 100644 --- a/runtime/startup_completed_task.h +++ b/runtime/startup_completed_task.h @@ -17,9 +17,10 @@ #ifndef ART_RUNTIME_STARTUP_COMPLETED_TASK_H_ #define ART_RUNTIME_STARTUP_COMPLETED_TASK_H_ +#include "base/macros.h" #include "gc/task_processor.h" -namespace art { +namespace art HIDDEN { class Thread; diff --git a/runtime/string_builder_append.cc b/runtime/string_builder_append.cc index 9803fe3880..3db2256384 100644 --- a/runtime/string_builder_append.cc +++ b/runtime/string_builder_append.cc @@ -26,7 +26,7 @@ #include "runtime.h" #include "well_known_classes.h" -namespace art { +namespace art HIDDEN { class StringBuilderAppend::Builder { public: diff --git a/runtime/string_builder_append.h b/runtime/string_builder_append.h index fee64198f9..9629c99ae8 100644 --- a/runtime/string_builder_append.h +++ b/runtime/string_builder_append.h @@ -22,9 +22,10 @@ #include "base/bit_utils.h" #include "base/locks.h" +#include "base/macros.h" #include "obj_ptr.h" -namespace art { +namespace art HIDDEN { class Thread; diff --git a/runtime/subtype_check.h b/runtime/subtype_check.h index 90b9b57381..45b82f5471 100644 --- a/runtime/subtype_check.h +++ b/runtime/subtype_check.h @@ -21,6 +21,7 @@ #include "subtype_check_info.h" #include "base/locks.h" +#include "base/macros.h" #include "mirror/class.h" #include "runtime.h" @@ -219,7 +220,7 @@ constexpr bool kBitstringSubtypeCheckEnabled = false; * All node targets (in `src <: target`) get Assigned, and any parent of an Initialized * node also gets Assigned. */ -namespace art { +namespace art HIDDEN { struct MockSubtypeCheck; // Forward declaration for testing. diff --git a/runtime/subtype_check_bits.h b/runtime/subtype_check_bits.h index 7e73afb295..6d46d787f0 100644 --- a/runtime/subtype_check_bits.h +++ b/runtime/subtype_check_bits.h @@ -20,8 +20,9 @@ #include "base/bit_string.h" #include "base/bit_struct.h" #include "base/bit_utils.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { /** * The SubtypeCheckBits memory layout (in bits): diff --git a/runtime/subtype_check_bits_and_status.h b/runtime/subtype_check_bits_and_status.h index e774955245..266f977d57 100644 --- a/runtime/subtype_check_bits_and_status.h +++ b/runtime/subtype_check_bits_and_status.h @@ -20,10 +20,11 @@ #include "base/bit_struct.h" #include "base/bit_utils.h" #include "base/casts.h" +#include "base/macros.h" #include "class_status.h" #include "subtype_check_bits.h" -namespace art { +namespace art HIDDEN { /* * Enables a highly efficient O(1) subtype comparison by storing extra data diff --git a/runtime/subtype_check_info.h b/runtime/subtype_check_info.h index eef68d7dfb..ce7f3a06e9 100644 --- a/runtime/subtype_check_info.h +++ b/runtime/subtype_check_info.h @@ -19,12 +19,13 @@ #include "base/bit_string.h" #include "base/logging.h" +#include "base/macros.h" #include "subtype_check_bits.h" // Forward-declare for testing purposes. struct SubtypeCheckInfoTest; -namespace art { +namespace art HIDDEN { /** * SubtypeCheckInfo is a logical label for the class SubtypeCheck data, which is necessary to diff --git a/runtime/subtype_check_info_test.cc b/runtime/subtype_check_info_test.cc index 44a2a6933e..a592a25acf 100644 --- a/runtime/subtype_check_info_test.cc +++ b/runtime/subtype_check_info_test.cc @@ -19,7 +19,7 @@ #include "gtest/gtest.h" #include "android-base/logging.h" -namespace art { +namespace art HIDDEN { constexpr size_t BitString::kBitSizeAtPosition[BitString::kCapacity]; constexpr size_t BitString::kCapacity; diff --git a/runtime/subtype_check_test.cc b/runtime/subtype_check_test.cc index 5960bcc29d..d634671d34 100644 --- a/runtime/subtype_check_test.cc +++ b/runtime/subtype_check_test.cc @@ -19,7 +19,7 @@ #include "gtest/gtest.h" #include "android-base/logging.h" -namespace art { +namespace art HIDDEN { constexpr size_t BitString::kBitSizeAtPosition[BitString::kCapacity]; constexpr size_t BitString::kCapacity; diff --git a/runtime/suspend_reason.h b/runtime/suspend_reason.h index f45505ae84..3af67a92ca 100644 --- a/runtime/suspend_reason.h +++ b/runtime/suspend_reason.h @@ -19,7 +19,9 @@ #include <iosfwd> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { // The various reasons that we might be suspending a thread. enum class SuspendReason : char { |