From owner-freebsd-java@FreeBSD.ORG Tue Aug 9 05:53:52 2005 Return-Path: X-Original-To: java@FreeBSD.org Delivered-To: freebsd-java@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C107A16A41F for ; Tue, 9 Aug 2005 05:53:52 +0000 (GMT) (envelope-from mi@corbulon.video-collage.com) Received: from mail23.sea5.speakeasy.net (mail23.sea5.speakeasy.net [69.17.117.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id A533A43D46 for ; Tue, 9 Aug 2005 05:53:51 +0000 (GMT) (envelope-from mi@corbulon.video-collage.com) Received: (qmail 12054 invoked from network); 9 Aug 2005 05:53:51 -0000 Received: from aldan.algebra.com ([216.254.65.224]) (envelope-sender ) by mail23.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 9 Aug 2005 05:53:51 -0000 Received: from corbulon.video-collage.com (static-151-204-231-237.bos.east.verizon.net [151.204.231.237]) by aldan.algebra.com (8.13.1/8.13.1) with ESMTP id j795rhYd080509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 9 Aug 2005 01:53:47 -0400 (EDT) (envelope-from mi@corbulon.video-collage.com) Received: from corbulon.video-collage.com (smmsp@localhost.video-collage.com [127.0.0.1]) by corbulon.video-collage.com (8.13.4/8.13.1) with ESMTP id j795rbsl014730 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Aug 2005 01:53:38 -0400 (EDT) (envelope-from mi@corbulon.video-collage.com) Received: (from root@localhost) by corbulon.video-collage.com (8.13.4/8.13.4/Submit) id j795rblk014729; Tue, 9 Aug 2005 01:53:37 -0400 (EDT) (envelope-from mi) From: Mikhail Teterin Message-Id: <200508090553.j795rblk014729@corbulon.video-collage.com> To: glewis@eyesbeyond.com (Greg Lewis) Date: Tue, 9 Aug 2005 01:53:36 -0400 (EDT) In-Reply-To: <20050809052027.GA43606@misty.eyesbeyond.com> X-Mailer: ELM [version 2.5 PL7] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV devel-20050525/1010/Mon Aug 8 19:39:07 2005 on corbulon.video-collage.com X-Virus-Status: Clean X-Scanned-By: MIMEDefang 2.43 Cc: gnome@FreeBSD.org, java@FreeBSD.org, kyle.yuan@sun.com Subject: Re: should not jint be as wide as void* ? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Aug 2005 05:53:53 -0000 > On Sat, Aug 06, 2005 at 01:05:41AM -0400, Mikhail T. wrote: > > Looking deep into Mozilla's LiveConnect sources (under > > mozilla/sun-java/stubs/include/) I gather, jint really > > wants to be intptr_t -- not a mere int as, for example, > > jdk1.5.0/include/freebsd/jni_md.h makes it out to be. > > > > Can anyone comment? Thanks! > > I'm doing a build of the current CVS on FreeBSD 5.4/amd64 at the moment. > It hasn't gotten to the plugin build yet, but I'll be interested to see > (a) if there are warnings about pointer widths and (b) if it works :). I'm, actually, thinking, the jint should be left alone and just the GetJavaWrapper() and its friends be changed to accept intptr_t (or some j-prefixed equivalent) instead of jint. You will not get warnings (in Java) because actual callers of GetJavaWrapper come (I think) from the LiveConnect part of the browsers, which are compiled separately. The HEAD of the spidermonkey (js) tree currently, sort of, expects GetJavaWrapper to take a jlong, when a regular long is 8 bytes (their own strange way of _not_ using intptr_t). But this means, the real GetJavaWrapper and the UnwrapJavaWrapper() need to accept a (pointer to a) truly intptr_t-wide value. Per cscope: Global definition: UnwrapJavaWrapper File Line 0 CNSAdapter_JavaPluginFactory.cpp 389 NS_IMETHODIMP CNSAdapter_JavaPluginFactory::UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj) 1 CFactory_IJVMPlugin.cpp 42 NS_IMETHODIMP CFactory::UnwrapJavaWrapper(JNIEnv* jenv, 2 JSObject.cpp 223 JDresult UnwrapJavaWrapper(RemoteJNIEnv* env, jobject jobj, jint* obj) 3 JavaPluginFactory5.cpp 476 JavaPluginFactory5::UnwrapJavaWrapper(JNIEnv* jenv, jobject jobj, jint* obj) { and: Global definition: GetJavaWrapper File Line 0 CNSAdapter_JavaPluginFactory.cpp 367 NS_IMETHODIMP CNSAdapter_JavaPluginFactory::GetJavaWrapper(JNIEnv* jenv, jint obj, jobject *jobj) 1 CFactory_IJVMPlugin.cpp 19 NS_IMETHODIMP CFactory::GetJavaWrapper(JNIEnv* jenv, jint obj, jobject *jobj) { 2 JavaPluginFactory5.cpp 447 JavaPluginFactory5::GetJavaWrapper(JNIEnv* proxy_env, All of those "jint obj" need to change together with whatever functions these guys themselves call. For you to test it from inside a browser, you'll have to patch Firefox' js/src/liveconnect... It may be easier to just build (and test) the lang/spidermonkey -- I asked portmgr to allow me to unbreak it on amd64. > Until then, its worth noting that the Linux amd64 release from Sun > (1.5.0_04) still has jint defined as int. It appears that Solaris > in 64 bit mode also still has jint defined as an int. This raises > some questions in terms of compatibility for us to change it to be > something other than an int. It is, actually, even better. Sun's jni_md.h defineds jint as int, but jri_md.h (deploy/src/plugin/share/npapi/jri_md.h) has the following code: [...] #ifdef IS_64 /* XXX ok for alpha, but not right on all 64-bit architectures */ typedef unsigned int juint; typedef int jint; #else typedef unsigned long juint; typedef long jint; #endif [...] A bloody mess, that we need to straighten out :-( -mi