From b4c6acbf281c1cf960444e35bcac254a1f77c3ed Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Fri, 10 Nov 2017 12:48:14 +0000 Subject: Optimize lookup of quickening data. Use the debug_info_off_ of CodeItem to store the quickening offset in the vdex. Impact: - Code size almost unchanged (1 word saved per dex file in a vdex) - GetQuickenedInfoOf doesn't show up in simpleperf during app startup Test: test.py, run-libcore-tests, run-jdwp-tests Test: 628-vdex Change-Id: I15c3151feb58980a4c4d7469ca02728e94d36c07 --- compiler/driver/compiler_driver.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index e4dd544890..fd7ae9f570 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -429,6 +429,10 @@ static optimizer::DexToDexCompilationLevel GetDexToDexCompilationLevel( // optimizations that could break that. max_level = optimizer::DexToDexCompilationLevel::kDontDexToDexCompile; } + if (!VdexFile::CanEncodeQuickenedData(dex_file)) { + // Don't do any dex level optimizations if we cannot encode the quickening. + return optimizer::DexToDexCompilationLevel::kDontDexToDexCompile; + } if (klass->IsVerified()) { // Class is verified so we can enable DEX-to-DEX compilation for performance. return max_level; -- cgit v1.2.3-59-g8ed1b