summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
author jeffhao <jeffhao@google.com> 2012-03-23 16:56:39 -0700
committer Android (Google) Code Review <android-gerrit@google.com> 2012-03-23 16:56:39 -0700
commit83cc46f38b0f23484cbcd812384b8557ad7a988c (patch)
treee6588dad4c8763bbc77471e7534582a784396afe /src
parent9f798f9c7e92a5437c8ad901bb17b9c4e1e9e209 (diff)
parent47282e59ca60fc8a1e02b23a1cb59916dd7c8b81 (diff)
Merge "Fix to check image_strong_intern table when inserting weaks." into ics-mr1-plus-art
Diffstat (limited to 'src')
-rw-r--r--src/intern_table.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/intern_table.cc b/src/intern_table.cc
index f3c82acd6e..10dd7f020a 100644
--- a/src/intern_table.cc
+++ b/src/intern_table.cc
@@ -86,14 +86,15 @@ String* InternTable::Insert(String* s, bool is_strong) {
uint32_t hash_code = s->GetHashCode();
if (is_strong) {
- // Check the strong tables for a match.
+ // Check the strong table 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;
+ // Check the image table for a match.
+ String* image = Lookup(image_strong_interns_, s, hash_code);
+ if (image != NULL) {
+ return image;
}
// There is no match in the strong table, check the weak table.
@@ -113,6 +114,11 @@ String* InternTable::Insert(String* s, bool is_strong) {
if (strong != NULL) {
return strong;
}
+ // Check the image table for a match.
+ String* image = Lookup(image_strong_interns_, s, hash_code);
+ if (image != NULL) {
+ return image;
+ }
// Check the weak table for a match.
String* weak = Lookup(weak_interns_, s, hash_code);
if (weak != NULL) {