OSDN Git Service

Make interned strings non-movable.
authorCarl Shapiro <cshapiro@google.com>
Thu, 5 May 2011 23:01:26 +0000 (16:01 -0700)
committerCarl Shapiro <cshapiro@google.com>
Fri, 6 May 2011 00:33:58 +0000 (17:33 -0700)
commitdc9e44cc0af797679822484d88ef76bff15ffc98
tree7b600921d5421d76a903eab561c0cf36c23f9c06
parent38e191b85851e8ff3126ce680c615a189558e5ff
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
vm/Intern.cpp
vm/Intern.h
vm/UtfString.cpp
vm/UtfString.h
vm/alloc/Alloc.cpp
vm/alloc/Alloc.h
vm/oo/Object.h
vm/reflect/Annotation.cpp