diff options
Diffstat (limited to 'runtime/oat_file.h')
-rw-r--r-- | runtime/oat_file.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/runtime/oat_file.h b/runtime/oat_file.h index 69d5efd4f4b..70a95348240 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 |