summaryrefslogtreecommitdiff
path: root/runtime/class_table.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-10-19 19:54:44 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2015-10-19 19:54:44 +0000
commit28a15a922e172f96018ab2a1e94ea1cfeb9b7b95 (patch)
tree9f15ab6328ea212e74afe9c4285bcf2b140eca0e /runtime/class_table.cc
parentf69f56e7d4a1e31dfce2a77558c9b7047f82092b (diff)
parent00310e0bb4ee541b99f0b687dbf5f706db2aabca (diff)
Merge "Keep dex files live in class table"
Diffstat (limited to 'runtime/class_table.cc')
-rw-r--r--runtime/class_table.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc
index 4b0cbc836c..3ed1c9540d 100644
--- a/runtime/class_table.cc
+++ b/runtime/class_table.cc
@@ -137,4 +137,15 @@ std::size_t ClassTable::ClassDescriptorHashEquals::operator()(const char* descri
return ComputeModifiedUtf8Hash(descriptor);
}
+bool ClassTable::InsertDexFile(mirror::Object* dex_file) {
+ DCHECK(dex_file != nullptr);
+ for (GcRoot<mirror::Object>& root : dex_files_) {
+ if (root.Read() == dex_file) {
+ return false;
+ }
+ }
+ dex_files_.push_back(GcRoot<mirror::Object>(dex_file));
+ return true;
+}
+
} // namespace art