diff options
author | Vladimir Marko <vmarko@google.com> | 2014-04-09 18:45:35 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2014-04-25 12:24:46 +0100 |
commit | 8a630577ed2d9e9571c3434c505e5de223b23c07 (patch) | |
tree | 106367100c639011f0abb72b3b0e227c0764e8e0 /compiler/oat_writer.h | |
parent | 96c6ab93336b972a38bd2448bcccf19188b8389b (diff) | |
download | art-8a630577ed2d9e9571c3434c505e5de223b23c07.zip art-8a630577ed2d9e9571c3434c505e5de223b23c07.tar.gz art-8a630577ed2d9e9571c3434c505e5de223b23c07.tar.bz2 |
Move mapping table and vmap table offsets to OatMethodHeader.
This change has a libcore/ companion CL
"Remove ArtMethod's quick fields mapping table and vmap table."
https://android-review.googlesource.com/91254
Bug: 11767815
Change-Id: I46ce2067e1ecd915da3890606498e31ffc332813
Diffstat (limited to 'compiler/oat_writer.h')
-rw-r--r-- | compiler/oat_writer.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/compiler/oat_writer.h b/compiler/oat_writer.h index 1abacd8..7cdd532 100644 --- a/compiler/oat_writer.h +++ b/compiler/oat_writer.h @@ -225,12 +225,13 @@ class OatWriter { // not is kOatClassBitmap, the bitmap will be NULL. BitVector* method_bitmap_; - // OatMethodOffsets for each CompiledMethod present in the - // OatClass. Note that some may be missing if + // OatMethodOffsets and OatMethodHeaders for each CompiledMethod + // present in the OatClass. Note that some may be missing if // OatClass::compiled_methods_ contains NULL values (and // oat_method_offsets_offsets_from_oat_class_ should contain 0 // values in this case). std::vector<OatMethodOffsets> method_offsets_; + std::vector<OatMethodHeader> method_headers_; private: DISALLOW_COPY_AND_ASSIGN(OatClass); @@ -299,6 +300,22 @@ class OatWriter { uint32_t size_oat_class_method_bitmaps_; uint32_t size_oat_class_method_offsets_; + struct CodeOffsetsKeyComparator { + bool operator()(const CompiledMethod* lhs, const CompiledMethod* rhs) const { + if (lhs->GetQuickCode() != rhs->GetQuickCode()) { + return lhs->GetQuickCode() < rhs->GetQuickCode(); + } + // If the code is the same, all other fields are likely to be the same as well. + if (UNLIKELY(&lhs->GetMappingTable() != &rhs->GetMappingTable())) { + return &lhs->GetMappingTable() < &rhs->GetMappingTable(); + } + if (UNLIKELY(&lhs->GetVmapTable() != &rhs->GetVmapTable())) { + return &lhs->GetVmapTable() < &rhs->GetVmapTable(); + } + return false; + } + }; + DISALLOW_COPY_AND_ASSIGN(OatWriter); }; |