diff options
author | Mathieu Chartier <mathieuc@google.com> | 2013-09-17 14:18:21 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2013-09-17 14:18:21 -0700 |
commit | b307052d619ec757478951fc026e6230c92e3b36 (patch) | |
tree | 7fee60cf62ec02fab20f70f111b5925be8a772fa /runtime/intern_table.cc | |
parent | cb135ad769a5368f6ceb8caf25105a95580cbd6a (diff) | |
parent | 613eae4a6f75282c0737a84850418afcab54d4e8 (diff) | |
download | art-b307052d619ec757478951fc026e6230c92e3b36.zip art-b307052d619ec757478951fc026e6230c92e3b36.tar.gz art-b307052d619ec757478951fc026e6230c92e3b36.tar.bz2 |
resolved conflicts for merge of 613eae4a to dalvik-dev
Change-Id: I61734cbf585decf9a50ba23f008b341d025339ff
Diffstat (limited to 'runtime/intern_table.cc')
-rw-r--r-- | runtime/intern_table.cc | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/runtime/intern_table.cc b/runtime/intern_table.cc index 6b0a51b..472c92e 100644 --- a/runtime/intern_table.cc +++ b/runtime/intern_table.cc @@ -42,14 +42,17 @@ void InternTable::DumpForSigQuit(std::ostream& os) const { } void InternTable::VisitRoots(RootVisitor* visitor, void* arg, - bool clean_dirty) { + bool only_dirty, bool clean_dirty) { MutexLock mu(Thread::Current(), intern_table_lock_); - for (auto& strong_intern : strong_interns_) { - strong_intern.second = reinterpret_cast<mirror::String*>(visitor(strong_intern.second, arg)); - DCHECK(strong_intern.second != nullptr); - } - if (clean_dirty) { - is_dirty_ = false; + if (!only_dirty || is_dirty_) { + for (auto& strong_intern : strong_interns_) { + strong_intern.second = reinterpret_cast<mirror::String*>(visitor(strong_intern.second, arg)); + DCHECK(strong_intern.second != nullptr); + } + + if (clean_dirty) { + is_dirty_ = false; + } } // Note: we deliberately don't visit the weak_interns_ table and the immutable image roots. } @@ -123,7 +126,7 @@ mirror::String* InternTable::Insert(mirror::String* s, bool is_strong) { } // Mark as dirty so that we rescan the roots. - Dirty(); + is_dirty_ = true; // Check the image for a match. mirror::String* image = LookupStringFromImage(s); |