diff options
author | Carl Shapiro <cshapiro@google.com> | 2011-05-05 16:01:26 -0700 |
---|---|---|
committer | Carl Shapiro <cshapiro@google.com> | 2011-05-05 17:33:58 -0700 |
commit | dc9e44cc0af797679822484d88ef76bff15ffc98 (patch) | |
tree | 7b600921d5421d76a903eab561c0cf36c23f9c06 /vm/UtfString.h | |
parent | 38e191b85851e8ff3126ce680c615a189558e5ff (diff) | |
download | android_dalvik-dc9e44cc0af797679822484d88ef76bff15ffc98.tar.gz android_dalvik-dc9e44cc0af797679822484d88ef76bff15ffc98.tar.bz2 android_dalvik-dc9e44cc0af797679822484d88ef76bff15ffc98.zip |
Make interned strings non-movable.
At present objects referenced from dex files must have stable reference
values. With this change, only non-moving strings are interned. If a
user interns a movable string a non-moving copy is made and the copy is
added to the intern table.
As part of this change, the internal string hash code access routine will
update the hash code slot of a string object. In addition, StringObject
has been made a subclass of Object eliminating various down-casts that
would otherwise be explicitly required.
Change-Id: I6b015b972aac44948470c0034ad17e5eef456aeb
Diffstat (limited to 'vm/UtfString.h')
-rw-r--r-- | vm/UtfString.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vm/UtfString.h b/vm/UtfString.h index b577d3a59..488ba9b8a 100644 --- a/vm/UtfString.h +++ b/vm/UtfString.h @@ -51,9 +51,10 @@ u4 dvmComputeUtf8Hash(const char* str); /* - * Hash function for string objects. + * Hash function for string objects. Ensures the hash code field is + * populated and returns its value. */ -u4 dvmComputeStringHash(const StringObject* strObj); +u4 dvmComputeStringHash(StringObject* strObj); /* * Create a java.lang.String[] from an array of C strings. |