From 8af0046eee4fb9e1210d25c79600fbca146c29ec Mon Sep 17 00:00:00 2001 From: aph Date: Fri, 29 Apr 2005 18:35:36 +0000 Subject: 2005-04-27 Andrew Haley 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 --- libjava/prims.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libjava/prims.cc') 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() -- cgit v1.2.3