diff options
author | Andy McFadden <fadden@android.com> | 2009-08-25 07:19:34 -0700 |
---|---|---|
committer | Andy McFadden <fadden@android.com> | 2009-08-25 15:17:46 -0700 |
commit | d5ab726b65d7271be261864c7e224fb90bfe06e0 (patch) | |
tree | ac034def00831f08df2dc6778e7b1a09d7396177 /vm/ReferenceTable.h | |
parent | 0083d37b0e1c9e542f671cbca2e9db6819ecccba (diff) | |
download | android_dalvik-d5ab726b65d7271be261864c7e224fb90bfe06e0.tar.gz android_dalvik-d5ab726b65d7271be261864c7e224fb90bfe06e0.tar.bz2 android_dalvik-d5ab726b65d7271be261864c7e224fb90bfe06e0.zip |
Another round of scary indirect ref changes.
This change adds a not-really-working implementation to Jni.c, with
various changes #ifdefed throughout the code. The ifdef is currently
disabled, so the old behavior should continue. Eventually the old
version will be stripped out and the ifdefs removed.
This renames the stack's "localRefTop" field, which nudged a bunch of
code. The name wasn't really right before (it's the *bottom* of the
local references), and it's even less right now. This and one other
mterp-visible constant were changed, which caused some ripples through
mterp and the JIT, but the ifdeffing was limited to one in
asm-constants.h (and the constant is the same both ways, so toggling the
ifdef won't require rebuilding asm sources).
Some comments and arg names in ReferenceTable were updated for the
correct orientation of bottom vs. top.
Some adjustments were made to the JNI code, e.g. dvmCallMethod now needs
to understand if it needs to convert reference arguments from
local/global refs to pointers (it's called from various places
throughout the VM).
Diffstat (limited to 'vm/ReferenceTable.h')
-rw-r--r-- | vm/ReferenceTable.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/vm/ReferenceTable.h b/vm/ReferenceTable.h index f8f24610e..d6e2d705a 100644 --- a/vm/ReferenceTable.h +++ b/vm/ReferenceTable.h @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + /* * Maintain a table of references. Used for internal local references, * JNI locals, JNI globals, and GC heap references. @@ -36,8 +37,8 @@ * table/nextEntry is allowed.) */ typedef struct ReferenceTable { - Object** table; /* top of the list */ - Object** nextEntry; /* bottom of the list */ + Object** nextEntry; /* top of the list */ + Object** table; /* bottom of the list */ int allocEntries; /* #of entries we have space for */ int maxEntries; /* max #of entries allowed */ @@ -88,23 +89,24 @@ INLINE size_t dvmIsReferenceTableFull(const ReferenceTable* pRef) bool dvmAddToReferenceTable(ReferenceTable* pRef, Object* obj); /* - * Determine if "obj" is present in "pRef". Stops searching when we hit "top". - * To include the entire table, pass in "pRef->table" as the top. + * Determine if "obj" is present in "pRef". Stops searching when we hit + * "bottom". To include the entire table, pass in "pRef->table" as the + * bottom. * * Returns NULL if "obj" was not found. */ -Object** dvmFindInReferenceTable(const ReferenceTable* pRef, Object** top, +Object** dvmFindInReferenceTable(const ReferenceTable* pRef, Object** bottom, Object* obj); /* * Remove an existing entry. * - * We stop searching for a match after examining the element at "top". This - * is useful when entries are associated with a stack frame. + * We stop searching for a match after examining the element at "bottom". + * This is useful when entries are associated with a stack frame. * * Returns "false" if the entry was not found. */ -bool dvmRemoveFromReferenceTable(ReferenceTable* pRef, Object** top, +bool dvmRemoveFromReferenceTable(ReferenceTable* pRef, Object** bottom, Object* obj); /* |