diff options
author | 2016-10-03 08:46:48 +0000 | |
---|---|---|
committer | 2016-10-04 17:51:46 +0100 | |
commit | aad75c6d5bfab2dc8e30fc99fafe8cd2dc8b74d8 (patch) | |
tree | c1b9e1eabcf35c5cbb5b4f46313a4e062f2d5d51 /runtime/class_table.cc | |
parent | 82d4838d6bb3480cd25327cedc5179fb2d86881c (diff) |
Revert "Revert "Store resolved Strings for AOT code in .bss.""
Fixed oat_test to keep dex files alive. Fixed mips build.
Rewritten the .bss GC root visiting and added write barrier
to the artResolveStringFromCode().
Test: build aosp_mips-eng
Test: m ART_DEFAULT_GC_TYPE=SS test-art-target-host-gtest-oat_test
Test: Run ART test suite on host and Nexus 9.
Bug: 20323084
Bug: 30627598
This reverts commit 5f926055cb88089d8ca27243f35a9dfd89d981f0.
Change-Id: I07fa2278d82b8eb64964c9a4b66cb93726ccda6b
Diffstat (limited to 'runtime/class_table.cc')
-rw-r--r-- | runtime/class_table.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime/class_table.cc b/runtime/class_table.cc index 0600876122..2ae7e8cc30 100644 --- a/runtime/class_table.cc +++ b/runtime/class_table.cc @@ -165,6 +165,16 @@ bool ClassTable::InsertStrongRoot(mirror::Object* obj) { } } strong_roots_.push_back(GcRoot<mirror::Object>(obj)); + // If `obj` is a dex cache associated with a new oat file with GC roots, add it to oat_files_. + if (obj->IsDexCache()) { + const DexFile* dex_file = down_cast<mirror::DexCache*>(obj)->GetDexFile(); + if (dex_file != nullptr && dex_file->GetOatDexFile() != nullptr) { + const OatFile* oat_file = dex_file->GetOatDexFile()->GetOatFile(); + if (!oat_file->GetBssGcRoots().empty() && !ContainsElement(oat_files_, oat_file)) { + oat_files_.push_back(oat_file); + } + } + } return true; } @@ -201,6 +211,7 @@ void ClassTable::AddClassSet(ClassSet&& set) { void ClassTable::ClearStrongRoots() { WriterMutexLock mu(Thread::Current(), lock_); + oat_files_.clear(); strong_roots_.clear(); } } // namespace art |