diff options
author | Vladimir Marko <vmarko@google.com> | 2019-11-07 09:12:24 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-11-07 09:12:24 -0800 |
commit | 3edb718fcb597eeccfdbd02b4f35c3833a13a6cc (patch) | |
tree | 7fb793aa293908b9218267acbf8e10da14e95031 | |
parent | e9e60bd7707963f3f35ec18b611bc58995620bac (diff) | |
parent | d3d00c06a439f5204b290505a3333f780dd00bce (diff) |
Refactor oat.h.
am: d3d00c06a4
Change-Id: I0c5370f42f68fff1c3179a4a09dff7b7947a1033
-rw-r--r-- | dex2oat/dex2oat.cc | 1 | ||||
-rw-r--r-- | dex2oat/linker/image_test.h | 1 | ||||
-rw-r--r-- | dex2oat/linker/oat_writer.cc | 1 | ||||
-rw-r--r-- | dex2oat/linker/oat_writer.h | 2 | ||||
-rw-r--r-- | dex2oat/linker/oat_writer_test.cc | 1 | ||||
-rw-r--r-- | dex2oat/linker/relative_patcher_test.h | 1 | ||||
-rw-r--r-- | runtime/Android.bp | 2 | ||||
-rw-r--r-- | runtime/art_method-inl.h | 1 | ||||
-rw-r--r-- | runtime/dexopt_test.cc | 1 | ||||
-rw-r--r-- | runtime/entrypoints/quick/quick_trampoline_entrypoints.cc | 1 | ||||
-rw-r--r-- | runtime/gc/space/image_space.cc | 1 | ||||
-rw-r--r-- | runtime/oat.cc | 5 | ||||
-rw-r--r-- | runtime/oat.h | 25 | ||||
-rw-r--r-- | runtime/oat_file.h | 26 | ||||
-rw-r--r-- | runtime/oat_file_assistant_test.cc | 1 | ||||
-rw-r--r-- | runtime/runtime.cc | 1 | ||||
-rw-r--r-- | test/common/runtime_state.cc | 1 |
17 files changed, 37 insertions, 35 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index dc0dd671f8..095f027ca3 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -87,6 +87,7 @@ #include "mirror/class_loader.h" #include "mirror/object-inl.h" #include "mirror/object_array-inl.h" +#include "oat.h" #include "oat_file.h" #include "oat_file_assistant.h" #include "profile/profile_compilation_info.h" diff --git a/dex2oat/linker/image_test.h b/dex2oat/linker/image_test.h index fa08627168..9ec6e56922 100644 --- a/dex2oat/linker/image_test.h +++ b/dex2oat/linker/image_test.h @@ -48,6 +48,7 @@ #include "linker/multi_oat_relative_patcher.h" #include "lock_word.h" #include "mirror/object-inl.h" +#include "oat.h" #include "oat_writer.h" #include "scoped_thread_state_change-inl.h" #include "signal_catcher.h" diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc index b3c8999e30..92de151416 100644 --- a/dex2oat/linker/oat_writer.cc +++ b/dex2oat/linker/oat_writer.cc @@ -61,6 +61,7 @@ #include "mirror/class_loader.h" #include "mirror/dex_cache-inl.h" #include "mirror/object-inl.h" +#include "oat.h" #include "oat_quick_method_header.h" #include "profile/profile_compilation_info.h" #include "quicken_info.h" diff --git a/dex2oat/linker/oat_writer.h b/dex2oat/linker/oat_writer.h index fb263d9cd9..19c0cfefa2 100644 --- a/dex2oat/linker/oat_writer.h +++ b/dex2oat/linker/oat_writer.h @@ -35,7 +35,6 @@ #include "dex/type_reference.h" #include "linker/relative_patcher.h" // For RelativePatcherTargetProvider. #include "mirror/class.h" -#include "oat.h" namespace art { @@ -44,6 +43,7 @@ class CompiledMethod; class CompilerDriver; class CompilerOptions; class DexContainer; +class OatHeader; class OutputStream; class ProfileCompilationInfo; class TimingLogger; diff --git a/dex2oat/linker/oat_writer_test.cc b/dex2oat/linker/oat_writer_test.cc index 2eb4476667..11600a8e01 100644 --- a/dex2oat/linker/oat_writer_test.cc +++ b/dex2oat/linker/oat_writer_test.cc @@ -41,6 +41,7 @@ #include "mirror/class-inl.h" #include "mirror/object-inl.h" #include "mirror/object_array-inl.h" +#include "oat.h" #include "oat_file-inl.h" #include "oat_writer.h" #include "profile/profile_compilation_info.h" diff --git a/dex2oat/linker/relative_patcher_test.h b/dex2oat/linker/relative_patcher_test.h index dc53ac4321..f34e6eb059 100644 --- a/dex2oat/linker/relative_patcher_test.h +++ b/dex2oat/linker/relative_patcher_test.h @@ -29,7 +29,6 @@ #include "dex/string_reference.h" #include "driver/compiled_method_storage.h" #include "linker/relative_patcher.h" -#include "oat.h" #include "oat_quick_method_header.h" #include "stream/vector_output_stream.h" diff --git a/runtime/Android.bp b/runtime/Android.bp index cfa16f87dc..0546c69b41 100644 --- a/runtime/Android.bp +++ b/runtime/Android.bp @@ -497,7 +497,7 @@ gensrcs { "jdwp/jdwp_constants.h", "jni_id_type.h", "lock_word.h", - "oat.h", + "oat_file.h", "object_callbacks.h", "process_state.h", "reflective_value_visitor.h", diff --git a/runtime/art_method-inl.h b/runtime/art_method-inl.h index 3aec1c3211..dfadc622d1 100644 --- a/runtime/art_method-inl.h +++ b/runtime/art_method-inl.h @@ -39,7 +39,6 @@ #include "mirror/object-inl.h" #include "mirror/object_array.h" #include "mirror/string.h" -#include "oat.h" #include "obj_ptr-inl.h" #include "quick/quick_method_frame_info.h" #include "read_barrier-inl.h" diff --git a/runtime/dexopt_test.cc b/runtime/dexopt_test.cc index fd3d20d662..4f438e7aec 100644 --- a/runtime/dexopt_test.cc +++ b/runtime/dexopt_test.cc @@ -30,6 +30,7 @@ #include "dexopt_test.h" #include "gc/space/image_space.h" #include "hidden_api.h" +#include "oat.h" namespace art { void DexoptTest::SetUp() { diff --git a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc index 87ce674644..6a52d24f38 100644 --- a/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_trampoline_entrypoints.cc @@ -48,6 +48,7 @@ #include "mirror/object-inl.h" #include "mirror/object_array-inl.h" #include "mirror/var_handle.h" +#include "oat.h" #include "oat_file.h" #include "oat_quick_method_header.h" #include "quick_exception_handler.h" diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc index 8b8ac187dd..31dffc836d 100644 --- a/runtime/gc/space/image_space.cc +++ b/runtime/gc/space/image_space.cc @@ -54,6 +54,7 @@ #include "mirror/executable-inl.h" #include "mirror/object-inl.h" #include "mirror/object-refvisitor-inl.h" +#include "oat.h" #include "oat_file.h" #include "runtime.h" #include "space-inl.h" diff --git a/runtime/oat.cc b/runtime/oat.cc index db6cda5027..3fceec9364 100644 --- a/runtime/oat.cc +++ b/runtime/oat.cc @@ -411,9 +411,4 @@ void OatHeader::Flatten(const SafeMap<std::string, std::string>* key_value_store key_value_store_size_ = data_ptr - reinterpret_cast<char*>(&key_value_store_); } -OatMethodOffsets::OatMethodOffsets(uint32_t code_offset) : code_offset_(code_offset) { -} - -OatMethodOffsets::~OatMethodOffsets() {} - } // namespace art diff --git a/runtime/oat.h b/runtime/oat.h index 1ff21c1ec0..352b9e892e 100644 --- a/runtime/oat.h +++ b/runtime/oat.h @@ -134,31 +134,6 @@ class PACKED(4) OatHeader { DISALLOW_COPY_AND_ASSIGN(OatHeader); }; -// OatMethodOffsets are currently 5x32-bits=160-bits long, so if we can -// save even one OatMethodOffsets struct, the more complicated encoding -// using a bitmap pays for itself since few classes will have 160 -// methods. -enum OatClassType { - kOatClassAllCompiled = 0, // OatClass is followed by an OatMethodOffsets for each method. - kOatClassSomeCompiled = 1, // A bitmap of which OatMethodOffsets are present follows the OatClass. - kOatClassNoneCompiled = 2, // All methods are interpreted so no OatMethodOffsets are necessary. - kOatClassMax = 3, -}; - -std::ostream& operator<<(std::ostream& os, const OatClassType& rhs); - -class PACKED(4) OatMethodOffsets { - public: - explicit OatMethodOffsets(uint32_t code_offset = 0); - - ~OatMethodOffsets(); - - OatMethodOffsets(const OatMethodOffsets&) = default; - OatMethodOffsets& operator=(const OatMethodOffsets&) = default; - - uint32_t code_offset_; -}; - } // namespace art #endif // ART_RUNTIME_OAT_H_ diff --git a/runtime/oat_file.h b/runtime/oat_file.h index 69d5efd4f4..70a9534824 100644 --- a/runtime/oat_file.h +++ b/runtime/oat_file.h @@ -34,7 +34,6 @@ #include "dex/utf.h" #include "index_bss_mapping.h" #include "mirror/object.h" -#include "oat.h" #include "runtime.h" namespace art { @@ -61,6 +60,31 @@ class DummyOatFile; } // namespace collector } // namespace gc +// OatMethodOffsets are currently 5x32-bits=160-bits long, so if we can +// save even one OatMethodOffsets struct, the more complicated encoding +// using a bitmap pays for itself since few classes will have 160 +// methods. +enum OatClassType { + kOatClassAllCompiled = 0, // OatClass is followed by an OatMethodOffsets for each method. + kOatClassSomeCompiled = 1, // A bitmap of OatMethodOffsets that are present follows the OatClass. + kOatClassNoneCompiled = 2, // All methods are interpreted so no OatMethodOffsets are necessary. + kOatClassMax = 3, +}; + +std::ostream& operator<<(std::ostream& os, const OatClassType& rhs); + +class PACKED(4) OatMethodOffsets { + public: + explicit OatMethodOffsets(uint32_t code_offset = 0) : code_offset_(code_offset) {} + + ~OatMethodOffsets() {} + + OatMethodOffsets(const OatMethodOffsets&) = default; + OatMethodOffsets& operator=(const OatMethodOffsets&) = default; + + uint32_t code_offset_; +}; + // Runtime representation of the OAT file format which holds compiler output. // The class opens an OAT file from storage and maps it to memory, typically with // dlopen and provides access to its internal data structures (see OatWriter for diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc index 9a5409f46d..0412ab5909 100644 --- a/runtime/oat_file_assistant_test.cc +++ b/runtime/oat_file_assistant_test.cc @@ -34,6 +34,7 @@ #include "common_runtime_test.h" #include "dexopt_test.h" #include "hidden_api.h" +#include "oat.h" #include "oat_file.h" #include "oat_file_manager.h" #include "scoped_thread_state_change-inl.h" diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 691aa80f74..908a92861b 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -146,6 +146,7 @@ #include "native_bridge_art_interface.h" #include "native_stack_dump.h" #include "nativehelper/scoped_local_ref.h" +#include "oat.h" #include "oat_file.h" #include "oat_file_manager.h" #include "object_callbacks.h" diff --git a/test/common/runtime_state.cc b/test/common/runtime_state.cc index 5fa7e19eda..4ca5fe8333 100644 --- a/test/common/runtime_state.cc +++ b/test/common/runtime_state.cc @@ -32,6 +32,7 @@ #include "mirror/class-inl.h" #include "mirror/class.h" #include "nativehelper/ScopedUtfChars.h" +#include "oat.h" #include "oat_file.h" #include "oat_quick_method_header.h" #include "profile/profile_compilation_info.h" |