aboutsummaryrefslogtreecommitdiff
path: root/libjava/prims.cc
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-29 18:35:36 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2005-04-29 18:35:36 +0000
commit8af0046eee4fb9e1210d25c79600fbca146c29ec (patch)
treeba9d688326059397b1b085f20d47c6aba292b04f /libjava/prims.cc
parent7343444ed6bea5a0da1e0d53515408859be2212e (diff)
2005-04-27 Andrew Haley <aph@redhat.com>
PR java/19285 * prims.cc (_Jv_ResolvePoolEntry): New function. * include/jvm.h (_Jv_Linker::find_field): New arg: found_class. * link.cc (_Jv_Linker::find_field): New arg: found_class. (resolve_pool_entry): Initialize the class in which a field is found. (link_symbol_table): Pass new arg to found_class. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@99006 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r--libjava/prims.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc
index b62514581dd..98d30232451 100644
--- a/libjava/prims.cc
+++ b/libjava/prims.cc
@@ -359,6 +359,22 @@ _Jv_ThrowNullPointerException ()
throw new java::lang::NullPointerException;
}
+// Resolve an entry in the constant pool and return the target
+// address.
+void *
+_Jv_ResolvePoolEntry (jclass this_class, jint index)
+{
+ _Jv_Constants *pool = &this_class->constants;
+
+ if ((pool->tags[index] & JV_CONSTANT_ResolvedFlag) != 0)
+ return pool->data[index].field->u.addr;
+
+ JvSynchronize sync (this_class);
+ return (_Jv_Linker::resolve_pool_entry (this_class, index))
+ .field->u.addr;
+}
+
+
// Explicitly throw a no memory exception.
// The collector calls this when it encounters an out-of-memory condition.
void _Jv_ThrowNoMemory()