diff options
author | 2017-04-24 17:59:09 -0700 | |
---|---|---|
committer | 2017-05-30 16:26:35 -0700 | |
commit | d482e73fe26cb9161511a80e3db39e08b9808ab6 (patch) | |
tree | 0b8c874f24c211e4e3d87083f8017580aa23ff63 | |
parent | a14100ccf51cc63a5c472188d1e2d337627e49eb (diff) |
ART: More header cleanup - runtime.h
Remove unnecessary runtime.h includes. Refactor other headers
(move to forward declarations) to make this possible.
Test: mmma art
Change-Id: I297f0ad444ba92169edd16d8c7cbe95bb6dbb800
-rw-r--r-- | cmdline/cmdline_parser_test.cc | 1 | ||||
-rw-r--r-- | cmdline/cmdline_types.h | 2 | ||||
-rw-r--r-- | compiler/driver/compiler_driver-inl.h | 8 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.h | 7 | ||||
-rw-r--r-- | compiler/oat_writer.cc | 2 | ||||
-rw-r--r-- | compiler/verifier_deps_test.cc | 2 | ||||
-rw-r--r-- | runtime/class_linker.h | 1 | ||||
-rw-r--r-- | runtime/class_table.h | 5 | ||||
-rw-r--r-- | runtime/gc/space/image_space.cc | 1 | ||||
-rw-r--r-- | runtime/gc/space/image_space.h | 1 | ||||
-rw-r--r-- | runtime/mirror/class_loader.h | 1 | ||||
-rw-r--r-- | runtime/mirror/field-inl.h | 1 | ||||
-rw-r--r-- | runtime/mirror/reference.h | 3 | ||||
-rw-r--r-- | runtime/runtime-inl.h | 2 | ||||
-rw-r--r-- | runtime/runtime.cc | 1 | ||||
-rw-r--r-- | runtime/runtime.h | 4 | ||||
-rw-r--r-- | runtime/ti/agent.h | 3 | ||||
-rw-r--r-- | runtime/verifier/method_verifier.h | 5 | ||||
-rw-r--r-- | runtime/verifier/reg_type_cache-inl.h | 37 | ||||
-rw-r--r-- | runtime/verifier/reg_type_cache.h | 76 | ||||
-rw-r--r-- | test/137-cfi/cfi.cc | 1 |
21 files changed, 99 insertions, 65 deletions
diff --git a/cmdline/cmdline_parser_test.cc b/cmdline/cmdline_parser_test.cc index 1a2b9cde67..9f12f64a31 100644 --- a/cmdline/cmdline_parser_test.cc +++ b/cmdline/cmdline_parser_test.cc @@ -22,6 +22,7 @@ #include <numeric> #include "gtest/gtest.h" #include "runtime/experimental_flags.h" +#include "runtime/runtime.h" #define EXPECT_NULL(expected) EXPECT_EQ(reinterpret_cast<const void*>(expected), \ reinterpret_cast<void*>(nullptr)); diff --git a/cmdline/cmdline_types.h b/cmdline/cmdline_types.h index e33a2070dd..0d2aed8ad1 100644 --- a/cmdline/cmdline_types.h +++ b/cmdline/cmdline_types.h @@ -18,6 +18,8 @@ #define CMDLINE_NDEBUG 1 // Do not output any debugging information for parsing. +#include <list> + #include "memory_representation.h" #include "detail/cmdline_debug_detail.h" #include "cmdline_type_parser.h" diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h index 582330611d..8cc1cc38e2 100644 --- a/compiler/driver/compiler_driver-inl.h +++ b/compiler/driver/compiler_driver-inl.h @@ -24,10 +24,11 @@ #include "base/enums.h" #include "class_linker-inl.h" #include "dex_compilation_unit.h" +#include "handle_scope-inl.h" #include "mirror/class_loader.h" #include "mirror/dex_cache-inl.h" +#include "runtime.h" #include "scoped_thread_state_change-inl.h" -#include "handle_scope-inl.h" namespace art { @@ -149,6 +150,11 @@ inline ArtMethod* CompilerDriver::ResolveMethod( return resolved_method; } +inline VerificationResults* CompilerDriver::GetVerificationResults() const { + DCHECK(Runtime::Current()->IsAotCompiler()); + return verification_results_; +} + } // namespace art #endif // ART_COMPILER_DRIVER_COMPILER_DRIVER_INL_H_ diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index e0d97b7c16..17c20b48b0 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -38,7 +38,6 @@ #include "method_reference.h" #include "mirror/class.h" // For mirror::Class::Status. #include "os.h" -#include "runtime.h" #include "safe_map.h" #include "thread_pool.h" #include "utils/atomic_method_ref_map.h" @@ -61,6 +60,7 @@ class CompilerOptions; class DexCompilationUnit; struct InlineIGetIPutData; class InstructionSetFeatures; +class InternTable; class ParallelCompilationManager; class ScopedObjectAccess; template <class Allocator> class SrcMap; @@ -131,10 +131,7 @@ class CompilerDriver { REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!compiled_classes_lock_, !dex_to_dex_references_lock_); - VerificationResults* GetVerificationResults() const { - DCHECK(Runtime::Current()->IsAotCompiler()); - return verification_results_; - } + VerificationResults* GetVerificationResults() const; InstructionSet GetInstructionSet() const { return instruction_set_; diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc index bc411dfc6d..fed2d34cdb 100644 --- a/compiler/oat_writer.cc +++ b/compiler/oat_writer.cc @@ -33,7 +33,7 @@ #include "dex/verification_results.h" #include "dex_file-inl.h" #include "dexlayout.h" -#include "driver/compiler_driver.h" +#include "driver/compiler_driver-inl.h" #include "driver/compiler_options.h" #include "gc/space/image_space.h" #include "gc/space/space.h" diff --git a/compiler/verifier_deps_test.cc b/compiler/verifier_deps_test.cc index 4d55eb08b2..dd09fed06e 100644 --- a/compiler/verifier_deps_test.cc +++ b/compiler/verifier_deps_test.cc @@ -25,8 +25,8 @@ #include "dex/verified_method.h" #include "dex_file.h" #include "dex_file_types.h" +#include "driver/compiler_driver-inl.h" #include "driver/compiler_options.h" -#include "driver/compiler_driver.h" #include "handle_scope-inl.h" #include "indenter.h" #include "mirror/class_loader.h" diff --git a/runtime/class_linker.h b/runtime/class_linker.h index 7f652ecc94..3d4bbc3d4e 100644 --- a/runtime/class_linker.h +++ b/runtime/class_linker.h @@ -64,6 +64,7 @@ class ImtConflictTable; template<typename T> class LengthPrefixedArray; template<class T> class MutableHandle; class InternTable; +class LinearAlloc; class OatFile; template<class T> class ObjectLock; class Runtime; diff --git a/runtime/class_table.h b/runtime/class_table.h index 430edbba4e..8616dfba93 100644 --- a/runtime/class_table.h +++ b/runtime/class_table.h @@ -25,18 +25,17 @@ #include "base/hash_set.h" #include "base/macros.h" #include "base/mutex.h" -#include "dex_file.h" #include "gc_root.h" #include "obj_ptr.h" -#include "object_callbacks.h" -#include "runtime.h" namespace art { class OatFile; namespace mirror { + class Class; class ClassLoader; + class Object; } // namespace mirror // Each loader has a ClassTable diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc index 748d378e76..b6bff5b17c 100644 --- a/runtime/gc/space/image_space.cc +++ b/runtime/gc/space/image_space.cc @@ -42,6 +42,7 @@ #include "mirror/object-refvisitor-inl.h" #include "oat_file.h" #include "os.h" +#include "runtime.h" #include "space-inl.h" #include "utils.h" diff --git a/runtime/gc/space/image_space.h b/runtime/gc/space/image_space.h index aa3dd42416..a4065bf6d6 100644 --- a/runtime/gc/space/image_space.h +++ b/runtime/gc/space/image_space.h @@ -19,7 +19,6 @@ #include "arch/instruction_set.h" #include "gc/accounting/space_bitmap.h" -#include "runtime.h" #include "space.h" namespace art { diff --git a/runtime/mirror/class_loader.h b/runtime/mirror/class_loader.h index a62a460d81..6e1f44bb46 100644 --- a/runtime/mirror/class_loader.h +++ b/runtime/mirror/class_loader.h @@ -23,6 +23,7 @@ namespace art { struct ClassLoaderOffsets; class ClassTable; +class LinearAlloc; namespace mirror { diff --git a/runtime/mirror/field-inl.h b/runtime/mirror/field-inl.h index 2496989337..d33df5c8e7 100644 --- a/runtime/mirror/field-inl.h +++ b/runtime/mirror/field-inl.h @@ -21,7 +21,6 @@ #include "art_field-inl.h" #include "mirror/dex_cache-inl.h" -#include "runtime-inl.h" namespace art { diff --git a/runtime/mirror/reference.h b/runtime/mirror/reference.h index f2fa589500..cfcbd5ae1f 100644 --- a/runtime/mirror/reference.h +++ b/runtime/mirror/reference.h @@ -22,10 +22,7 @@ #include "gc_root.h" #include "obj_ptr.h" #include "object.h" -#include "object_callbacks.h" #include "read_barrier_option.h" -#include "runtime.h" -#include "thread.h" namespace art { diff --git a/runtime/runtime-inl.h b/runtime/runtime-inl.h index 75c25dd21d..9281577b3e 100644 --- a/runtime/runtime-inl.h +++ b/runtime/runtime-inl.h @@ -20,10 +20,8 @@ #include "runtime.h" #include "art_method.h" -#include "class_linker.h" #include "gc_root-inl.h" #include "obj_ptr-inl.h" -#include "read_barrier-inl.h" namespace art { diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 968f02a359..74e291e2d0 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -134,6 +134,7 @@ #include "native_stack_dump.h" #include "oat_file.h" #include "oat_file_manager.h" +#include "object_callbacks.h" #include "os.h" #include "parsed_options.h" #include "jit/profile_saver.h" diff --git a/runtime/runtime.h b/runtime/runtime.h index 4e143e0f64..992c5c827f 100644 --- a/runtime/runtime.h +++ b/runtime/runtime.h @@ -34,10 +34,7 @@ #include "experimental_flags.h" #include "gc_root.h" #include "instrumentation.h" -#include "jobject_comparator.h" -#include "method_reference.h" #include "obj_ptr.h" -#include "object_callbacks.h" #include "offsets.h" #include "process_state.h" #include "quick/quick_method_frame_info.h" @@ -79,6 +76,7 @@ class ClassLinker; class CompilerCallbacks; class DexFile; class InternTable; +class IsMarkedVisitor; class JavaVMExt; class LinearAlloc; class MemMap; diff --git a/runtime/ti/agent.h b/runtime/ti/agent.h index b5ecba19d9..f98e3878cc 100644 --- a/runtime/ti/agent.h +++ b/runtime/ti/agent.h @@ -20,8 +20,7 @@ #include <dlfcn.h> #include <jni.h> // for jint, JavaVM* etc declarations -#include "runtime.h" -#include "utils.h" +#include "base/logging.h" namespace art { namespace ti { diff --git a/runtime/verifier/method_verifier.h b/runtime/verifier/method_verifier.h index b34a3afd2e..9ef98f70e4 100644 --- a/runtime/verifier/method_verifier.h +++ b/runtime/verifier/method_verifier.h @@ -37,12 +37,17 @@ namespace art { +class ClassLinker; class CompilerCallbacks; class Instruction; struct ReferenceMap2Visitor; class Thread; class VariableIndentationOutputStream; +namespace mirror { +class DexCache; +} // namespace mirror + namespace verifier { class MethodVerifier; diff --git a/runtime/verifier/reg_type_cache-inl.h b/runtime/verifier/reg_type_cache-inl.h index 68af62ece4..b57a2c86d4 100644 --- a/runtime/verifier/reg_type_cache-inl.h +++ b/runtime/verifier/reg_type_cache-inl.h @@ -43,6 +43,43 @@ inline const ConstantType& RegTypeCache::FromCat1Const(int32_t value, bool preci return FromCat1NonSmallConstant(value, precise); } +inline const BooleanType& RegTypeCache::Boolean() { + return *BooleanType::GetInstance(); +} +inline const ByteType& RegTypeCache::Byte() { + return *ByteType::GetInstance(); +} +inline const CharType& RegTypeCache::Char() { + return *CharType::GetInstance(); +} +inline const ShortType& RegTypeCache::Short() { + return *ShortType::GetInstance(); +} +inline const IntegerType& RegTypeCache::Integer() { + return *IntegerType::GetInstance(); +} +inline const FloatType& RegTypeCache::Float() { + return *FloatType::GetInstance(); +} +inline const LongLoType& RegTypeCache::LongLo() { + return *LongLoType::GetInstance(); +} +inline const LongHiType& RegTypeCache::LongHi() { + return *LongHiType::GetInstance(); +} +inline const DoubleLoType& RegTypeCache::DoubleLo() { + return *DoubleLoType::GetInstance(); +} +inline const DoubleHiType& RegTypeCache::DoubleHi() { + return *DoubleHiType::GetInstance(); +} +inline const UndefinedType& RegTypeCache::Undefined() { + return *UndefinedType::GetInstance(); +} +inline const ConflictType& RegTypeCache::Conflict() { + return *ConflictType::GetInstance(); +} + inline const ImpreciseConstType& RegTypeCache::ByteConstant() { const ConstantType& result = FromCat1Const(std::numeric_limits<jbyte>::min(), false); DCHECK(result.IsImpreciseConstant()); diff --git a/runtime/verifier/reg_type_cache.h b/runtime/verifier/reg_type_cache.h index df0fe3d041..37f8a1fc33 100644 --- a/runtime/verifier/reg_type_cache.h +++ b/runtime/verifier/reg_type_cache.h @@ -17,15 +17,14 @@ #ifndef ART_RUNTIME_VERIFIER_REG_TYPE_CACHE_H_ #define ART_RUNTIME_VERIFIER_REG_TYPE_CACHE_H_ +#include <stdint.h> +#include <vector> + #include "base/casts.h" #include "base/macros.h" #include "base/scoped_arena_containers.h" -#include "object_callbacks.h" -#include "reg_type.h" -#include "runtime.h" - -#include <stdint.h> -#include <vector> +#include "gc_root.h" +#include "primitive.h" namespace art { namespace mirror { @@ -37,7 +36,24 @@ class StringPiece; namespace verifier { +class BooleanType; +class ByteType; +class CharType; +class ConflictType; +class ConstantType; +class DoubleHiType; +class DoubleLoType; +class FloatType; +class ImpreciseConstType; +class IntegerType; +class LongHiType; +class LongLoType; +class PreciseConstType; +class PreciseReferenceType; class RegType; +class ShortType; +class UndefinedType; +class UninitializedType; // Use 8 bytes since that is the default arena allocator alignment. static constexpr size_t kDefaultArenaBitVectorBytes = 8; @@ -90,42 +106,18 @@ class RegTypeCache { size_t GetCacheSize() { return entries_.size(); } - const BooleanType& Boolean() REQUIRES_SHARED(Locks::mutator_lock_) { - return *BooleanType::GetInstance(); - } - const ByteType& Byte() REQUIRES_SHARED(Locks::mutator_lock_) { - return *ByteType::GetInstance(); - } - const CharType& Char() REQUIRES_SHARED(Locks::mutator_lock_) { - return *CharType::GetInstance(); - } - const ShortType& Short() REQUIRES_SHARED(Locks::mutator_lock_) { - return *ShortType::GetInstance(); - } - const IntegerType& Integer() REQUIRES_SHARED(Locks::mutator_lock_) { - return *IntegerType::GetInstance(); - } - const FloatType& Float() REQUIRES_SHARED(Locks::mutator_lock_) { - return *FloatType::GetInstance(); - } - const LongLoType& LongLo() REQUIRES_SHARED(Locks::mutator_lock_) { - return *LongLoType::GetInstance(); - } - const LongHiType& LongHi() REQUIRES_SHARED(Locks::mutator_lock_) { - return *LongHiType::GetInstance(); - } - const DoubleLoType& DoubleLo() REQUIRES_SHARED(Locks::mutator_lock_) { - return *DoubleLoType::GetInstance(); - } - const DoubleHiType& DoubleHi() REQUIRES_SHARED(Locks::mutator_lock_) { - return *DoubleHiType::GetInstance(); - } - const UndefinedType& Undefined() REQUIRES_SHARED(Locks::mutator_lock_) { - return *UndefinedType::GetInstance(); - } - const ConflictType& Conflict() { - return *ConflictType::GetInstance(); - } + const BooleanType& Boolean() REQUIRES_SHARED(Locks::mutator_lock_); + const ByteType& Byte() REQUIRES_SHARED(Locks::mutator_lock_); + const CharType& Char() REQUIRES_SHARED(Locks::mutator_lock_); + const ShortType& Short() REQUIRES_SHARED(Locks::mutator_lock_); + const IntegerType& Integer() REQUIRES_SHARED(Locks::mutator_lock_); + const FloatType& Float() REQUIRES_SHARED(Locks::mutator_lock_); + const LongLoType& LongLo() REQUIRES_SHARED(Locks::mutator_lock_); + const LongHiType& LongHi() REQUIRES_SHARED(Locks::mutator_lock_); + const DoubleLoType& DoubleLo() REQUIRES_SHARED(Locks::mutator_lock_); + const DoubleHiType& DoubleHi() REQUIRES_SHARED(Locks::mutator_lock_); + const UndefinedType& Undefined() REQUIRES_SHARED(Locks::mutator_lock_); + const ConflictType& Conflict(); const PreciseReferenceType& JavaLangClass() REQUIRES_SHARED(Locks::mutator_lock_); const PreciseReferenceType& JavaLangString() REQUIRES_SHARED(Locks::mutator_lock_); diff --git a/test/137-cfi/cfi.cc b/test/137-cfi/cfi.cc index 3b237f40ff..1ed1f5a94c 100644 --- a/test/137-cfi/cfi.cc +++ b/test/137-cfi/cfi.cc @@ -33,6 +33,7 @@ #include "gc/heap.h" #include "gc/space/image_space.h" #include "oat_file.h" +#include "runtime.h" #include "utils.h" namespace art { |