Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Mar 2003 01:49:00 +0000
From:      Antony T Curtis <antony.t.curtis@ntlworld.com>
To:        Greg Lewis <glewis@eyesbeyond.com>
Cc:        freebsd-java@FreeBSD.ORG
Subject:   Re: FreeBSD JDK 1.3.1_p8 HotSpot not loading from jre/lib/ext???
Message-ID:  <200303140149.02005.antony.t.curtis@ntlworld.com>
In-Reply-To: <20030314065318.A85007@misty.eyesbeyond.com>
References:  <200303120835.AA1746731258@mail.mstar2.net> <200303130053.19295.antony.t.curtis@ntlworld.com> <20030314065318.A85007@misty.eyesbeyond.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--------------Boundary-00=_ODUP67KGNC6DK79FHGGT
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thursday 13 March 2003 8:23 pm, Greg Lewis wrote:
ls
> On Thu, Mar 13, 2003 at 12:53:17AM +0000, Antony T Curtis wrote:
> > On a semi-related thought... Will patchset 9 be adjusted for hotspot =
to
> > use the system gcc on -STABLE (ie gcc 2.9 instead of 3.2)... And will=
 it
> > be possible to have the JDK compiled so that -classic and -hotspot bu=
ilds
> > can coexist?
>
> Maybe and maybe, respectively.  It depends on volunteer time and intere=
st.
> At the moment noone is specifically working on these issues (that I kno=
w
> of).

For #2, I don't know what is so different when hotspot is enabled... My g=
uess=20
is that there must be some quirk in the native threading/ green threading=
 and=20
the libc_r and libc....=20

I'm very tempted to try recompiling the whole shebang with -pthread set f=
or=20
gcc.

> > I have successfully compiled up p8 on my box with the system compiler=
 and
> > it appears to work well. I have also examined the work in jdk1.4 and
> > merged it into 1.3 so that it no longer depends on the uthread_privat=
e.h
> > kernel source.
>
> Where are the patches available? :).

Attached - All I can say about it is that "make -DNODEBUG -DWITH_HOTSPOT=20
- -DNATIVE_BOOTSTRAP" works great for me ;)

> > A "nice" little fun test for java is at www.motionplayground.com
> > With it, you notice that JDK1.3p8 is still way slower than JDK1.4p3
> > And that JDK1.3p7+tya can perform more smoothly than p8...
> > So - theres still some important issues in hotspot in 1.3.
> > (I used Konq to launch the applet)
>
> It does feel like HotSpot in 1.4.1 is more solid and performing better
> than HotSpot in 1.3.1.  We basically need someone to step up to working
> on HotSpot in 1.3.1.

I wouldn't mind having a crack at it - but I rarely have the time nowaday=
s :(

- --=20
Antony T Curtis BSc     Unix Analyst Programmer
http://homepage.ntlworld.com/antony.t.curtis/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+cTUNql7dp2cddmIRAjKvAJ9278RIHFnjmV19LRpGBUJMFGC8nACgoqzp
a8yrhca0nldDx5SZWZBcJRQ=3D
=3DwTmV
-----END PGP SIGNATURE-----

--------------Boundary-00=_ODUP67KGNC6DK79FHGGT
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="jdk13.atc.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="jdk13.atc.patch"

diff -ur jdk13/Makefile jdk13.atc/Makefile
--- jdk13/Makefile	Tue Mar  4 03:07:17 2003
+++ jdk13.atc/Makefile	Thu Mar 13 22:19:20 2003
@@ -118,15 +118,6 @@
 
 .include <bsd.port.pre.mk>
 
-.if defined(WITH_HOTSPOT) && ${OSVERSION} < 500039
-USE_GCC=	3.2
-BUILD_DEPENDS+=	gcc32:${PORTSDIR}/lang/gcc32
-MAKE_ENV+=	ALT_COMPILER_PATH=${LOCALBASE}/bin
-HOTSPOT_BUILD=	../ext/plugin/build/solaris/GNUmakefile \
-	../../hotspot1.3.1/build/linux/makefiles/adlc.make \
-	../../hotspot1.3.1/build/linux/platform_i486
-.endif
-
 .if ${OSVERSION} < 460101 || ( ${OSVERSION} >= 500000 && ${OSVERSION} < 500038 )
 BUILD_DEPENDS+=	gtar:${PORTSDIR}/archivers/gtar
 TAR=		gtar	# Necessary for proper extraction of sources
diff -ur jdk13/work/hotspot1.3.1/build/linux/makefiles/gcc.make jdk13.atc/work/hotspot1.3.1/build/linux/makefiles/gcc.make
--- jdk13/work/hotspot1.3.1/build/linux/makefiles/gcc.make	Fri Mar 14 01:32:05 2003
+++ jdk13.atc/work/hotspot1.3.1/build/linux/makefiles/gcc.make	Fri Mar 14 01:15:08 2003
@@ -17,7 +17,7 @@
 CFLAGS += -fwritable-strings
 CFLAGS += -fno-rtti
 CFLAGS += -fhandle-exceptions
-CFLAGS += -D__STDC__=1 -D_LARGEFILE64_SOURCE -DTEMPLATE_TABLE_BUG
+CFLAGS += -D__STDC__=1 -D_LARGEFILE64_SOURCE
 CFLAGS += -D__GNU__ -D_REENTRANT
 CFLAGS += -fcheck-new
 
@@ -30,76 +30,9 @@
 CFLAGS += $(GCC_SAVE_TEMPS)
 
 # The flags to use for an Optimized g++ build
-#OPT_CFLAGS += -O3
+OPT_CFLAGS += -O3
 
-OPT_CFLAGS += -O0
-# -O1
-#OPT_CFLAGS += -fdefer-pop
-OPT_CFLAGS += -fthread-jumps
-OPT_CFLAGS += -fdelayed-branch
 OPT_CFLAGS += -fomit-frame-pointer
-OPT_CFLAGS += -fguess-branch-probability
-OPT_CFLAGS += -fcprop-registers
-# END
-
-OPT_CFLAGS += -ffloat-store
-OPT_CFLAGS += -fno-default-inline
-OPT_CFLAGS += -fno-defer-pop
-#bad, causes abort()
-#OPT_CFLAGS += -ftrapv
-OPT_CFLAGS += -fno-inline
-OPT_CFLAGS += -fkeep-static-consts
-OPT_CFLAGS += -fmerge-constants
-OPT_CFLAGS += -fmerge-all-constants
-OPT_CFLAGS += -fno-function-cse
-OPT_CFLAGS += -ffast-math
-# END
-
-# -O2
-OPT_CFLAGS += -foptimize-sibling-calls
-OPT_CFLAGS += -fcse-follow-jumps
-OPT_CFLAGS += -fcse-skip-blocks
-OPT_CFLAGS += -fgcse-sm
-OPT_CFLAGS += -fgcse-lm
-OPT_CFLAGS += -fgcse
-
-OPT_CFLAGS += -fexpensive-optimizations
-OPT_CFLAGS += -fstrength-reduce
-OPT_CFLAGS += -frerun-cse-after-loop
-OPT_CFLAGS += -frerun-loop-opt
-OPT_CFLAGS += -fcaller-saves
-OPT_CFLAGS += -fforce-addr
-OPT_CFLAGS += -fforce-mem
-OPT_CFLAGS += -fpeephole2
-##
-OPT_CFLAGS += -fschedule-insns
-OPT_CFLAGS += -fschedule-insns2
-##
-OPT_CFLAGS += -fregmove
-OPT_CFLAGS += -fstrict-aliasing
-OPT_CFLAGS += -fdelete-null-pointer-checks
-OPT_CFLAGS += -freorder-blocks
-# END
-
-OPT_CFLAGS += -fno-gcse
-OPT_CFLAGS += -fdata-sections
-OPT_CFLAGS += -fprefetch-loop-arrays
-OPT_CFLAGS += -fmove-all-movables
-OPT_CFLAGS += -freduce-all-givs
-OPT_CFLAGS += -fno-guess-branch-probability
-
-OPT_CFLAGS += -falign-functions
-OPT_CFLAGS += -falign-labels
-OPT_CFLAGS += -falign-loops
-OPT_CFLAGS += -falign-jumps
-
-OPT_CFLAGS += -fssa
-# END
-
-# -O3
-OPT_CFLAGS += -finline-functions
-OPT_CFLAGS += -frename-registers
-# END
 
 
 #####
@@ -112,7 +45,7 @@
 #OPT_CFLAGS += -fkeep-inline-functions
 #
 OPT_CFLAGS += -funroll-loops
-OPT_CFLAGS += -funroll-all-loops
+#OPT_CFLAGS += -funroll-all-loops
 #####
 
 # Set the environment variable HOTSPARC_HOTSPARC_GENERIC to "true"
diff -ur jdk13/work/hotspot1.3.1/src/os/linux/vm/os_linux.cpp jdk13.atc/work/hotspot1.3.1/src/os/linux/vm/os_linux.cpp
--- jdk13/work/hotspot1.3.1/src/os/linux/vm/os_linux.cpp	Fri Mar 14 01:32:06 2003
+++ jdk13.atc/work/hotspot1.3.1/src/os/linux/vm/os_linux.cpp	Thu Mar 13 23:53:43 2003
@@ -39,12 +39,7 @@
 
 #include <pthread.h>
 #include <pthread_np.h>
-
-#undef pthread_attr_default
-#undef pthread_mutexattr_default
-#undef pthread_condattr_default
-
-#include <uthread/pthread_private.h>
+#include <setjmp.h>
 
 #include <vm/vm.h>
 #include <vm/pmap.h>
@@ -124,82 +119,46 @@
 	}
 }
 
-address os::current_stack_base()
-{
-    uintptr_t	addr,
-		guard_page_size = getpagesize();
-    int 	result;
-    pthread_t	self = pthread_self();
-
-    result = pthread_main_np();
-//    result = pthread_equal(self, _thread_initial);
-#if 1
+address os::current_stack_base() {
 
-    if (result > 0) {
-	    addr  = (uintptr_t) USRSTACK;
-    }
-    else if (result == 0 ) {
-	    //if (self != NULL)
+  uintptr_t addr = NULL;
+  pthread_attr_t attr;
+  void *mystack = NULL;
+  size_t mysize = 0;
+
+  if (pthread_attr_init(&attr) == 0) {
+    if (pthread_attr_get_np(pthread_self(), &attr) != 0)
+        goto err;
+    if (pthread_attr_getstackaddr(&attr, &mystack) != 0)
+        goto err;
+    if (pthread_attr_getstacksize(&attr, &mysize) != 0)
+        goto err;
 
-	    self = pthread_self();
-	    if (!(self > 0)) {
-		fprintf(stderr, "pthread_main_np self == 0x%08x", (uintptr_t) self);
-	    }
-	    else {
-		addr = (uintptr_t) self->stack;
-	    }
-    }
-    else {
-	warning("pthread_main_np reported that _thread_initial == NULL");
-    }
-    return (address) addr;
-
-#else
+    addr = (uintptr_t) mystack + mysize;
+    pthread_attr_destroy(&attr);
 
-    if (self > 0) {
-	addr = (uintptr_t) self->stack;
-	fprintf(stderr, "attr  == 0x%08x\n", addr);
-    }
-    else {
-	fprintf(stderr, "pthread_self failed == 0x%08x\n", (uintptr_t) self);
-    }
     return (address) addr;
+  }
+
+err:
+  fatal("Unable to get current thread stack base pointer");
 
-#endif
 }
 
-// Same for this function too
-//
-// --billh
-int os::current_stack_size()
-{
-    uintptr_t sizep = 0;
-    pthread_t self  = pthread_self();
+size_t os::current_stack_size() {
 
-#if 0
-  if (pthread_equal(self, _thread_initial)) {
-//    if (pthread_main_np()){
-	/* in main()'s thread */
-	struct rlimit r;
-	assert(getrlimit(RLIMIT_STACK, &r) == 0, "os::current_stack_size: getrlimit failed");
-	sizep = (long)r.rlim_cur;
-
-#define PTHREAD_STACK_DEFAULT                   65536
-    } else {
-	sizep = (long) PTHREAD_STACK_DEFAULT;
-    }
-    return sizep;
-#else
-    if (self > 0) {
-	sizep = (uintptr_t) self->attr.stacksize_attr;
+  pthread_attr_t attr;
+  size_t sizep = 0;
 
+  if (pthread_attr_init(&attr) == 0) {
+    if (pthread_attr_get_np(pthread_self(), &attr) == 0) {
+      pthread_attr_getstacksize(&attr, &sizep);
     }
-    else {
-	fprintf(stderr, "pthread_self failed == 0x%08x\n", self);
-    }
-
+    pthread_attr_destroy(&attr);
     return sizep;
-#endif
+  }
+
+  fatal("Unable to get current thread stack base size");
 }
 
 // Part 2
@@ -358,6 +317,7 @@
 #define RT_JAR         "/lib/rt.jar"
 #define I18N_JAR       "/lib/i18n.jar"
 #define SUNRSASIGN_JAR "/lib/sunrsasign.jar"
+#define EXTENSIONS_DIR "/lib/ext"
 #define CLASSES_DIR    "/classes"
 #define DEFAULT_LD_LIBRARY_PATH "/usr/lib" /* See ld.so.1(1) */
 
@@ -431,7 +391,7 @@
 	char * buf;
 //	buf = malloc(strlen(sprops.java_home) + sizeof(MAXNAMLEN));
 	buf = malloc(MAXNAMLEN);
-	snprintf(buf, MAXNAMLEN, "%s", sprops.java_home);
+	snprintf(buf, MAXNAMLEN, "%s" EXTENSIONS_DIR, sprops.java_home);
 	sprops.ext_dirs = buf;
     }
   }
diff -ur jdk13/work/hotspot1.3.1/src/os_cpu/linux_i486/vm/os_linux_i486.cpp jdk13.atc/work/hotspot1.3.1/src/os_cpu/linux_i486/vm/os_linux_i486.cpp
--- jdk13/work/hotspot1.3.1/src/os_cpu/linux_i486/vm/os_linux_i486.cpp	Fri Mar 14 01:32:06 2003
+++ jdk13.atc/work/hotspot1.3.1/src/os_cpu/linux_i486/vm/os_linux_i486.cpp	Fri Mar 14 00:15:28 2003
@@ -35,12 +35,6 @@
 
 #include <setjmp.h>
 
-#undef pthread_attr_default
-#undef pthread_mutexattr_default
-#undef pthread_condattr_default
-
-#include <uthread/pthread_private.h>
-
 #define MAX_PATH (2 * K)
 #define INTERRUPT_SIGNAL SIGUSR1
 
diff -ur jdk13/work/hotspot1.3.1/src/share/vm/interpreter/templateTable.cpp jdk13.atc/work/hotspot1.3.1/src/share/vm/interpreter/templateTable.cpp
--- jdk13/work/hotspot1.3.1/src/share/vm/interpreter/templateTable.cpp	Fri Mar 14 01:32:07 2003
+++ jdk13.atc/work/hotspot1.3.1/src/share/vm/interpreter/templateTable.cpp	Fri Mar 14 00:39:56 2003
@@ -204,6 +204,8 @@
   def(code, flags, in, out, (Template::generator)gen, (int)cc);
 }
 
+
+#undef TEMPLATE_TABLE_BUG
 #if defined(TEMPLATE_TABLE_BUG)
   #define iload  TemplateTable::iload
   #define lload  TemplateTable::lload
diff -ur jdk13/work/hotspot1.3.1/src/share/vm/runtime/os.hpp jdk13.atc/work/hotspot1.3.1/src/share/vm/runtime/os.hpp
--- jdk13/work/hotspot1.3.1/src/share/vm/runtime/os.hpp	Fri Mar 14 01:32:07 2003
+++ jdk13.atc/work/hotspot1.3.1/src/share/vm/runtime/os.hpp	Fri Mar 14 00:05:31 2003
@@ -156,7 +156,7 @@
   static address current_stack_pointer();
   static address current_stack_base();
   static address current_stack_limit();
-  static int current_stack_size();
+  static size_t current_stack_size();
 
   static int message_box(const char* title, const char* message);
 

--------------Boundary-00=_ODUP67KGNC6DK79FHGGT--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200303140149.02005.antony.t.curtis>