This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: JNI and java.nio.ByteBuffer


On 12-Feb-05, at 4:56 PM, Anthony Green wrote:

On Thu, 2004-04-29 at 18:34 -0400, Bryce McKinlay wrote:
The problem seems to be due to a bug in our JNI RegisterNatives
implementation.

The problem appears to be that RegisterNatives is being called with signatures like "(IILjava/nio/Buffer;I)", but the signatures in the _Jv_Method are recorded as "(IILjava.nio.Buffer;I)", so we never get a match.

Right. I think there is a PR for this.


Should RegisterNatives handle this, or should the signatures have been
munged already in the _Jv_Method?

The GCJ "dot" format is not valid for JNI and not accepted by other VMs. One option to fix this would be to change GCJ to use the JNI format everywhere, but I think would be a lot of work for not much gain (this would need to change in the compiler, breaking the ABI, as well as in the runtime). We'd gain a little efficiency in some areas, such as JNI, but lose in others. Its probably best to just have RegisterNatives do the conversion internally before searching for the method. This has the side-effect of making GCJ also accept names that arn't valid by the JNI spec, but we can fix that with a bit of additional validation.


Regards

Bryce


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]