diff options
author | 2017-06-08 21:49:14 -0700 | |
---|---|---|
committer | 2017-09-18 11:36:24 -0700 | |
commit | 04c6ab9266876137c9b46b69391aa2820cd56600 (patch) | |
tree | 1580e08b7a8e73197c64b499540ec613b755a6e1 | |
parent | e2abbc604ce003c776c00ecf1293796bb4c4ac5a (diff) |
ART: Forward declarations for InvokeType
Use forward declarations in other header files.
Test: m
Change-Id: I8ef4492b6c48ff20d4d77d0516eacd362ed210bc
-rw-r--r-- | compiler/driver/compiler_driver.h | 2 | ||||
-rw-r--r-- | compiler/verifier_deps_test.cc | 2 | ||||
-rw-r--r-- | runtime/common_throws.h | 2 | ||||
-rw-r--r-- | runtime/dex_file-inl.h | 20 | ||||
-rw-r--r-- | runtime/dex_file.h | 21 | ||||
-rw-r--r-- | runtime/dex_file_types.h | 2 | ||||
-rw-r--r-- | runtime/dex_method_iterator.h | 2 | ||||
-rw-r--r-- | runtime/entrypoints/entrypoint_utils.h | 2 | ||||
-rw-r--r-- | runtime/mirror/class-inl.h | 1 | ||||
-rw-r--r-- | runtime/mirror/class.h | 2 | ||||
-rw-r--r-- | runtime/stack_map.h | 4 |
11 files changed, 33 insertions, 27 deletions
diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 5043884836..46aaba4669 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -34,7 +34,6 @@ #include "dex_file.h" #include "dex_file_types.h" #include "driver/compiled_method_storage.h" -#include "invoke_type.h" #include "jit/profile_compilation_info.h" #include "method_reference.h" #include "mirror/class.h" // For mirror::Class::Status. @@ -62,6 +61,7 @@ class DexCompilationUnit; struct InlineIGetIPutData; class InstructionSetFeatures; class InternTable; +enum InvokeType : uint32_t; class ParallelCompilationManager; class ScopedObjectAccess; template <class Allocator> class SrcMap; diff --git a/compiler/verifier_deps_test.cc b/compiler/verifier_deps_test.cc index 5c097da16f..56c9615a58 100644 --- a/compiler/verifier_deps_test.cc +++ b/compiler/verifier_deps_test.cc @@ -23,7 +23,7 @@ #include "compiler_callbacks.h" #include "dex/verification_results.h" #include "dex/verified_method.h" -#include "dex_file.h" +#include "dex_file-inl.h" #include "dex_file_types.h" #include "driver/compiler_driver-inl.h" #include "driver/compiler_options.h" diff --git a/runtime/common_throws.h b/runtime/common_throws.h index 4afef7993d..2fc2016e50 100644 --- a/runtime/common_throws.h +++ b/runtime/common_throws.h @@ -18,7 +18,6 @@ #define ART_RUNTIME_COMMON_THROWS_H_ #include "base/mutex.h" -#include "invoke_type.h" #include "obj_ptr.h" namespace art { @@ -30,6 +29,7 @@ namespace mirror { class ArtField; class ArtMethod; class DexFile; +enum InvokeType : uint32_t; class Signature; class StringPiece; diff --git a/runtime/dex_file-inl.h b/runtime/dex_file-inl.h index b163cdb8dc..1b7c31859c 100644 --- a/runtime/dex_file-inl.h +++ b/runtime/dex_file-inl.h @@ -21,6 +21,7 @@ #include "base/logging.h" #include "base/stringpiece.h" #include "dex_file.h" +#include "invoke_type.h" #include "leb128.h" namespace art { @@ -199,6 +200,25 @@ inline bool Signature::operator==(const Signature& rhs) const { return true; } +inline +InvokeType ClassDataItemIterator::GetMethodInvokeType(const DexFile::ClassDef& class_def) const { + if (HasNextDirectMethod()) { + if ((GetRawMemberAccessFlags() & kAccStatic) != 0) { + return kStatic; + } else { + return kDirect; + } + } else { + DCHECK_EQ(GetRawMemberAccessFlags() & kAccStatic, 0U); + if ((class_def.access_flags_ & kAccInterface) != 0) { + return kInterface; + } else if ((GetRawMemberAccessFlags() & kAccConstructor) != 0) { + return kSuper; + } else { + return kVirtual; + } + } +} } // namespace art diff --git a/runtime/dex_file.h b/runtime/dex_file.h index e86d53815b..91671083a7 100644 --- a/runtime/dex_file.h +++ b/runtime/dex_file.h @@ -25,12 +25,12 @@ #include "base/value_object.h" #include "dex_file_types.h" #include "globals.h" -#include "invoke_type.h" #include "jni.h" #include "modifiers.h" namespace art { +enum InvokeType : uint32_t; class MemMap; class OatDexFile; class Signature; @@ -1424,24 +1424,7 @@ class ClassDataItemIterator { bool MemberIsFinal() const { return GetRawMemberAccessFlags() & kAccFinal; } - InvokeType GetMethodInvokeType(const DexFile::ClassDef& class_def) const { - if (HasNextDirectMethod()) { - if ((GetRawMemberAccessFlags() & kAccStatic) != 0) { - return kStatic; - } else { - return kDirect; - } - } else { - DCHECK_EQ(GetRawMemberAccessFlags() & kAccStatic, 0U); - if ((class_def.access_flags_ & kAccInterface) != 0) { - return kInterface; - } else if ((GetRawMemberAccessFlags() & kAccConstructor) != 0) { - return kSuper; - } else { - return kVirtual; - } - } - } + ALWAYS_INLINE InvokeType GetMethodInvokeType(const DexFile::ClassDef& class_def) const; const DexFile::CodeItem* GetMethodCodeItem() const { return dex_file_.GetCodeItem(method_.code_off_); } diff --git a/runtime/dex_file_types.h b/runtime/dex_file_types.h index bd779c4ab0..acca7c055b 100644 --- a/runtime/dex_file_types.h +++ b/runtime/dex_file_types.h @@ -23,6 +23,8 @@ namespace art { namespace dex { +constexpr uint32_t kDexNoIndex = 0xFFFFFFFF; + class StringIndex { public: uint32_t index_; diff --git a/runtime/dex_method_iterator.h b/runtime/dex_method_iterator.h index 8a4bed31b1..a44bc16287 100644 --- a/runtime/dex_method_iterator.h +++ b/runtime/dex_method_iterator.h @@ -19,7 +19,7 @@ #include <vector> -#include "dex_file.h" +#include "dex_file-inl.h" namespace art { diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h index 4f9090815f..d2c98e153e 100644 --- a/runtime/entrypoints/entrypoint_utils.h +++ b/runtime/entrypoints/entrypoint_utils.h @@ -27,7 +27,6 @@ #include "dex_instruction.h" #include "gc/allocator_type.h" #include "handle.h" -#include "invoke_type.h" #include "jvalue.h" namespace art { @@ -41,6 +40,7 @@ namespace mirror { class ArtField; class ArtMethod; +enum InvokeType : uint32_t; class OatQuickMethodHeader; class ScopedObjectAccessAlreadyRunnable; class Thread; diff --git a/runtime/mirror/class-inl.h b/runtime/mirror/class-inl.h index 67aeeff2e8..77a5b559e3 100644 --- a/runtime/mirror/class-inl.h +++ b/runtime/mirror/class-inl.h @@ -30,6 +30,7 @@ #include "dex_file-inl.h" #include "gc/heap-inl.h" #include "iftable.h" +#include "invoke_type.h" #include "object-inl.h" #include "object_array.h" #include "read_barrier-inl.h" diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h index 4c9b1464dc..c44b6160ad 100644 --- a/runtime/mirror/class.h +++ b/runtime/mirror/class.h @@ -27,7 +27,6 @@ #include "gc/allocator_type.h" #include "gc_root.h" #include "imtable.h" -#include "invoke_type.h" #include "modifiers.h" #include "object.h" #include "object_array.h" @@ -43,6 +42,7 @@ class ArtField; class ArtMethod; struct ClassOffsets; template<class T> class Handle; +enum InvokeType : uint32_t; template<typename T> class LengthPrefixedArray; template<typename T> class ArraySlice; class Signature; diff --git a/runtime/stack_map.h b/runtime/stack_map.h index 3931b6242f..db776eaa1a 100644 --- a/runtime/stack_map.h +++ b/runtime/stack_map.h @@ -23,8 +23,8 @@ #include "base/bit_utils.h" #include "base/bit_vector.h" #include "bit_memory_region.h" -#include "dex_file.h" #include "leb128.h" +#include "dex_file_types.h" #include "memory_region.h" #include "method_info.h" @@ -906,7 +906,7 @@ class InlineInfoEncoding { dex_pc_bit_offset_ = dchecked_integral_cast<uint8_t>(total_bit_size_); // Note: We're not encoding the dex pc if there is none. That's the case // for an intrinsified native method, such as String.charAt(). - if (dex_pc_max != DexFile::kDexNoIndex) { + if (dex_pc_max != dex::kDexNoIndex) { total_bit_size_ += MinimumBitsToStore(1 /* kNoDexPc */ + dex_pc_max); } |