diff options
author | 2017-07-14 18:23:25 -0700 | |
---|---|---|
committer | 2017-08-08 12:44:39 -0700 | |
commit | 0b1c341d2d89a483142cd14bdeb4650ab00184f1 (patch) | |
tree | 1eb65853f4a9c53fda1a778911dd32979ef43e32 /runtime/class_linker.cc | |
parent | 5129d8ede52ea31c0304ecaa8013f833310772a2 (diff) |
Support class unloading in dex2oat for quicken multidex
Support class unloading for the quicken compilation filter. This will
be enabled in a follow up CL.
Added a test that compares with and without unloading. The way that
it tests this is by adding an output app image. Having an app image
disables the unloading. This test also covers that app images don't
change the odex (currently).
Added a test for the assumed verified logic.
Bug: 63467744
Test: test-art-host
Test: test/testrunner/testrunner.py --interpreter --host -j40
Change-Id: I1e8a862c6f089c06c58aa0c846797e4c24bd072c
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r-- | runtime/class_linker.cc | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index 3ac87c5137..ed673d4505 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -3694,7 +3694,8 @@ bool ClassLinker::IsDexFileRegistered(Thread* self, const DexFile& dex_file) { ObjPtr<mirror::DexCache> ClassLinker::FindDexCache(Thread* self, const DexFile& dex_file) { ReaderMutexLock mu(self, *Locks::dex_lock_); - ObjPtr<mirror::DexCache> dex_cache = DecodeDexCache(self, FindDexCacheDataLocked(dex_file)); + DexCacheData dex_cache_data = FindDexCacheDataLocked(dex_file); + ObjPtr<mirror::DexCache> dex_cache = DecodeDexCache(self, dex_cache_data); if (dex_cache != nullptr) { return dex_cache; } @@ -3704,7 +3705,8 @@ ObjPtr<mirror::DexCache> ClassLinker::FindDexCache(Thread* self, const DexFile& LOG(FATAL_WITHOUT_ABORT) << "Registered dex file " << data.dex_file->GetLocation(); } } - LOG(FATAL) << "Failed to find DexCache for DexFile " << dex_file.GetLocation(); + LOG(FATAL) << "Failed to find DexCache for DexFile " << dex_file.GetLocation() + << " " << &dex_file << " " << dex_cache_data.dex_file; UNREACHABLE(); } @@ -4280,13 +4282,7 @@ verifier::FailureKind ClassLinker::VerifyClass( std::string error_msg; verifier::FailureKind verifier_failure = verifier::FailureKind::kNoFailure; if (!preverified) { - Runtime* runtime = Runtime::Current(); - verifier_failure = verifier::MethodVerifier::VerifyClass(self, - klass.Get(), - runtime->GetCompilerCallbacks(), - runtime->IsAotCompiler(), - log_level, - &error_msg); + verifier_failure = PerformClassVerification(self, klass, log_level, &error_msg); } // Verification is done, grab the lock again. @@ -4354,6 +4350,19 @@ verifier::FailureKind ClassLinker::VerifyClass( return verifier_failure; } +verifier::FailureKind ClassLinker::PerformClassVerification(Thread* self, + Handle<mirror::Class> klass, + verifier::HardFailLogMode log_level, + std::string* error_msg) { + Runtime* const runtime = Runtime::Current(); + return verifier::MethodVerifier::VerifyClass(self, + klass.Get(), + runtime->GetCompilerCallbacks(), + runtime->IsAotCompiler(), + log_level, + error_msg); +} + bool ClassLinker::VerifyClassUsingOatFile(const DexFile& dex_file, ObjPtr<mirror::Class> klass, mirror::Class::Status& oat_file_class_status) { |