Skip to content

Commit

Permalink
Make remaining compiler/ symbols hidden.
Browse files Browse the repository at this point in the history
And mark required symbols with EXPORT.

Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing --jit
Change-Id: I1b4e3c1ef9006924456dc36ec906bf74b62adab4
  • Loading branch information
vmarko committed Nov 18, 2022
1 parent b1baa73 commit bdbee06
Show file tree
Hide file tree
Showing 26 changed files with 58 additions and 45 deletions.
3 changes: 2 additions & 1 deletion compiler/cfi_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@

#include "arch/instruction_set.h"
#include "base/enums.h"
#include "base/macros.h"
#include "debug/dwarf/dwarf_test.h"
#include "disassembler.h"
#include "dwarf/dwarf_constants.h"
#include "dwarf/headers.h"
#include "gtest/gtest.h"
#include "thread.h"

namespace art {
namespace art HIDDEN {

class CFITest : public dwarf::DwarfTest {
public:
Expand Down
2 changes: 1 addition & 1 deletion compiler/common_compiler_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
#include "thread-current-inl.h"
#include "utils/atomic_dex_ref_map-inl.h"

namespace art {
namespace art HIDDEN {

class CommonCompilerTestImpl::CodeAndMetadata {
public:
Expand Down
6 changes: 4 additions & 2 deletions compiler/common_compiler_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@

#include "arch/instruction_set.h"
#include "arch/instruction_set_features.h"
#include "base/macros.h"
#include "common_runtime_test.h"
#include "compiler.h"
#include "oat_file.h"

namespace art {
namespace art HIDDEN {
namespace mirror {
class ClassLoader;
} // namespace mirror
Expand All @@ -40,7 +41,8 @@ class TimingLogger;

template<class T> class Handle;

class CommonCompilerTestImpl {
// Export all symbols in `CommonCompilerTestImpl` for dex2oat tests.
class EXPORT CommonCompilerTestImpl {
public:
static std::unique_ptr<CompilerOptions> CreateCompilerOptions(InstructionSet instruction_set,
const std::string& variant);
Expand Down
2 changes: 1 addition & 1 deletion compiler/compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "oat.h"
#include "optimizing/optimizing_compiler.h"

namespace art {
namespace art HIDDEN {

Compiler* Compiler::Create(const CompilerOptions& compiler_options,
CompiledCodeStorage* storage,
Expand Down
9 changes: 5 additions & 4 deletions compiler/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef ART_COMPILER_COMPILER_H_
#define ART_COMPILER_COMPILER_H_

#include "base/macros.h"
#include "base/mutex.h"
#include "base/os.h"
#include "compilation_kind.h"
#include "dex/invoke_type.h"

namespace art {
namespace art HIDDEN {

namespace dex {
struct CodeItem;
Expand Down Expand Up @@ -52,9 +53,9 @@ class Compiler {
kOptimizing
};

static Compiler* Create(const CompilerOptions& compiler_options,
CompiledCodeStorage* storage,
Kind kind);
EXPORT static Compiler* Create(const CompilerOptions& compiler_options,
CompiledCodeStorage* storage,
Kind kind);

virtual bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file) const = 0;

Expand Down
3 changes: 2 additions & 1 deletion compiler/compiler_reflection_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@

#include "reflection.h"

#include "base/macros.h"
#include "class_linker.h"
#include "common_compiler_test.h"
#include "handle_scope-inl.h"
#include "jni/jni_internal.h"
#include "mirror/class.h"
#include "mirror/class_loader.h"

namespace art {
namespace art HIDDEN {

class CompilerReflectionTest : public CommonCompilerTest {};

Expand Down
2 changes: 1 addition & 1 deletion compiler/dex/inline_method_analyser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* only to allow the debugger to check whether a method has been inlined.
*/

namespace art {
namespace art HIDDEN {

namespace { // anonymous namespace

Expand Down
2 changes: 1 addition & 1 deletion compiler/dex/inline_method_analyser.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* only to allow the debugger to check whether a method has been inlined.
*/

namespace art {
namespace art HIDDEN {

class CodeItemDataAccessor;

Expand Down
3 changes: 2 additions & 1 deletion compiler/driver/compiled_code_storage.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
#include <string>

#include "base/array_ref.h"
#include "base/macros.h"

namespace art {
namespace art HIDDEN {

namespace linker {
class LinkerPatch;
Expand Down
2 changes: 1 addition & 1 deletion compiler/driver/compiler_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#include "scoped_thread_state_change-inl.h"
#include "simple_compiler_options_map.h"

namespace art {
namespace art HIDDEN {

CompilerOptions::CompilerOptions()
: compiler_filter_(CompilerFilter::kDefaultCompilerFilter),
Expand Down
16 changes: 8 additions & 8 deletions compiler/driver/compiler_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "base/utils.h"
#include "optimizing/register_allocator.h"

namespace art {
namespace art HIDDEN {

namespace jit {
class JitCompiler;
Expand Down Expand Up @@ -83,8 +83,8 @@ class CompilerOptions final {
kAppImage, // Creating app image.
};

CompilerOptions();
~CompilerOptions();
EXPORT CompilerOptions();
EXPORT ~CompilerOptions();

CompilerFilter::Filter GetCompilerFilter() const {
return compiler_filter_;
Expand Down Expand Up @@ -298,11 +298,11 @@ class CompilerOptions final {
return image_classes_;
}

bool IsImageClass(const char* descriptor) const;
EXPORT bool IsImageClass(const char* descriptor) const;

// Returns whether the given `pretty_descriptor` is in the list of preloaded
// classes. `pretty_descriptor` should be the result of calling `PrettyDescriptor`.
bool IsPreloadedClass(const char* pretty_descriptor) const;
EXPORT bool IsPreloadedClass(const char* pretty_descriptor) const;

bool ParseCompilerOptions(const std::vector<std::string>& options,
bool ignore_unrecognized,
Expand Down Expand Up @@ -389,11 +389,11 @@ class CompilerOptions final {
// initialized at compile-time, or won't be initialized by the zygote, add
// initialization checks at entry. This will avoid the need of trampolines
// which at runtime we will need to dirty after initialization.
bool ShouldCompileWithClinitCheck(ArtMethod* method) const;
EXPORT bool ShouldCompileWithClinitCheck(ArtMethod* method) const;

private:
bool ParseDumpInitFailures(const std::string& option, std::string* error_msg);
bool ParseRegisterAllocationStrategy(const std::string& option, std::string* error_msg);
EXPORT bool ParseDumpInitFailures(const std::string& option, std::string* error_msg);
EXPORT bool ParseRegisterAllocationStrategy(const std::string& option, std::string* error_msg);

CompilerFilter::Filter compiler_filter_;
size_t huge_method_threshold_;
Expand Down
2 changes: 1 addition & 1 deletion compiler/driver/compiler_options_map-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "cmdline_parser.h"
#include "compiler_options.h"

namespace art {
namespace art HIDDEN {

template <>
struct CmdlineType<CompilerFilter::Filter> : CmdlineTypeParser<CompilerFilter::Filter> {
Expand Down
3 changes: 2 additions & 1 deletion compiler/driver/compiler_options_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@
#include <vector>

#include "base/compiler_filter.h"
#include "base/macros.h"
#include "base/variant_map.h"
#include "cmdline_types.h"

namespace art {
namespace art HIDDEN {

enum class ProfileMethodsCheck : uint8_t;

Expand Down
2 changes: 1 addition & 1 deletion compiler/driver/dex_compilation_unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "mirror/dex_cache.h"
#include "scoped_thread_state_change-inl.h"

namespace art {
namespace art HIDDEN {

DexCompilationUnit::DexCompilationUnit(Handle<mirror::ClassLoader> class_loader,
ClassLinker* class_linker,
Expand Down
3 changes: 2 additions & 1 deletion compiler/driver/dex_compilation_unit.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@
#include <stdint.h>

#include "base/arena_object.h"
#include "base/macros.h"
#include "dex/code_item_accessors.h"
#include "dex/dex_file.h"
#include "handle.h"

namespace art {
namespace art HIDDEN {
namespace mirror {
class Class;
class ClassLoader;
Expand Down
3 changes: 2 additions & 1 deletion compiler/driver/simple_compiler_options_map.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
#include <memory>

#include "compiler_options_map-inl.h"
#include "base/macros.h"
#include "base/variant_map.h"

namespace art {
namespace art HIDDEN {

template <typename TValue>
struct SimpleParseArgumentMapKey : VariantMapKey<TValue> {
Expand Down
3 changes: 2 additions & 1 deletion compiler/exception_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "base/callee_save_type.h"
#include "base/enums.h"
#include "base/leb128.h"
#include "base/macros.h"
#include "base/malloc_arena_pool.h"
#include "class_linker.h"
#include "common_runtime_test.h"
Expand All @@ -44,7 +45,7 @@
#include "scoped_thread_state_change-inl.h"
#include "thread.h"

namespace art {
namespace art HIDDEN {

class ExceptionTest : public CommonRuntimeTest {
protected:
Expand Down
4 changes: 2 additions & 2 deletions compiler/jit/jit_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include "jit/jit_code_cache.h"
#include "jit/jit_logger.h"

namespace art {
namespace art HIDDEN {
namespace jit {

JitCompiler* JitCompiler::Create() {
Expand Down Expand Up @@ -125,7 +125,7 @@ void JitCompiler::ParseCompilerOptions() {
}
}

extern "C" JitCompilerInterface* jit_load() {
EXPORT extern "C" JitCompilerInterface* jit_load() {
VLOG(jit) << "Create jit compiler";
auto* const jit_compiler = JitCompiler::Create();
CHECK(jit_compiler != nullptr);
Expand Down
3 changes: 2 additions & 1 deletion compiler/jit/jit_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@
#ifndef ART_COMPILER_JIT_JIT_COMPILER_H_
#define ART_COMPILER_JIT_JIT_COMPILER_H_

#include "base/macros.h"
#include "base/mutex.h"
#include "compilation_kind.h"

#include "jit/jit.h"

namespace art {
namespace art HIDDEN {

class ArtMethod;
class Compiler;
Expand Down
2 changes: 1 addition & 1 deletion compiler/jit/jit_logger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "jit/jit_code_cache.h"
#include "oat_file-inl.h"

namespace art {
namespace art HIDDEN {
namespace jit {

#ifdef ART_TARGET_ANDROID
Expand Down
3 changes: 2 additions & 1 deletion compiler/jit/jit_logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@

#include <memory>

#include "base/macros.h"
#include "base/mutex.h"
#include "base/os.h"

namespace art {
namespace art HIDDEN {

class ArtMethod;

Expand Down
5 changes: 3 additions & 2 deletions compiler/linker/linker_patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@
#include <android-base/logging.h>

#include "base/bit_utils.h"
#include "base/macros.h"
#include "dex/method_reference.h"

namespace art {
namespace art HIDDEN {

class DexFile;

Expand Down Expand Up @@ -328,7 +329,7 @@ class LinkerPatch {
friend bool operator==(const LinkerPatch& lhs, const LinkerPatch& rhs);
friend bool operator<(const LinkerPatch& lhs, const LinkerPatch& rhs);
};
std::ostream& operator<<(std::ostream& os, LinkerPatch::Type type);
EXPORT std::ostream& operator<<(std::ostream& os, LinkerPatch::Type type);

inline bool operator==(const LinkerPatch& lhs, const LinkerPatch& rhs) {
return lhs.literal_offset_ == rhs.literal_offset_ &&
Expand Down
3 changes: 2 additions & 1 deletion compiler/linker/linker_patch_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@

#include <gtest/gtest.h>

#include "base/macros.h"
#include "linker_patch.h"

namespace art {
namespace art HIDDEN {
namespace linker {

TEST(LinkerPatch, LinkerPatchOperators) {
Expand Down
2 changes: 1 addition & 1 deletion compiler/linker/output_stream_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "stream/file_output_stream.h"
#include "stream/vector_output_stream.h"

namespace art {
namespace art HIDDEN {
namespace linker {

class OutputStreamTest : public CommonArtTest {
Expand Down
2 changes: 1 addition & 1 deletion compiler/trampolines/trampoline_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

#define __ assembler.

namespace art {
namespace art HIDDEN {

#ifdef ART_ENABLE_CODEGEN_arm
namespace arm {
Expand Down
13 changes: 6 additions & 7 deletions compiler/trampolines/trampoline_compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
#include <vector>

#include "arch/instruction_set.h"
#include "base/macros.h"
#include "offsets.h"

namespace art {
namespace art HIDDEN {

enum EntryPointCallingConvention {
// ABI of invocations to a method's interpreter entry point.
Expand All @@ -36,12 +37,10 @@ enum EntryPointCallingConvention {
};

// Create code that will invoke the function held in thread local storage.
std::unique_ptr<const std::vector<uint8_t>> CreateTrampoline32(InstructionSet isa,
EntryPointCallingConvention abi,
ThreadOffset32 entry_point_offset);
std::unique_ptr<const std::vector<uint8_t>> CreateTrampoline64(InstructionSet isa,
EntryPointCallingConvention abi,
ThreadOffset64 entry_point_offset);
EXPORT std::unique_ptr<const std::vector<uint8_t>> CreateTrampoline32(
InstructionSet isa, EntryPointCallingConvention abi, ThreadOffset32 entry_point_offset);
EXPORT std::unique_ptr<const std::vector<uint8_t>> CreateTrampoline64(
InstructionSet isa, EntryPointCallingConvention abi, ThreadOffset64 entry_point_offset);

} // namespace art

Expand Down

0 comments on commit bdbee06

Please sign in to comment.