summaryrefslogtreecommitdiff
path: root/runtime/class_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/class_table.cc')
-rw-r--r--runtime/class_table.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc
index fc8e6c49da..3ed1c9540d 100644
--- a/runtime/class_table.cc
+++ b/runtime/class_table.cc
@@ -21,7 +21,9 @@
namespace art {
ClassTable::ClassTable() {
- classes_.push_back(ClassSet());
+ Runtime* const runtime = Runtime::Current();
+ classes_.push_back(ClassSet(runtime->GetHashTableMinLoadFactor(),
+ runtime->GetHashTableMaxLoadFactor()));
}
void ClassTable::FreezeSnapshot() {
@@ -135,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