summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-08-06 15:34:15 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-08-12 15:50:24 -0700
commite4275c07e9852a6944f47efa9d0591fceb8e8e36 (patch)
tree92d5e69374f88555f454d137e5d60fb1c925b4d8 /compiler/driver/compiler_driver.cc
parent82b844fb449ddc5d7b4e43e71a55eb934a1b0b45 (diff)
Visit class roots from ClassLoader::VisitReferences
This causes the classes of a class loader to get marked when that class loader gets marked instead of during class root visiting. Bug: 22720414 Change-Id: If53f042aff1d9f7bf94ecbe6886601edda029b7d
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index 299b99585a..fa4667ec97 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -829,6 +829,18 @@ class ResolveCatchBlockExceptionsClassVisitor : public ClassVisitor {
std::set<std::pair<uint16_t, const DexFile*>>& exceptions_to_resolve)
: exceptions_to_resolve_(exceptions_to_resolve) {}
+ virtual bool Visit(mirror::Class* c) OVERRIDE SHARED_REQUIRES(Locks::mutator_lock_) {
+ const auto pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
+ for (auto& m : c->GetVirtualMethods(pointer_size)) {
+ ResolveExceptionsForMethod(&m);
+ }
+ for (auto& m : c->GetDirectMethods(pointer_size)) {
+ ResolveExceptionsForMethod(&m);
+ }
+ return true;
+ }
+
+ private:
void ResolveExceptionsForMethod(ArtMethod* method_handle) SHARED_REQUIRES(Locks::mutator_lock_) {
const DexFile::CodeItem* code_item = method_handle->GetCodeItem();
if (code_item == nullptr) {
@@ -864,18 +876,6 @@ class ResolveCatchBlockExceptionsClassVisitor : public ClassVisitor {
}
}
- virtual bool Visit(mirror::Class* c) OVERRIDE SHARED_REQUIRES(Locks::mutator_lock_) {
- const auto pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
- for (auto& m : c->GetVirtualMethods(pointer_size)) {
- ResolveExceptionsForMethod(&m);
- }
- for (auto& m : c->GetDirectMethods(pointer_size)) {
- ResolveExceptionsForMethod(&m);
- }
- return true;
- }
-
- private:
std::set<std::pair<uint16_t, const DexFile*>>& exceptions_to_resolve_;
};