This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Problem with static fields and indirect-dispatch
- From: Andrew Haley <aph at redhat dot com>
- To: Casey Marshall <csm at gnu dot org>
- Cc: java at gcc dot gnu dot org
- Date: Thu, 11 May 2006 09:53:24 -0400
- Subject: Re: Problem with static fields and indirect-dispatch
- References: <FE351C39-AC7A-4139-94DA-31C62227EB01@gnu.org>
Casey Marshall writes:
> Hi, I'm seeing a problem with a 4.2.0 snapshot. The following program
> fails to run; without the patch mentioned, it still fails, but in
> `java.lang.Class.initializeClass,' not in `testbc.<clinit>'. Without
> the patch, it fails at line 1663 of link.cc, which is the `if' in:
>
> jstring *strp = (jstring *) f->u.addr;
> if (*strp)
> *strp = _Jv_NewStringUTF8Const ((_Jv_Utf8Const *) *strp);
>
> Running this interpreted, or compiled directly works; compiling it
> with -findirect-dispatch and launching it with `gij' fails.
This works for me with svn HEAD.
Hmm, it looks like there was a missing line in the patch I posted.
This was in the actual checkin of the patch. For the record, the
missing line was:
Index: libjava/gnu/gcj/runtime/natSharedLibLoader.cc
===================================================================
*** libjava/gnu/gcj/runtime/natSharedLibLoader.cc (revision 113673)
--- libjava/gnu/gcj/runtime/natSharedLibLoader.cc (revision 113674)
*************** _Jv_sharedlib_register_hook (jclass cls)
*** 45,49 ****
cls->protectionDomain = curHelper->domain;
cls->loader = curLoader;
! cls->engine = &_Jv_soleCompiledEngine;
curHelper->registerClass(cls->getName(), cls);
}
--- 45,50 ----
cls->protectionDomain = curHelper->domain;
cls->loader = curLoader;
! if (! cls->engine)
! cls->engine = &_Jv_soleCompiledEngine;
curHelper->registerClass(cls->getName(), cls);
}
Andrew.