diff options
author | Ian Rogers <irogers@google.com> | 2011-10-31 21:42:49 -0700 |
---|---|---|
committer | Ian Rogers <irogers@google.com> | 2011-11-02 01:25:57 -0700 |
commit | 5d76c435082332ef79a22962386fa92a0870e378 (patch) | |
tree | db8fdd7bfba3617494157b483e9df979f76dfdcc /src/intern_table.cc | |
parent | 4b6fe5a568ca2bc5e8fa110bf7af692cab220a15 (diff) | |
download | art-5d76c435082332ef79a22962386fa92a0870e378.zip art-5d76c435082332ef79a22962386fa92a0870e378.tar.gz art-5d76c435082332ef79a22962386fa92a0870e378.tar.bz2 |
Mark non-image spaces and use write barrier for image spaces.
Don't mark string and class roots that are in the image, alloc space
references will be caught by the write barrier.
Change-Id: Idcf9e4ede3b83556d4f8a01276273726dc6eea46
Diffstat (limited to 'src/intern_table.cc')
-rw-r--r-- | src/intern_table.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/intern_table.cc b/src/intern_table.cc index 4cc19bd..5de70d8 100644 --- a/src/intern_table.cc +++ b/src/intern_table.cc @@ -21,7 +21,7 @@ void InternTable::VisitRoots(Heap::RootVisitor* visitor, void* arg) const { for (It it = strong_interns_.begin(), end = strong_interns_.end(); it != end; ++it) { visitor(it->second, arg); } - // Note: we deliberately don't visit the weak_interns_ table. + // Note: we deliberately don't visit the weak_interns_ table and the immutable image roots. } String* InternTable::Lookup(Table& table, String* s, uint32_t hash_code) { @@ -44,7 +44,7 @@ String* InternTable::Insert(Table& table, String* s, uint32_t hash_code) { void InternTable::RegisterStrong(String* s) { MutexLock mu(intern_table_lock_); - Insert(strong_interns_, s, s->GetHashCode()); + Insert(image_strong_interns_, s, s->GetHashCode()); } void InternTable::Remove(Table& table, const String* s, uint32_t hash_code) { @@ -65,11 +65,15 @@ String* InternTable::Insert(String* s, bool is_strong) { uint32_t hash_code = s->GetHashCode(); if (is_strong) { - // Check the strong table for a match. + // Check the strong tables for a match. String* strong = Lookup(strong_interns_, s, hash_code); if (strong != NULL) { return strong; } + strong = Lookup(image_strong_interns_, s, hash_code); + if (strong != NULL) { + return strong; + } // There is no match in the strong table, check the weak table. String* weak = Lookup(weak_interns_, s, hash_code); |