diff options
author | 2024-01-04 21:29:31 +0000 | |
---|---|---|
committer | 2024-01-08 18:20:41 +0000 | |
commit | bd627878530cbad856d4e6520f72baec4791b9b0 (patch) | |
tree | 90dc8febf4c29379647aac9381ce1795d61eea74 | |
parent | 92694be87e8004df54c9701d168b6682be6ce8b8 (diff) |
Add visibility attributes in runtime/arch/{arm,arm64,riscv64,x86,x86_64}
Include files that belong to fault_handler unit:
* runtime/fault_handler.cc
* runtime/fault_handler.h
Include files that belong to thread unit:
* runtime/thread-inl.h
* runtime/thread.cc
* runtime/thread.h
* runtime/thread_android.cc
* runtime/thread_linux.cc
Update generate_operator_out to support symbol visibility attributes in
classes and enums.
Bug: 260881207
Test: presubmit
Test: abtd app_compat_drm
Test: abtd app_compat_top_100
Test: abtd app_compat_banking
Change-Id: Icadc031d7c4455816a4799825dfcf8f2ef13f6a6
67 files changed, 97 insertions, 77 deletions
diff --git a/runtime/arch/arm/callee_save_frame_arm.h b/runtime/arch/arm/callee_save_frame_arm.h index 72ba3b7f66..a569942c1a 100644 --- a/runtime/arch/arm/callee_save_frame_arm.h +++ b/runtime/arch/arm/callee_save_frame_arm.h @@ -21,11 +21,12 @@ #include "base/bit_utils.h" #include "base/callee_save_type.h" #include "base/enums.h" +#include "base/macros.h" #include "quick/quick_method_frame_info.h" #include "registers_arm.h" #include "runtime_globals.h" -namespace art { +namespace art HIDDEN { namespace arm { static constexpr uint32_t kArmCalleeSaveAlwaysSpills = diff --git a/runtime/arch/arm/context_arm.cc b/runtime/arch/arm/context_arm.cc index e118daa300..4e880e4bf6 100644 --- a/runtime/arch/arm/context_arm.cc +++ b/runtime/arch/arm/context_arm.cc @@ -21,7 +21,7 @@ #include "quick/quick_method_frame_info.h" #include "thread-current-inl.h" -namespace art { +namespace art HIDDEN { namespace arm { static constexpr uint32_t gZero = 0; diff --git a/runtime/arch/arm/context_arm.h b/runtime/arch/arm/context_arm.h index 006939c838..592d01b380 100644 --- a/runtime/arch/arm/context_arm.h +++ b/runtime/arch/arm/context_arm.h @@ -23,7 +23,7 @@ #include "base/macros.h" #include "registers_arm.h" -namespace art { +namespace art HIDDEN { namespace arm { class ArmContext final : public Context { diff --git a/runtime/arch/arm/entrypoints_init_arm.cc b/runtime/arch/arm/entrypoints_init_arm.cc index 555babec78..156a107c99 100644 --- a/runtime/arch/arm/entrypoints_init_arm.cc +++ b/runtime/arch/arm/entrypoints_init_arm.cc @@ -29,7 +29,7 @@ #include "entrypoints/runtime_asm_entrypoints.h" #include "interpreter/interpreter.h" -namespace art { +namespace art HIDDEN { // Cast entrypoints. extern "C" size_t artInstanceOfFromCode(mirror::Object* obj, mirror::Class* ref_class); diff --git a/runtime/arch/arm/fault_handler_arm.cc b/runtime/arch/arm/fault_handler_arm.cc index bf3eaa7bf2..de5c28b2cd 100644 --- a/runtime/arch/arm/fault_handler_arm.cc +++ b/runtime/arch/arm/fault_handler_arm.cc @@ -31,7 +31,7 @@ // ARM specific fault handler functions. // -namespace art { +namespace art HIDDEN { extern "C" void art_quick_throw_null_pointer_exception_from_signal(); extern "C" void art_quick_throw_stack_overflow(); diff --git a/runtime/arch/arm/instruction_set_features_arm.cc b/runtime/arch/arm/instruction_set_features_arm.cc index 3309523ba8..738409b8a4 100644 --- a/runtime/arch/arm/instruction_set_features_arm.cc +++ b/runtime/arch/arm/instruction_set_features_arm.cc @@ -45,7 +45,7 @@ extern "C" bool artCheckForArmSdivInstruction(); extern "C" bool artCheckForArmv8AInstructions(); #endif -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/arch/arm/instruction_set_features_arm.h b/runtime/arch/arm/instruction_set_features_arm.h index 613ed14ed9..5b8d308bf8 100644 --- a/runtime/arch/arm/instruction_set_features_arm.h +++ b/runtime/arch/arm/instruction_set_features_arm.h @@ -18,8 +18,9 @@ #define ART_RUNTIME_ARCH_ARM_INSTRUCTION_SET_FEATURES_ARM_H_ #include "arch/instruction_set_features.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { class ArmInstructionSetFeatures; using ArmFeaturesUniquePtr = std::unique_ptr<const ArmInstructionSetFeatures>; diff --git a/runtime/arch/arm/instruction_set_features_arm_test.cc b/runtime/arch/arm/instruction_set_features_arm_test.cc index 36e31bdca4..9d37e4f32b 100644 --- a/runtime/arch/arm/instruction_set_features_arm_test.cc +++ b/runtime/arch/arm/instruction_set_features_arm_test.cc @@ -18,7 +18,7 @@ #include "gtest/gtest.h" -namespace art { +namespace art HIDDEN { TEST(ArmInstructionSetFeaturesTest, ArmFeaturesFromVariant) { // Build features for a 32-bit ARM krait processor. diff --git a/runtime/arch/arm/jni_frame_arm.h b/runtime/arch/arm/jni_frame_arm.h index 1987bc3dde..5410950efb 100644 --- a/runtime/arch/arm/jni_frame_arm.h +++ b/runtime/arch/arm/jni_frame_arm.h @@ -23,8 +23,9 @@ #include "base/bit_utils.h" #include "base/globals.h" #include "base/logging.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace arm { constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k32); diff --git a/runtime/arch/arm/quick_entrypoints_cc_arm.cc b/runtime/arch/arm/quick_entrypoints_cc_arm.cc index d7fef6f72e..944ac15c60 100644 --- a/runtime/arch/arm/quick_entrypoints_cc_arm.cc +++ b/runtime/arch/arm/quick_entrypoints_cc_arm.cc @@ -17,7 +17,7 @@ #include "art_method.h" #include "base/utils.h" // For RoundUp(). -namespace art { +namespace art HIDDEN { // Assembly stub that does the final part of the up-call into Java. extern "C" void art_quick_invoke_stub_internal(ArtMethod*, uint32_t*, uint32_t, diff --git a/runtime/arch/arm/registers_arm.cc b/runtime/arch/arm/registers_arm.cc index 4f046479f1..ee7ef478de 100644 --- a/runtime/arch/arm/registers_arm.cc +++ b/runtime/arch/arm/registers_arm.cc @@ -18,7 +18,7 @@ #include <ostream> -namespace art { +namespace art HIDDEN { namespace arm { static const char* kRegisterNames[] = { diff --git a/runtime/arch/arm/registers_arm.h b/runtime/arch/arm/registers_arm.h index d39a2a274f..7cc95d464a 100644 --- a/runtime/arch/arm/registers_arm.h +++ b/runtime/arch/arm/registers_arm.h @@ -19,7 +19,9 @@ #include <iosfwd> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { namespace arm { // Values for registers. diff --git a/runtime/arch/arm/thread_arm.cc b/runtime/arch/arm/thread_arm.cc index 18585c7973..82d287c444 100644 --- a/runtime/arch/arm/thread_arm.cc +++ b/runtime/arch/arm/thread_arm.cc @@ -21,7 +21,7 @@ #include "asm_support_arm.h" #include "base/enums.h" -namespace art { +namespace art HIDDEN { void Thread::InitCpu() { CHECK_EQ(THREAD_FLAGS_OFFSET, ThreadFlagsOffset<PointerSize::k32>().Int32Value()); diff --git a/runtime/arch/arm64/callee_save_frame_arm64.h b/runtime/arch/arm64/callee_save_frame_arm64.h index d3609f1d96..e01df3bf93 100644 --- a/runtime/arch/arm64/callee_save_frame_arm64.h +++ b/runtime/arch/arm64/callee_save_frame_arm64.h @@ -21,11 +21,12 @@ #include "base/bit_utils.h" #include "base/callee_save_type.h" #include "base/enums.h" +#include "base/macros.h" #include "quick/quick_method_frame_info.h" #include "registers_arm64.h" #include "runtime_globals.h" -namespace art { +namespace art HIDDEN { namespace arm64 { // Registers need to be restored but not preserved by aapcs64. diff --git a/runtime/arch/arm64/context_arm64.cc b/runtime/arch/arm64/context_arm64.cc index eca9ed781a..96cd101fe8 100644 --- a/runtime/arch/arm64/context_arm64.cc +++ b/runtime/arch/arm64/context_arm64.cc @@ -30,7 +30,7 @@ extern "C" __attribute__((weak)) void __hwasan_handle_longjmp(const void* sp_dst); -namespace art { +namespace art HIDDEN { namespace arm64 { static constexpr uint64_t gZero = 0; diff --git a/runtime/arch/arm64/context_arm64.h b/runtime/arch/arm64/context_arm64.h index 5ab63c0043..0a284c93d8 100644 --- a/runtime/arch/arm64/context_arm64.h +++ b/runtime/arch/arm64/context_arm64.h @@ -23,7 +23,7 @@ #include "base/macros.h" #include "registers_arm64.h" -namespace art { +namespace art HIDDEN { namespace arm64 { class Arm64Context final : public Context { diff --git a/runtime/arch/arm64/entrypoints_init_arm64.cc b/runtime/arch/arm64/entrypoints_init_arm64.cc index 7db2528a05..41876ec0f1 100644 --- a/runtime/arch/arm64/entrypoints_init_arm64.cc +++ b/runtime/arch/arm64/entrypoints_init_arm64.cc @@ -29,7 +29,7 @@ #include "entrypoints/runtime_asm_entrypoints.h" #include "interpreter/interpreter.h" -namespace art { +namespace art HIDDEN { // Cast entrypoints. extern "C" size_t artInstanceOfFromCode(mirror::Object* obj, mirror::Class* ref_class); diff --git a/runtime/arch/arm64/fault_handler_arm64.cc b/runtime/arch/arm64/fault_handler_arm64.cc index cebff9b9fe..932d6740e8 100644 --- a/runtime/arch/arm64/fault_handler_arm64.cc +++ b/runtime/arch/arm64/fault_handler_arm64.cc @@ -36,7 +36,7 @@ extern "C" void art_quick_implicit_suspend(); // ARM64 specific fault handler functions. // -namespace art { +namespace art HIDDEN { uintptr_t FaultManager::GetFaultPc(siginfo_t* siginfo, void* context) { // SEGV_MTEAERR (Async MTE fault) is delivered at an arbitrary point after the actual fault. diff --git a/runtime/arch/arm64/instruction_set_features_arm64.cc b/runtime/arch/arm64/instruction_set_features_arm64.cc index 93400d9c7c..463b01e868 100644 --- a/runtime/arch/arm64/instruction_set_features_arm64.cc +++ b/runtime/arch/arm64/instruction_set_features_arm64.cc @@ -39,7 +39,7 @@ #include <cpuinfo_aarch64.h> #endif -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/arch/arm64/instruction_set_features_arm64.h b/runtime/arch/arm64/instruction_set_features_arm64.h index 8f0013ac86..cd393be57b 100644 --- a/runtime/arch/arm64/instruction_set_features_arm64.h +++ b/runtime/arch/arm64/instruction_set_features_arm64.h @@ -18,8 +18,9 @@ #define ART_RUNTIME_ARCH_ARM64_INSTRUCTION_SET_FEATURES_ARM64_H_ #include "arch/instruction_set_features.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { // SVE is currently not enabled. static constexpr bool kArm64AllowSVE = false; diff --git a/runtime/arch/arm64/instruction_set_features_arm64_test.cc b/runtime/arch/arm64/instruction_set_features_arm64_test.cc index 0212325924..4d9b7f527e 100644 --- a/runtime/arch/arm64/instruction_set_features_arm64_test.cc +++ b/runtime/arch/arm64/instruction_set_features_arm64_test.cc @@ -18,7 +18,7 @@ #include <gtest/gtest.h> -namespace art { +namespace art HIDDEN { TEST(Arm64InstructionSetFeaturesTest, Arm64Features) { // Build features for an ARM64 processor. diff --git a/runtime/arch/arm64/jni_frame_arm64.h b/runtime/arch/arm64/jni_frame_arm64.h index eff20f4b55..245f84808b 100644 --- a/runtime/arch/arm64/jni_frame_arm64.h +++ b/runtime/arch/arm64/jni_frame_arm64.h @@ -23,8 +23,9 @@ #include "base/bit_utils.h" #include "base/globals.h" #include "base/logging.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace arm64 { constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k64); diff --git a/runtime/arch/arm64/registers_arm64.cc b/runtime/arch/arm64/registers_arm64.cc index ea4383a8d0..bc4c203e9e 100644 --- a/runtime/arch/arm64/registers_arm64.cc +++ b/runtime/arch/arm64/registers_arm64.cc @@ -18,7 +18,7 @@ #include <ostream> -namespace art { +namespace art HIDDEN { namespace arm64 { static const char* kRegisterNames[] = { diff --git a/runtime/arch/arm64/registers_arm64.h b/runtime/arch/arm64/registers_arm64.h index d4c919220d..5d81a42b3d 100644 --- a/runtime/arch/arm64/registers_arm64.h +++ b/runtime/arch/arm64/registers_arm64.h @@ -19,7 +19,9 @@ #include <iosfwd> -namespace art { +#include "base/macros.h" + +namespace art HIDDEN { namespace arm64 { // Values for GP XRegisters - 64bit registers. diff --git a/runtime/arch/arm64/thread_arm64.cc b/runtime/arch/arm64/thread_arm64.cc index 19c4a6ac85..ab9ef16959 100644 --- a/runtime/arch/arm64/thread_arm64.cc +++ b/runtime/arch/arm64/thread_arm64.cc @@ -21,7 +21,7 @@ #include "asm_support_arm64.h" #include "base/enums.h" -namespace art { +namespace art HIDDEN { void Thread::InitCpu() { CHECK_EQ(THREAD_FLAGS_OFFSET, ThreadFlagsOffset<PointerSize::k64>().Int32Value()); diff --git a/runtime/arch/riscv64/callee_save_frame_riscv64.h b/runtime/arch/riscv64/callee_save_frame_riscv64.h index a1c081cc3b..6a2a1678e2 100644 --- a/runtime/arch/riscv64/callee_save_frame_riscv64.h +++ b/runtime/arch/riscv64/callee_save_frame_riscv64.h @@ -21,11 +21,12 @@ #include "base/bit_utils.h" #include "base/callee_save_type.h" #include "base/enums.h" +#include "base/macros.h" #include "quick/quick_method_frame_info.h" #include "registers_riscv64.h" #include "runtime_globals.h" -namespace art { +namespace art HIDDEN { namespace riscv64 { static constexpr uint32_t kRiscv64CalleeSaveAlwaysSpills = diff --git a/runtime/arch/riscv64/context_riscv64.cc b/runtime/arch/riscv64/context_riscv64.cc index f8ac0f922a..c9bfa16156 100644 --- a/runtime/arch/riscv64/context_riscv64.cc +++ b/runtime/arch/riscv64/context_riscv64.cc @@ -25,7 +25,7 @@ extern "C" __attribute__((weak)) void __hwasan_handle_longjmp(const void* sp_dst); -namespace art { +namespace art HIDDEN { namespace riscv64 { static constexpr uint64_t gZero = 0; diff --git a/runtime/arch/riscv64/context_riscv64.h b/runtime/arch/riscv64/context_riscv64.h index 437d6d9d8e..f246876be7 100644 --- a/runtime/arch/riscv64/context_riscv64.h +++ b/runtime/arch/riscv64/context_riscv64.h @@ -25,7 +25,7 @@ #include "base/macros.h" #include "registers_riscv64.h" -namespace art { +namespace art HIDDEN { namespace riscv64 { class Riscv64Context final : public Context { diff --git a/runtime/arch/riscv64/entrypoints_init_riscv64.cc b/runtime/arch/riscv64/entrypoints_init_riscv64.cc index a53c1e3dc8..d75a873c61 100644 --- a/runtime/arch/riscv64/entrypoints_init_riscv64.cc +++ b/runtime/arch/riscv64/entrypoints_init_riscv64.cc @@ -19,7 +19,7 @@ #include "entrypoints/quick/quick_default_init_entrypoints.h" #include "entrypoints/quick/quick_entrypoints.h" -namespace art { +namespace art HIDDEN { // Cast entrypoints. extern "C" size_t artInstanceOfFromCode(mirror::Object* obj, mirror::Class* ref_class); diff --git a/runtime/arch/riscv64/fault_handler_riscv64.cc b/runtime/arch/riscv64/fault_handler_riscv64.cc index 73a6d24fd7..01f09e89df 100644 --- a/runtime/arch/riscv64/fault_handler_riscv64.cc +++ b/runtime/arch/riscv64/fault_handler_riscv64.cc @@ -27,7 +27,7 @@ extern "C" void art_quick_implicit_suspend(); // RISCV64 specific fault handler functions (or stubs if unimplemented yet). -namespace art { +namespace art HIDDEN { uintptr_t FaultManager::GetFaultPc(siginfo_t*, void* context) { ucontext_t* uc = reinterpret_cast<ucontext_t*>(context); diff --git a/runtime/arch/riscv64/instruction_set_features_riscv64.cc b/runtime/arch/riscv64/instruction_set_features_riscv64.cc index 445ab8d753..e7e9ceea51 100644 --- a/runtime/arch/riscv64/instruction_set_features_riscv64.cc +++ b/runtime/arch/riscv64/instruction_set_features_riscv64.cc @@ -23,7 +23,7 @@ #include "android-base/strings.h" #include "base/logging.h" -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/arch/riscv64/instruction_set_features_riscv64.h b/runtime/arch/riscv64/instruction_set_features_riscv64.h index de77bda409..ea679e6c6e 100644 --- a/runtime/arch/riscv64/instruction_set_features_riscv64.h +++ b/runtime/arch/riscv64/instruction_set_features_riscv64.h @@ -18,8 +18,9 @@ #define ART_RUNTIME_ARCH_RISCV64_INSTRUCTION_SET_FEATURES_RISCV64_H_ #include "arch/instruction_set_features.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { class Riscv64InstructionSetFeatures; using Riscv64FeaturesUniquePtr = std::unique_ptr<const Riscv64InstructionSetFeatures>; diff --git a/runtime/arch/riscv64/instruction_set_features_riscv64_test.cc b/runtime/arch/riscv64/instruction_set_features_riscv64_test.cc index 408131696a..d1594cbd84 100644 --- a/runtime/arch/riscv64/instruction_set_features_riscv64_test.cc +++ b/runtime/arch/riscv64/instruction_set_features_riscv64_test.cc @@ -18,7 +18,7 @@ #include <gtest/gtest.h> -namespace art { +namespace art HIDDEN { TEST(Riscv64InstructionSetFeaturesTest, Riscv64FeaturesFromDefaultVariant) { std::string error_msg; diff --git a/runtime/arch/riscv64/jni_frame_riscv64.h b/runtime/arch/riscv64/jni_frame_riscv64.h index 8a7efb2049..29fb6d0deb 100644 --- a/runtime/arch/riscv64/jni_frame_riscv64.h +++ b/runtime/arch/riscv64/jni_frame_riscv64.h @@ -23,8 +23,9 @@ #include "base/bit_utils.h" #include "base/globals.h" #include "base/logging.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace riscv64 { constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k64); diff --git a/runtime/arch/riscv64/registers_riscv64.cc b/runtime/arch/riscv64/registers_riscv64.cc index 9ab3d4d525..822b232ada 100644 --- a/runtime/arch/riscv64/registers_riscv64.cc +++ b/runtime/arch/riscv64/registers_riscv64.cc @@ -18,7 +18,7 @@ #include <ostream> -namespace art { +namespace art HIDDEN { namespace riscv64 { static const char* kXRegisterNames[] = {"zero", "ra", "sp", "gp", "tp", "t0", "t1", "t2", diff --git a/runtime/arch/riscv64/registers_riscv64.h b/runtime/arch/riscv64/registers_riscv64.h index 9cdac173f6..3860a0bcf4 100644 --- a/runtime/arch/riscv64/registers_riscv64.h +++ b/runtime/arch/riscv64/registers_riscv64.h @@ -21,7 +21,7 @@ #include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace riscv64 { enum XRegister { diff --git a/runtime/arch/riscv64/thread_riscv64.cc b/runtime/arch/riscv64/thread_riscv64.cc index cb2d2ad0e7..2865aed95d 100644 --- a/runtime/arch/riscv64/thread_riscv64.cc +++ b/runtime/arch/riscv64/thread_riscv64.cc @@ -18,7 +18,7 @@ #include "base/enums.h" #include "thread.h" -namespace art { +namespace art HIDDEN { void Thread::InitCpu() { CHECK_EQ(THREAD_FLAGS_OFFSET, ThreadFlagsOffset<PointerSize::k64>().Int32Value()); diff --git a/runtime/arch/x86/callee_save_frame_x86.h b/runtime/arch/x86/callee_save_frame_x86.h index 2edcade6f0..81df066194 100644 --- a/runtime/arch/x86/callee_save_frame_x86.h +++ b/runtime/arch/x86/callee_save_frame_x86.h @@ -21,11 +21,12 @@ #include "base/bit_utils.h" #include "base/callee_save_type.h" #include "base/enums.h" +#include "base/macros.h" #include "quick/quick_method_frame_info.h" #include "registers_x86.h" #include "runtime_globals.h" -namespace art { +namespace art HIDDEN { namespace x86 { static constexpr uint32_t kX86CalleeSaveAlwaysSpills = diff --git a/runtime/arch/x86/context_x86.cc b/runtime/arch/x86/context_x86.cc index cff3d7fc75..f4b5e5bd52 100644 --- a/runtime/arch/x86/context_x86.cc +++ b/runtime/arch/x86/context_x86.cc @@ -21,7 +21,7 @@ #include "base/memory_tool.h" #include "quick/quick_method_frame_info.h" -namespace art { +namespace art HIDDEN { namespace x86 { static constexpr uintptr_t gZero = 0; diff --git a/runtime/arch/x86/context_x86.h b/runtime/arch/x86/context_x86.h index 74b537e998..ef2b27196b 100644 --- a/runtime/arch/x86/context_x86.h +++ b/runtime/arch/x86/context_x86.h @@ -23,7 +23,7 @@ #include "base/macros.h" #include "registers_x86.h" -namespace art { +namespace art HIDDEN { namespace x86 { class X86Context final : public Context { diff --git a/runtime/arch/x86/entrypoints_init_x86.cc b/runtime/arch/x86/entrypoints_init_x86.cc index 01853cce72..032e9b84a4 100644 --- a/runtime/arch/x86/entrypoints_init_x86.cc +++ b/runtime/arch/x86/entrypoints_init_x86.cc @@ -24,7 +24,7 @@ #include "entrypoints/runtime_asm_entrypoints.h" #include "interpreter/interpreter.h" -namespace art { +namespace art HIDDEN { // Cast entrypoints. extern "C" size_t art_quick_instance_of(mirror::Object* obj, mirror::Class* ref_class); diff --git a/runtime/arch/x86/fault_handler_x86.cc b/runtime/arch/x86/fault_handler_x86.cc index 998051c0a2..3737491cd4 100644 --- a/runtime/arch/x86/fault_handler_x86.cc +++ b/runtime/arch/x86/fault_handler_x86.cc @@ -69,7 +69,7 @@ // X86 (and X86_64) specific fault handler functions. // -namespace art { +namespace art HIDDEN { extern "C" void art_quick_throw_null_pointer_exception_from_signal(); extern "C" void art_quick_throw_stack_overflow(); diff --git a/runtime/arch/x86/instruction_set_features_x86.cc b/runtime/arch/x86/instruction_set_features_x86.cc index 5420d6a217..7036ad12d5 100644 --- a/runtime/arch/x86/instruction_set_features_x86.cc +++ b/runtime/arch/x86/instruction_set_features_x86.cc @@ -34,7 +34,7 @@ #include <cpuinfo_x86.h> #endif -namespace art { +namespace art HIDDEN { using android::base::StringPrintf; diff --git a/runtime/arch/x86/instruction_set_features_x86.h b/runtime/arch/x86/instruction_set_features_x86.h index 1a8ebb55b4..e6fbc33fdb 100644 --- a/runtime/arch/x86/instruction_set_features_x86.h +++ b/runtime/arch/x86/instruction_set_features_x86.h @@ -18,6 +18,7 @@ #define ART_RUNTIME_ARCH_X86_INSTRUCTION_SET_FEATURES_X86_H_ #include "arch/instruction_set_features.h" +#include "base/macros.h" #define GET_REX_R 0x04 #define GET_REX_X 0x02 @@ -39,7 +40,7 @@ #define THREE_BYTE_VEX 0xC4 #define VEX_INIT 0x00 -namespace art { +namespace art HIDDEN { class X86InstructionSetFeatures; using X86FeaturesUniquePtr = std::unique_ptr<const X86InstructionSetFeatures>; diff --git a/runtime/arch/x86/instruction_set_features_x86_test.cc b/runtime/arch/x86/instruction_set_features_x86_test.cc index c50360ade8..ddfec9a81e 100644 --- a/runtime/arch/x86/instruction_set_features_x86_test.cc +++ b/runtime/arch/x86/instruction_set_features_x86_test.cc @@ -18,7 +18,7 @@ #include <gtest/gtest.h> -namespace art { +namespace art HIDDEN { TEST(X86InstructionSetFeaturesTest, X86FeaturesFromDefaultVariant) { const bool is_runtime_isa = kRuntimeISA == InstructionSet::kX86; diff --git a/runtime/arch/x86/jni_frame_x86.h b/runtime/arch/x86/jni_frame_x86.h index 50114e751d..0d95f50d7a 100644 --- a/runtime/arch/x86/jni_frame_x86.h +++ b/runtime/arch/x86/jni_frame_x86.h @@ -23,8 +23,9 @@ #include "base/bit_utils.h" #include "base/globals.h" #include "base/logging.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace x86 { constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k32); diff --git a/runtime/arch/x86/registers_x86.cc b/runtime/arch/x86/registers_x86.cc index 4255d6457f..e967092243 100644 --- a/runtime/arch/x86/registers_x86.cc +++ b/runtime/arch/x86/registers_x86.cc @@ -18,7 +18,7 @@ #include <ostream> -namespace art { +namespace art HIDDEN { namespace x86 { static const char* kRegisterNames[] = { diff --git a/runtime/arch/x86/registers_x86.h b/runtime/arch/x86/registers_x86.h index ff6c18f6b0..b26c2ab8b7 100644 --- a/runtime/arch/x86/registers_x86.h +++ b/runtime/arch/x86/registers_x86.h @@ -21,7 +21,7 @@ #include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace x86 { enum Register { diff --git a/runtime/arch/x86/thread_x86.cc b/runtime/arch/x86/thread_x86.cc index cca9a914b7..ab49a32898 100644 --- a/runtime/arch/x86/thread_x86.cc +++ b/runtime/arch/x86/thread_x86.cc @@ -39,7 +39,7 @@ struct descriptor_table_entry_t { #include <asm/ldt.h> #endif -namespace art { +namespace art HIDDEN { void Thread::InitCpu() { // Take the ldt lock, Thread::Current isn't yet established. diff --git a/runtime/arch/x86_64/callee_save_frame_x86_64.h b/runtime/arch/x86_64/callee_save_frame_x86_64.h index d4f2da7978..4865461de9 100644 --- a/runtime/arch/x86_64/callee_save_frame_x86_64.h +++ b/runtime/arch/x86_64/callee_save_frame_x86_64.h @@ -21,11 +21,12 @@ #include "base/bit_utils.h" #include "base/callee_save_type.h" #include "base/enums.h" +#include "base/macros.h" #include "quick/quick_method_frame_info.h" #include "registers_x86_64.h" #include "runtime_globals.h" -namespace art { +namespace art HIDDEN { namespace x86_64 { static constexpr uint32_t kX86_64CalleeSaveAlwaysSpills = diff --git a/runtime/arch/x86_64/context_x86_64.cc b/runtime/arch/x86_64/context_x86_64.cc index ab3b2c50cb..196f29f31d 100644 --- a/runtime/arch/x86_64/context_x86_64.cc +++ b/runtime/arch/x86_64/context_x86_64.cc @@ -20,7 +20,7 @@ #include "base/bit_utils_iterator.h" #include "quick/quick_method_frame_info.h" -namespace art { +namespace art HIDDEN { namespace x86_64 { static constexpr uintptr_t gZero = 0; diff --git a/runtime/arch/x86_64/context_x86_64.h b/runtime/arch/x86_64/context_x86_64.h index 1e2658cb95..19e5f57345 100644 --- a/runtime/arch/x86_64/context_x86_64.h +++ b/runtime/arch/x86_64/context_x86_64.h @@ -23,7 +23,7 @@ #include "base/macros.h" #include "registers_x86_64.h" -namespace art { +namespace art HIDDEN { namespace x86_64 { class X86_64Context final : public Context { diff --git a/runtime/arch/x86_64/entrypoints_init_x86_64.cc b/runtime/arch/x86_64/entrypoints_init_x86_64.cc index bf98979754..f48ff9b541 100644 --- a/runtime/arch/x86_64/entrypoints_init_x86_64.cc +++ b/runtime/arch/x86_64/entrypoints_init_x86_64.cc @@ -27,7 +27,7 @@ #include "entrypoints/runtime_asm_entrypoints.h" #include "interpreter/interpreter.h" -namespace art { +namespace art HIDDEN { // Cast entrypoints. extern "C" size_t art_quick_instance_of(mirror::Object* obj, mirror::Class* ref_class); diff --git a/runtime/arch/x86_64/instruction_set_features_x86_64.h b/runtime/arch/x86_64/instruction_set_features_x86_64.h index 9b90365c41..e0d4cc3c69 100644 --- a/runtime/arch/x86_64/instruction_set_features_x86_64.h +++ b/runtime/arch/x86_64/instruction_set_features_x86_64.h @@ -18,8 +18,9 @@ #define ART_RUNTIME_ARCH_X86_64_INSTRUCTION_SET_FEATURES_X86_64_H_ #include "arch/x86/instruction_set_features_x86.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { class X86_64InstructionSetFeatures; using X86_64FeaturesUniquePtr = std::unique_ptr<const X86_64InstructionSetFeatures>; diff --git a/runtime/arch/x86_64/instruction_set_features_x86_64_test.cc b/runtime/arch/x86_64/instruction_set_features_x86_64_test.cc index 320105045d..3db81cdcc2 100644 --- a/runtime/arch/x86_64/instruction_set_features_x86_64_test.cc +++ b/runtime/arch/x86_64/instruction_set_features_x86_64_test.cc @@ -18,7 +18,7 @@ #include <gtest/gtest.h> -namespace art { +namespace art HIDDEN { TEST(X86_64InstructionSetFeaturesTest, X86Features) { const bool is_runtime_isa = kRuntimeISA == InstructionSet::kX86_64; diff --git a/runtime/arch/x86_64/jni_frame_x86_64.h b/runtime/arch/x86_64/jni_frame_x86_64.h index a14d43914a..1e16f5f016 100644 --- a/runtime/arch/x86_64/jni_frame_x86_64.h +++ b/runtime/arch/x86_64/jni_frame_x86_64.h @@ -23,8 +23,9 @@ #include "base/bit_utils.h" #include "base/globals.h" #include "base/logging.h" +#include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace x86_64 { constexpr size_t kFramePointerSize = static_cast<size_t>(PointerSize::k64); diff --git a/runtime/arch/x86_64/registers_x86_64.cc b/runtime/arch/x86_64/registers_x86_64.cc index f29c42652b..50c382daca 100644 --- a/runtime/arch/x86_64/registers_x86_64.cc +++ b/runtime/arch/x86_64/registers_x86_64.cc @@ -18,7 +18,7 @@ #include <ostream> -namespace art { +namespace art HIDDEN { namespace x86_64 { static const char* kRegisterNames[] = { diff --git a/runtime/arch/x86_64/registers_x86_64.h b/runtime/arch/x86_64/registers_x86_64.h index 248c82b694..511eecceef 100644 --- a/runtime/arch/x86_64/registers_x86_64.h +++ b/runtime/arch/x86_64/registers_x86_64.h @@ -21,7 +21,7 @@ #include "base/macros.h" -namespace art { +namespace art HIDDEN { namespace x86_64 { enum Register { diff --git a/runtime/arch/x86_64/thread_x86_64.cc b/runtime/arch/x86_64/thread_x86_64.cc index b01a1d3f1a..d157bc6332 100644 --- a/runtime/arch/x86_64/thread_x86_64.cc +++ b/runtime/arch/x86_64/thread_x86_64.cc @@ -31,7 +31,7 @@ #include <zircon/syscalls/object.h> #endif -namespace art { +namespace art HIDDEN { #if defined(__linux__) static void arch_prctl(int code, void* val) { diff --git a/runtime/fault_handler.cc b/runtime/fault_handler.cc index af311d23cf..43dee0e6e8 100644 --- a/runtime/fault_handler.cc +++ b/runtime/fault_handler.cc @@ -38,7 +38,7 @@ #include "thread-current-inl.h" #include "verify_object-inl.h" -namespace art { +namespace art HIDDEN { // Static fault manger object accessed by signal handler. FaultManager fault_manager; diff --git a/runtime/fault_handler.h b/runtime/fault_handler.h index 6be1743925..4d9c3f5271 100644 --- a/runtime/fault_handler.h +++ b/runtime/fault_handler.h @@ -25,10 +25,11 @@ #include <vector> #include "base/locks.h" // For annotalysis. +#include "base/macros.h" #include "base/mutex.h" #include "runtime_globals.h" // For CanDoImplicitNullCheckOn. -namespace art { +namespace art HIDDEN { class ArtMethod; class FaultHandler; @@ -55,8 +56,8 @@ class FaultManager { bool HandleSigbusFault(int sig, siginfo_t* info, void* context); // Added handlers are owned by the fault handler and will be freed on Shutdown(). - void AddHandler(FaultHandler* handler, bool generated_code); - void RemoveHandler(FaultHandler* handler); + EXPORT void AddHandler(FaultHandler* handler, bool generated_code); + EXPORT void RemoveHandler(FaultHandler* handler); void AddGeneratedCodeRange(const void* start, size_t size); void RemoveGeneratedCodeRange(const void* start, size_t size) @@ -120,7 +121,7 @@ class FaultManager { class FaultHandler { public: - explicit FaultHandler(FaultManager* manager); + EXPORT explicit FaultHandler(FaultManager* manager); virtual ~FaultHandler() {} FaultManager* GetFaultManager() { return manager_; @@ -196,8 +197,8 @@ class JavaStackTraceHandler final : public FaultHandler { }; // Statically allocated so the the signal handler can Get access to it. -extern FaultManager fault_manager; +EXPORT extern FaultManager fault_manager; -} // namespace art +} // namespace art #endif // ART_RUNTIME_FAULT_HANDLER_H_ diff --git a/runtime/thread-inl.h b/runtime/thread-inl.h index 65049f1500..d8f68c4080 100644 --- a/runtime/thread-inl.h +++ b/runtime/thread-inl.h @@ -32,7 +32,7 @@ #include "thread_list.h" #include "thread_pool.h" -namespace art { +namespace art HIDDEN { // Quickly access the current thread from a JNIEnv. inline Thread* Thread::ForEnv(JNIEnv* env) { diff --git a/runtime/thread.cc b/runtime/thread.cc index 16c7c1531d..719ecfbf9c 100644 --- a/runtime/thread.cc +++ b/runtime/thread.cc @@ -127,7 +127,7 @@ extern "C" __attribute__((weak)) void* __hwasan_tag_pointer(const volatile void* p, unsigned char tag); -namespace art { +namespace art HIDDEN { using android::base::StringAppendV; using android::base::StringPrintf; diff --git a/runtime/thread.h b/runtime/thread.h index 6a006be985..49e9952e70 100644 --- a/runtime/thread.h +++ b/runtime/thread.h @@ -54,7 +54,7 @@ namespace unwindstack { class AndroidLocalUnwinder; } // namespace unwindstack -namespace art { +namespace art HIDDEN { namespace gc { namespace accounting { @@ -255,7 +255,7 @@ static constexpr size_t kSharedMethodHotnessThreshold = 0x1fff; // if the thread makes a call out to a native function (through JNI), that native function // might only have 4K of memory (if the SP is adjacent to stack_end). -class Thread { +class EXPORT Thread { public: static const size_t kStackOverflowImplicitCheckSize; static constexpr bool kVerifyStack = kIsDebugBuild; @@ -2461,9 +2461,9 @@ class ThreadLifecycleCallback { // Store an exception from the thread and suppress it for the duration of this object. class ScopedExceptionStorage { public: - explicit ScopedExceptionStorage(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT explicit ScopedExceptionStorage(Thread* self) REQUIRES_SHARED(Locks::mutator_lock_); void SuppressOldException(const char* message = "") REQUIRES_SHARED(Locks::mutator_lock_); - ~ScopedExceptionStorage() REQUIRES_SHARED(Locks::mutator_lock_); + EXPORT ~ScopedExceptionStorage() REQUIRES_SHARED(Locks::mutator_lock_); private: Thread* self_; @@ -2471,7 +2471,7 @@ class ScopedExceptionStorage { MutableHandle<mirror::Throwable> excp_; }; -std::ostream& operator<<(std::ostream& os, const Thread& thread); +EXPORT std::ostream& operator<<(std::ostream& os, const Thread& thread); std::ostream& operator<<(std::ostream& os, StackedShadowFrameType thread); } // namespace art diff --git a/runtime/thread_android.cc b/runtime/thread_android.cc index 00604a9656..5135d3c243 100644 --- a/runtime/thread_android.cc +++ b/runtime/thread_android.cc @@ -21,7 +21,7 @@ #include "base/bit_utils.h" #include "thread.h" -namespace art { +namespace art HIDDEN { void Thread::SetUpAlternateSignalStack() { // Bionic does this for us. diff --git a/runtime/thread_linux.cc b/runtime/thread_linux.cc index afce796086..860d0e530e 100644 --- a/runtime/thread_linux.cc +++ b/runtime/thread_linux.cc @@ -21,7 +21,7 @@ #include "base/logging.h" // For VLOG. #include "base/utils.h" -namespace art { +namespace art HIDDEN { static void SigAltStack(stack_t* new_stack, stack_t* old_stack) { if (sigaltstack(new_stack, old_stack) == -1) { diff --git a/tools/generate_operator_out.py b/tools/generate_operator_out.py index f3de61c134..e4d66befa1 100755 --- a/tools/generate_operator_out.py +++ b/tools/generate_operator_out.py @@ -22,7 +22,7 @@ import sys _ENUM_START_RE = re.compile( - r'\benum\b\s+(class\s+)?(\S+)\s+:?.*\{(\s+// private)?') + r'\benum\b\s+(class\s+)?(?:HIDDEN |EXPORT )?(\S+)\s+:?.*\{(\s+// private)?') _ENUM_VALUE_RE = re.compile(r'([A-Za-z0-9_]+)(.*)') _ENUM_END_RE = re.compile(r'^\s*\};$') _ENUMS = {} @@ -76,7 +76,7 @@ def ProcessFile(filename): # Is this the start or end of an enclosing class or struct? m = re.search( - r'^\s*(?:class|struct)(?: MANAGED)?(?: PACKED\([0-9]\))? (\S+).* \{', raw_line) + r'^\s*(?:class|struct)(?: HIDDEN| EXPORT)?(?: MANAGED)?(?: PACKED\([0-9]\))? (\S+).* \{', raw_line) if m: enclosing_classes.append(m.group(1)) continue |