diff options
author | Vladimir Marko <vmarko@google.com> | 2014-11-14 19:02:32 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-11-14 19:02:33 +0000 |
commit | 81852bf5a1d4640b7b22b8a0404ce8401a7219c6 (patch) | |
tree | 04c532caa84ce82031cce307a5d448830b733624 /runtime | |
parent | ff5298ff1640b730ee62c90ca78fc96b7ee82ec4 (diff) | |
parent | d577748c041aa6df599218f3cb31697ecf032730 (diff) | |
download | art-81852bf5a1d4640b7b22b8a0404ce8401a7219c6.zip art-81852bf5a1d4640b7b22b8a0404ce8401a7219c6.tar.gz art-81852bf5a1d4640b7b22b8a0404ce8401a7219c6.tar.bz2 |
Merge "Fix LinkFieldsComparator."
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/class_linker.cc | 25 | ||||
-rw-r--r-- | runtime/oat.cc | 2 |
2 files changed, 16 insertions, 11 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 5afba62..84cbcdc 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -5199,17 +5199,22 @@ struct LinkFieldsComparator { Primitive::Type type1 = field1->GetTypeAsPrimitiveType(); Primitive::Type type2 = field2->GetTypeAsPrimitiveType(); if (type1 != type2) { - bool is_primitive1 = type1 != Primitive::kPrimNot; - bool is_primitive2 = type2 != Primitive::kPrimNot; - if (type1 != type2) { - if (is_primitive1 && is_primitive2) { - // Larger primitive types go first. - return Primitive::ComponentSize(type1) > Primitive::ComponentSize(type2); - } else { - // Reference always goes first. - return !is_primitive1; - } + if (type1 == Primitive::kPrimNot) { + // Reference always goes first. + return true; + } + if (type2 == Primitive::kPrimNot) { + // Reference always goes first. + return false; + } + size_t size1 = Primitive::ComponentSize(type1); + size_t size2 = Primitive::ComponentSize(type2); + if (size1 != size2) { + // Larger primitive types go first. + return size1 > size2; } + // Primitive types differ but sizes match. Arbitrarily order by primitive type. + return type1 < type2; } // same basic group? then sort by string. return strcmp(field1->GetName(), field2->GetName()) < 0; diff --git a/runtime/oat.cc b/runtime/oat.cc index 02c60ab..2f7357f 100644 --- a/runtime/oat.cc +++ b/runtime/oat.cc @@ -25,7 +25,7 @@ namespace art { const uint8_t OatHeader::kOatMagic[] = { 'o', 'a', 't', '\n' }; -const uint8_t OatHeader::kOatVersion[] = { '0', '4', '6', '\0' }; +const uint8_t OatHeader::kOatVersion[] = { '0', '4', '7', '\0' }; static size_t ComputeOatHeaderSize(const SafeMap<std::string, std::string>* variable_data) { size_t estimate = 0U; |