summaryrefslogtreecommitdiff
path: root/runtime/runtime.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/runtime.cc')
-rw-r--r--runtime/runtime.cc24
1 files changed, 23 insertions, 1 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 92222a2fd7..8861a095c7 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -35,6 +35,7 @@
#include <cstdlib>
#include <limits>
#include <thread>
+#include <unordered_set>
#include <vector>
#include "android-base/strings.h"
@@ -104,7 +105,7 @@
#include "mirror/class-alloc-inl.h"
#include "mirror/class-inl.h"
#include "mirror/class_ext.h"
-#include "mirror/class_loader.h"
+#include "mirror/class_loader-inl.h"
#include "mirror/emulated_stack_frame.h"
#include "mirror/field.h"
#include "mirror/method.h"
@@ -2851,6 +2852,27 @@ void Runtime::DeoptimizeBootImage() {
jit->GetCodeCache()->ClearEntryPointsInZygoteExecSpace();
}
}
+ // Also de-quicken all -quick opcodes. We do this for both BCP and non-bcp so if we are swapping
+ // debuggable during startup by a plugin (eg JVMTI) even non-BCP code has its vdex files deopted.
+ std::unordered_set<const VdexFile*> vdexs;
+ GetClassLinker()->VisitKnownDexFiles(Thread::Current(), [&](const art::DexFile* df) {
+ const OatDexFile* odf = df->GetOatDexFile();
+ if (odf == nullptr) {
+ return;
+ }
+ const OatFile* of = odf->GetOatFile();
+ if (of == nullptr || of->IsDebuggable()) {
+ // no Oat or already debuggable so no -quick.
+ return;
+ }
+ vdexs.insert(of->GetVdexFile());
+ });
+ LOG(INFO) << "Unquickening " << vdexs.size() << " vdex files!";
+ for (const VdexFile* vf : vdexs) {
+ vf->AllowWriting(true);
+ vf->UnquickenInPlace(/*decompile_return_instruction=*/true);
+ vf->AllowWriting(false);
+ }
}
Runtime::ScopedThreadPoolUsage::ScopedThreadPoolUsage()