Fix cdex bugs to enable ART_DEFAULT_COMPACT_DEX_LEVEL=fast tests passing
Compute dex checksum for compact dex generation. Handle input vdex
by not aborting in oat_writer, instead just avoid generating compact
dex for the input vdex case.
Re-enabled some compact dex tests.
Bug: 63756964
Test: ART_DEFAULT_COMPACT_DEX_LEVEL=fast test-art-host
Change-Id: Ic9b4e4e59e6cd22b66ee2fc0d32c9b4a15f13497
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 7cb04f2..1574cd7 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -58,6 +58,7 @@
#include "compiler_callbacks.h"
#include "debug/elf_debug_writer.h"
#include "debug/method_debug_info.h"
+#include "dexlayout.h"
#include "dex/quick_compiler_callbacks.h"
#include "dex/verification_results.h"
#include "dex2oat_options.h"
@@ -2233,12 +2234,16 @@
return DoProfileGuidedOptimizations();
}
- bool DoEagerUnquickeningOfVdex() const {
- // DexLayout can invalidate the vdex metadata, so we need to unquicken
- // the vdex file eagerly, before passing it to dexlayout.
+ bool MayInvalidateVdexMetadata() const {
+ // DexLayout can invalidate the vdex metadata if changing the class def order is enabled, so
+ // we need to unquicken the vdex file eagerly, before passing it to dexlayout.
return DoDexLayoutOptimizations();
}
+ bool DoEagerUnquickeningOfVdex() const {
+ return MayInvalidateVdexMetadata();
+ }
+
bool LoadProfile() {
DCHECK(UseProfile());
// TODO(calin): We should be using the runtime arena pool (instead of the