Index: kaffe/configure
diff -u kaffe/configure:1.1.1.17 kaffe/configure:1.22
--- kaffe/configure:1.1.1.17	Mon Sep  7 14:15:10 1998
+++ kaffe/configure	Fri Sep 11 23:02:41 1998
@@ -530,13 +530,12 @@
 fi
 
 
+GVER=1.4.1; KVER=1.00
 
-KVER=1.00
-
 # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:540: checking for $ac_word" >&5
+echo "configure:539: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -565,7 +564,7 @@
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:569: checking for $ac_word" >&5
+echo "configure:568: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -613,7 +612,7 @@
 fi
 
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:617: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:616: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
 
 ac_ext=c
 # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -623,11 +622,11 @@
 cross_compiling=$ac_cv_prog_cc_cross
 
 cat > conftest.$ac_ext <<EOF
-#line 627 "configure"
+#line 626 "configure"
 #include "confdefs.h"
 main(){return(0);}
 EOF
-if { (eval echo configure:631: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   ac_cv_prog_cc_works=yes
   # If we can't run a trivial program, we are probably using a cross compiler.
   if (./conftest; exit) 2>/dev/null; then
@@ -647,12 +646,12 @@
   { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
 fi
 echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:651: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:650: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
 cross_compiling=$ac_cv_prog_cc_cross
 
 echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:656: checking whether we are using GNU C" >&5
+echo "configure:655: checking whether we are using GNU C" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -661,7 +660,7 @@
   yes;
 #endif
 EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:664: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
   ac_cv_prog_gcc=yes
 else
   ac_cv_prog_gcc=no
@@ -676,7 +675,7 @@
   ac_save_CFLAGS="$CFLAGS"
   CFLAGS=
   echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:680: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:679: checking whether ${CC-cc} accepts -g" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -734,7 +733,7 @@
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:738: checking host system type" >&5
+echo "configure:737: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -877,14 +876,14 @@
 	{ echo "configure: error: Configuration $host_cpu-$host_os does not support $want_engine mode" 1>&2; exit 1; }
 fi
 echo $ac_n "checking execution engine""... $ac_c" 1>&6
-echo "configure:881: checking execution engine" >&5
+echo "configure:880: checking execution engine" >&5
 echo "$ac_t""$with_engine" 1>&6
 
 engine_frag=$srcdir/kaffe/kaffevm/$with_engine/Makefile.frag
 
 
 echo $ac_n "checking library type""... $ac_c" 1>&6
-echo "configure:888: checking library type" >&5
+echo "configure:887: checking library type" >&5
 if test "$dynamic_libraries" = "no" ; then
 	echo "$ac_t""static" 1>&6
 else
@@ -899,7 +898,7 @@
 fi
 
 echo $ac_n "checking sun compatibility mode""... $ac_c" 1>&6
-echo "configure:903: checking sun compatibility mode" >&5
+echo "configure:902: checking sun compatibility mode" >&5
 if test "$with_suncompat" = "" ; then
 	with_suncompat=yes
 fi
@@ -917,7 +916,7 @@
 fi
 
 echo $ac_n "checking thread system""... $ac_c" 1>&6
-echo "configure:921: checking thread system" >&5
+echo "configure:920: checking thread system" >&5
 if test "$with_threads" = "" ; then
 	with_threads=unix-jthreads
 fi
@@ -930,7 +929,7 @@
 
 if test "$with_engine" != "intrp" ; then
 	echo $ac_n "checking for trampolines""... $ac_c" 1>&6
-echo "configure:934: checking for trampolines" >&5
+echo "configure:933: checking for trampolines" >&5
 	if test -f $srcdir/config/$host_cpu/trampolines.c ; then
 		link_from="$link_from config/$host_cpu/trampolines.c"
 		link_to="$link_to kaffe/kaffevm/trampolines.c"
@@ -952,7 +951,7 @@
 
 
 echo $ac_n "checking how to generate depend files""... $ac_c" 1>&6
-echo "configure:956: checking how to generate depend files" >&5
+echo "configure:955: checking how to generate depend files" >&5
 if test "$DEPTOOL" = ""; then
 			DEPTOOL="true"
 	INC_DEPEND="# automatic dependency generation not enabled in configure"
@@ -1024,7 +1023,7 @@
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1028: checking for a BSD compatible install" >&5
+echo "configure:1027: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1074,7 +1073,7 @@
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
 echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:1078: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:1077: checking whether ${MAKE-make} sets \${MAKE}" >&5
 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1103,7 +1102,7 @@
 # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1107: checking for $ac_word" >&5
+echo "configure:1106: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1132,7 +1131,7 @@
 # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1136: checking for $ac_word" >&5
+echo "configure:1135: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1162,7 +1161,7 @@
 # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1166: checking for $ac_word" >&5
+echo "configure:1165: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_MKDIR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1194,7 +1193,7 @@
 # Extract the first word of "dlltool", so it can be a program name with args.
 set dummy dlltool; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1198: checking for $ac_word" >&5
+echo "configure:1197: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1224,7 +1223,7 @@
 
 if test "$LN_S" = "" ; then
 	echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1228: checking whether ln -s works" >&5
+echo "configure:1227: checking whether ln -s works" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1256,7 +1255,7 @@
 
 
 echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1260: checking size of short" >&5
+echo "configure:1259: checking size of short" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1264,7 +1263,7 @@
   ac_cv_sizeof_short=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1268 "configure"
+#line 1267 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1275,7 +1274,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1279: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1278: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_short=`cat conftestval`
 else
@@ -1295,7 +1294,7 @@
 
 
 echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1299: checking size of int" >&5
+echo "configure:1298: checking size of int" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1303,7 +1302,7 @@
   ac_cv_sizeof_int=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1307 "configure"
+#line 1306 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1314,7 +1313,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_int=`cat conftestval`
 else
@@ -1334,7 +1333,7 @@
 
 
 echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1338: checking size of long" >&5
+echo "configure:1337: checking size of long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1342,7 +1341,7 @@
   ac_cv_sizeof_long=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1346 "configure"
+#line 1345 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1353,7 +1352,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long=`cat conftestval`
 else
@@ -1373,7 +1372,7 @@
 
 
 echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1377: checking size of long long" >&5
+echo "configure:1376: checking size of long long" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1381,7 +1380,7 @@
   ac_cv_sizeof_long_long=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1385 "configure"
+#line 1384 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1392,7 +1391,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_long_long=`cat conftestval`
 else
@@ -1412,7 +1411,7 @@
 
 
 echo $ac_n "checking size of __int64""... $ac_c" 1>&6
-echo "configure:1416: checking size of __int64" >&5
+echo "configure:1415: checking size of __int64" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1420,7 +1419,7 @@
   ac_cv_sizeof___int64=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1424 "configure"
+#line 1423 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1431,7 +1430,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1435: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1434: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof___int64=`cat conftestval`
 else
@@ -1451,7 +1450,7 @@
 
 
 echo $ac_n "checking size of void*""... $ac_c" 1>&6
-echo "configure:1455: checking size of void*" >&5
+echo "configure:1454: checking size of void*" >&5
 if eval "test \"`echo '$''{'ac_cv_sizeof_voidp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1459,7 +1458,7 @@
   ac_cv_sizeof_voidp=0
 else
   cat > conftest.$ac_ext <<EOF
-#line 1463 "configure"
+#line 1462 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main()
@@ -1470,7 +1469,7 @@
   exit(0);
 }
 EOF
-if { (eval echo configure:1474: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1473: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_sizeof_voidp=`cat conftestval`
 else
@@ -1492,7 +1491,7 @@
 
 
 echo $ac_n "checking alignment of void*""... $ac_c" 1>&6
-echo "configure:1496: checking alignment of void*" >&5
+echo "configure:1495: checking alignment of void*" >&5
 if eval "test \"`echo '$''{'ac_cv_alignmentof_voidp'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1500,7 +1499,7 @@
   ac_cv_alignmentof_voidp=1
 else
   cat > conftest.$ac_ext <<EOF
-#line 1504 "configure"
+#line 1503 "configure"
 #include "confdefs.h"
 #include <stdio.h>
 main() { struct { char c; void *p; } t; FILE *f;
@@ -1510,7 +1509,7 @@
   fprintf (f, "%d", ((char*) &t.p)-((char*) &t));
   fclose(f); exit (0); }
 EOF
-if { (eval echo configure:1514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_alignmentof_voidp=`cat conftestdata`
 else
@@ -1532,12 +1531,12 @@
 
 
 echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1536: checking return type of signal handlers" >&5
+echo "configure:1535: checking return type of signal handlers" >&5
 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1541 "configure"
+#line 1540 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <signal.h>
@@ -1554,7 +1553,7 @@
 int i;
 ; return 0; }
 EOF
-if { (eval echo configure:1558: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1557: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_type_signal=void
 else
@@ -1573,7 +1572,7 @@
 
 
 echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1577: checking how to run the C preprocessor" >&5
+echo "configure:1576: checking how to run the C preprocessor" >&5
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
@@ -1588,13 +1587,13 @@
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp.
   cat > conftest.$ac_ext <<EOF
-#line 1592 "configure"
+#line 1591 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1598: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1597: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1605,13 +1604,13 @@
   rm -rf conftest*
   CPP="${CC-cc} -E -traditional-cpp"
   cat > conftest.$ac_ext <<EOF
-#line 1609 "configure"
+#line 1608 "configure"
 #include "confdefs.h"
 #include <assert.h>
 Syntax Error
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1615: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1614: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   :
@@ -1634,12 +1633,12 @@
 echo "$ac_t""$CPP" 1>&6
 
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1638: checking for ANSI C header files" >&5
+echo "configure:1637: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1643 "configure"
+#line 1642 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -1647,7 +1646,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1650: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -1664,7 +1663,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1668 "configure"
+#line 1667 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -1682,7 +1681,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 1686 "configure"
+#line 1685 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -1703,7 +1702,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 1707 "configure"
+#line 1706 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1714,7 +1713,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:1718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -1738,12 +1737,12 @@
 fi
 
 echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:1742: checking for size_t" >&5
+echo "configure:1741: checking for size_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1747 "configure"
+#line 1746 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1771,12 +1770,12 @@
 fi
 
 echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:1775: checking for ssize_t" >&5
+echo "configure:1774: checking for ssize_t" >&5
 if eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 1780 "configure"
+#line 1779 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #if STDC_HEADERS
@@ -1810,7 +1809,7 @@
 
 
 echo $ac_n "checking for printf in -lc""... $ac_c" 1>&6
-echo "configure:1814: checking for printf in -lc" >&5
+echo "configure:1813: checking for printf in -lc" >&5
 ac_lib_var=`echo c'_'printf | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1818,7 +1817,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1822 "configure"
+#line 1821 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1829,7 +1828,7 @@
 printf()
 ; return 0; }
 EOF
-if { (eval echo configure:1833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1832: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1857,7 +1856,7 @@
 fi
 
 echo $ac_n "checking for sin in -lm""... $ac_c" 1>&6
-echo "configure:1861: checking for sin in -lm" >&5
+echo "configure:1860: checking for sin in -lm" >&5
 ac_lib_var=`echo m'_'sin | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1865,7 +1864,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lm  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1869 "configure"
+#line 1868 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1876,7 +1875,7 @@
 sin()
 ; return 0; }
 EOF
-if { (eval echo configure:1880: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1904,7 +1903,7 @@
 fi
 
 echo $ac_n "checking for mpz_abs in -lgmp""... $ac_c" 1>&6
-echo "configure:1908: checking for mpz_abs in -lgmp" >&5
+echo "configure:1907: checking for mpz_abs in -lgmp" >&5
 ac_lib_var=`echo gmp'_'mpz_abs | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1912,7 +1911,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgmp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1916 "configure"
+#line 1915 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1923,7 +1922,7 @@
 mpz_abs()
 ; return 0; }
 EOF
-if { (eval echo configure:1927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1955,7 +1954,7 @@
 
 if test "$dynamic_libraries" = "yes" ; then
 		echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:1959: checking for dlopen in -ldl" >&5
+echo "configure:1958: checking for dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1963,7 +1962,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1967 "configure"
+#line 1966 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1974,7 +1973,7 @@
 dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:1978: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2003,7 +2002,7 @@
 
 	if test "$ac_cv_lib_dl_dlopen" = "no" ; then
 		echo $ac_n "checking for _dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2007: checking for _dlopen in -ldl" >&5
+echo "configure:2006: checking for _dlopen in -ldl" >&5
 ac_lib_var=`echo dl'_'_dlopen | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2011,7 +2010,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2015 "configure"
+#line 2014 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2022,7 +2021,7 @@
 _dlopen()
 ; return 0; }
 EOF
-if { (eval echo configure:2026: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2051,7 +2050,7 @@
 
 		if test "$ac_cv_lib_dl__dlopen" = "no" ; then
 			echo $ac_n "checking for dld_init in -ldld""... $ac_c" 1>&6
-echo "configure:2055: checking for dld_init in -ldld" >&5
+echo "configure:2054: checking for dld_init in -ldld" >&5
 ac_lib_var=`echo dld'_'dld_init | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2059,7 +2058,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldld  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2063 "configure"
+#line 2062 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2070,7 +2069,7 @@
 dld_init()
 ; return 0; }
 EOF
-if { (eval echo configure:2074: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2073: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2104,12 +2103,12 @@
 
 
 echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:2108: checking for gethostbyname" >&5
+echo "configure:2107: checking for gethostbyname" >&5
 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2113 "configure"
+#line 2112 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char gethostbyname(); below.  */
@@ -2132,7 +2131,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2136: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2135: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_gethostbyname=yes"
 else
@@ -2153,7 +2152,7 @@
 
 if test $ac_cv_func_gethostbyname = no; then
       echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:2157: checking for gethostbyname in -lnsl" >&5
+echo "configure:2156: checking for gethostbyname in -lnsl" >&5
 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2161,7 +2160,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lnsl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2165 "configure"
+#line 2164 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2172,7 +2171,7 @@
 gethostbyname()
 ; return 0; }
 EOF
-if { (eval echo configure:2176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2201,12 +2200,12 @@
 
 fi
 echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:2205: checking for connect" >&5
+echo "configure:2204: checking for connect" >&5
 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2210 "configure"
+#line 2209 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char connect(); below.  */
@@ -2229,7 +2228,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:2233: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_connect=yes"
 else
@@ -2250,7 +2249,7 @@
 
 if test $ac_cv_func_connect = no; then
   echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:2254: checking for connect in -lsocket" >&5
+echo "configure:2253: checking for connect in -lsocket" >&5
 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2258,7 +2257,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lsocket  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2262 "configure"
+#line 2261 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2269,7 +2268,7 @@
 connect()
 ; return 0; }
 EOF
-if { (eval echo configure:2273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2272: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2300,7 +2299,7 @@
 
 
 echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:2304: checking for deflate in -lz" >&5
+echo "configure:2303: checking for deflate in -lz" >&5
 ac_lib_var=`echo z'_'deflate | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2308,7 +2307,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lz  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2312 "configure"
+#line 2311 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2319,7 +2318,7 @@
 deflate()
 ; return 0; }
 EOF
-if { (eval echo configure:2323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2349,7 +2348,7 @@
 
 
 echo $ac_n "checking for mpz_add in -lgmp""... $ac_c" 1>&6
-echo "configure:2353: checking for mpz_add in -lgmp" >&5
+echo "configure:2352: checking for mpz_add in -lgmp" >&5
 ac_lib_var=`echo gmp'_'mpz_add | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2357,7 +2356,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgmp  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2361 "configure"
+#line 2360 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2368,7 +2367,7 @@
 mpz_add()
 ; return 0; }
 EOF
-if { (eval echo configure:2372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2402,7 +2401,7 @@
 # Uses ac_ vars as temps to allow command line to override cache and checks.
 # --without-x overrides everything else, but does not touch the cache.
 echo $ac_n "checking for X""... $ac_c" 1>&6
-echo "configure:2406: checking for X" >&5
+echo "configure:2405: checking for X" >&5
 
 # Check whether --with-x or --without-x was given.
 if test "${with_x+set}" = set; then
@@ -2464,12 +2463,12 @@
 
   # First, try using that file with no special directory specified.
 cat > conftest.$ac_ext <<EOF
-#line 2468 "configure"
+#line 2467 "configure"
 #include "confdefs.h"
 #include <$x_direct_test_include>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2472: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2538,14 +2537,14 @@
   ac_save_LIBS="$LIBS"
   LIBS="-l$x_direct_test_library $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2542 "configure"
+#line 2541 "configure"
 #include "confdefs.h"
 
 int main() {
 ${x_direct_test_function}()
 ; return 0; }
 EOF
-if { (eval echo configure:2549: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   LIBS="$ac_save_LIBS"
 # We can link X programs with no special library path.
@@ -2647,7 +2646,7 @@
 
 
 echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:2651: checking for shmat in -lipc" >&5
+echo "configure:2650: checking for shmat in -lipc" >&5
 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2655,7 +2654,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lipc  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2659 "configure"
+#line 2658 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2666,7 +2665,7 @@
 shmat()
 ; return 0; }
 EOF
-if { (eval echo configure:2670: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2669: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2697,7 +2696,7 @@
 OLIBS=$LIBS
 LIBS="$LIBS $X_LIBRARIES"
 echo $ac_n "checking for jpeg_read_header in -ljpeg""... $ac_c" 1>&6
-echo "configure:2701: checking for jpeg_read_header in -ljpeg" >&5
+echo "configure:2700: checking for jpeg_read_header in -ljpeg" >&5
 ac_lib_var=`echo jpeg'_'jpeg_read_header | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2705,7 +2704,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ljpeg  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2709 "configure"
+#line 2708 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2716,7 +2715,7 @@
 jpeg_read_header()
 ; return 0; }
 EOF
-if { (eval echo configure:2720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2744,7 +2743,7 @@
 fi
 
 echo $ac_n "checking for png_create_info_struct in -lpng""... $ac_c" 1>&6
-echo "configure:2748: checking for png_create_info_struct in -lpng" >&5
+echo "configure:2747: checking for png_create_info_struct in -lpng" >&5
 ac_lib_var=`echo png'_'png_create_info_struct | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2752,7 +2751,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lpng  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2756 "configure"
+#line 2755 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2763,7 +2762,7 @@
 png_create_info_struct()
 ; return 0; }
 EOF
-if { (eval echo configure:2767: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2766: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2791,7 +2790,7 @@
 fi
 
 echo $ac_n "checking for DGifOpenFileHandle in -lgif""... $ac_c" 1>&6
-echo "configure:2795: checking for DGifOpenFileHandle in -lgif" >&5
+echo "configure:2794: checking for DGifOpenFileHandle in -lgif" >&5
 ac_lib_var=`echo gif'_'DGifOpenFileHandle | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -2799,7 +2798,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lgif  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2803 "configure"
+#line 2802 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2810,7 +2809,7 @@
 DGifOpenFileHandle()
 ; return 0; }
 EOF
-if { (eval echo configure:2814: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2813: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2849,12 +2848,12 @@
 OCPPFLAGS=$CPPFLAGS
 CPPFLAGS="$CPPFLAGS -I/usr/local/include"
 echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2853: checking for ANSI C header files" >&5
+echo "configure:2852: checking for ANSI C header files" >&5
 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2858 "configure"
+#line 2857 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 #include <stdarg.h>
@@ -2862,7 +2861,7 @@
 #include <float.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2865: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2879,7 +2878,7 @@
 if test $ac_cv_header_stdc = yes; then
   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2883 "configure"
+#line 2882 "configure"
 #include "confdefs.h"
 #include <string.h>
 EOF
@@ -2897,7 +2896,7 @@
 if test $ac_cv_header_stdc = yes; then
   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
 cat > conftest.$ac_ext <<EOF
-#line 2901 "configure"
+#line 2900 "configure"
 #include "confdefs.h"
 #include <stdlib.h>
 EOF
@@ -2918,7 +2917,7 @@
   :
 else
   cat > conftest.$ac_ext <<EOF
-#line 2922 "configure"
+#line 2921 "configure"
 #include "confdefs.h"
 #include <ctype.h>
 #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2929,7 +2928,7 @@
 exit (0); }
 
 EOF
-if { (eval echo configure:2933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   :
 else
@@ -2956,17 +2955,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2960: checking for $ac_hdr" >&5
+echo "configure:2959: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 2965 "configure"
+#line 2964 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2970: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2969: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -2997,12 +2996,12 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:3001: checking for $ac_hdr that defines DIR" >&5
+echo "configure:3000: checking for $ac_hdr that defines DIR" >&5
 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3006 "configure"
+#line 3005 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_hdr>
@@ -3010,7 +3009,7 @@
 DIR *dirp = 0;
 ; return 0; }
 EOF
-if { (eval echo configure:3014: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3013: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   eval "ac_cv_header_dirent_$ac_safe=yes"
 else
@@ -3035,7 +3034,7 @@
 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
 if test $ac_header_dirent = dirent.h; then
 echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:3039: checking for opendir in -ldir" >&5
+echo "configure:3038: checking for opendir in -ldir" >&5
 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3043,7 +3042,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-ldir  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3047 "configure"
+#line 3046 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3054,7 +3053,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:3058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3057: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3076,7 +3075,7 @@
 
 else
 echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:3080: checking for opendir in -lx" >&5
+echo "configure:3079: checking for opendir in -lx" >&5
 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3084,7 +3083,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lx  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3088 "configure"
+#line 3087 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3095,7 +3094,7 @@
 opendir()
 ; return 0; }
 EOF
-if { (eval echo configure:3099: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3122,12 +3121,12 @@
 
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3126: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3125: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3131 "configure"
+#line 3130 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/time.h>
@@ -3136,7 +3135,7 @@
 struct tm *tp;
 ; return 0; }
 EOF
-if { (eval echo configure:3140: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3139: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_header_time=yes
 else
@@ -3157,12 +3156,12 @@
 fi
 
 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:3161: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:3160: checking whether struct tm is in sys/time.h or time.h" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3166 "configure"
+#line 3165 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <time.h>
@@ -3170,7 +3169,7 @@
 struct tm *tp; tp->tm_sec;
 ; return 0; }
 EOF
-if { (eval echo configure:3174: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3173: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm=time.h
 else
@@ -3191,12 +3190,12 @@
 fi
 
 echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:3195: checking for tm_zone in struct tm" >&5
+echo "configure:3194: checking for tm_zone in struct tm" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3200 "configure"
+#line 3199 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <$ac_cv_struct_tm>
@@ -3204,7 +3203,7 @@
 struct tm tm; tm.tm_zone;
 ; return 0; }
 EOF
-if { (eval echo configure:3208: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3207: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_tm_zone=yes
 else
@@ -3224,12 +3223,12 @@
 
 else
   echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:3228: checking for tzname" >&5
+echo "configure:3227: checking for tzname" >&5
 if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3233 "configure"
+#line 3232 "configure"
 #include "confdefs.h"
 #include <time.h>
 #ifndef tzname /* For SGI.  */
@@ -3239,7 +3238,7 @@
 atoi(*tzname);
 ; return 0; }
 EOF
-if { (eval echo configure:3243: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3242: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_var_tzname=yes
 else
@@ -3261,14 +3260,14 @@
 fi
 
 echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3265: checking whether byte ordering is bigendian" >&5
+echo "configure:3264: checking whether byte ordering is bigendian" >&5
 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_bigendian=unknown
 # See if sys/param.h defines the BYTE_ORDER macro.
 cat > conftest.$ac_ext <<EOF
-#line 3272 "configure"
+#line 3271 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3279,11 +3278,11 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3283: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3282: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   # It does; now see whether it defined to BIG_ENDIAN or not.
 cat > conftest.$ac_ext <<EOF
-#line 3287 "configure"
+#line 3286 "configure"
 #include "confdefs.h"
 #include <sys/types.h>
 #include <sys/param.h>
@@ -3294,7 +3293,7 @@
 #endif
 ; return 0; }
 EOF
-if { (eval echo configure:3298: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3297: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_bigendian=yes
 else
@@ -3314,7 +3313,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3318 "configure"
+#line 3317 "configure"
 #include "confdefs.h"
 main () {
   /* Are we little or big endian?  From Harbison&Steele.  */
@@ -3327,7 +3326,7 @@
   exit (u.c[sizeof (long) - 1] == 1);
 }
 EOF
-if { (eval echo configure:3331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_bigendian=no
 else
@@ -3351,14 +3350,14 @@
 fi
 
 echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6
-echo "configure:3355: checking whether char is unsigned" >&5
+echo "configure:3354: checking whether char is unsigned" >&5
 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   if test "$GCC" = yes; then
   # GCC predefines this symbol on systems where it applies.
 cat > conftest.$ac_ext <<EOF
-#line 3362 "configure"
+#line 3361 "configure"
 #include "confdefs.h"
 #ifdef __CHAR_UNSIGNED__
   yes
@@ -3380,7 +3379,7 @@
     { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
 else
   cat > conftest.$ac_ext <<EOF
-#line 3384 "configure"
+#line 3383 "configure"
 #include "confdefs.h"
 /* volatile prevents gcc2 from optimizing the test away on sparcs.  */
 #if !defined(__STDC__) || __STDC__ != 1
@@ -3390,7 +3389,7 @@
   volatile char c = 255; exit(c < 0);
 }
 EOF
-if { (eval echo configure:3394: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3393: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_c_char_unsigned=yes
 else
@@ -3414,21 +3413,21 @@
 fi
 
 echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:3418: checking for inline" >&5
+echo "configure:3417: checking for inline" >&5
 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_cv_c_inline=no
 for ac_kw in inline __inline__ __inline; do
   cat > conftest.$ac_ext <<EOF
-#line 3425 "configure"
+#line 3424 "configure"
 #include "confdefs.h"
 
 int main() {
 } $ac_kw foo() {
 ; return 0; }
 EOF
-if { (eval echo configure:3432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3431: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_c_inline=$ac_kw; break
 else
@@ -3456,12 +3455,12 @@
 
 
 echo $ac_n "checking for struct sigcontext""... $ac_c" 1>&6
-echo "configure:3460: checking for struct sigcontext" >&5
+echo "configure:3459: checking for struct sigcontext" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_sigcontext'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3465 "configure"
+#line 3464 "configure"
 #include "confdefs.h"
 #include <asm/signal.h>
 #include <asm/sigcontext.h>
@@ -3469,7 +3468,7 @@
 struct sigcontext t;
 ; return 0; }
 EOF
-if { (eval echo configure:3473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_sigcontext=yes
 else
@@ -3491,19 +3490,19 @@
 
 
 echo $ac_n "checking for struct sigcontext_struct (without asm/sigcontext.h)""... $ac_c" 1>&6
-echo "configure:3495: checking for struct sigcontext_struct (without asm/sigcontext.h)" >&5
+echo "configure:3494: checking for struct sigcontext_struct (without asm/sigcontext.h)" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_sigcontext_struct'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3500 "configure"
+#line 3499 "configure"
 #include "confdefs.h"
 #include <asm/signal.h>
 int main() {
 struct sigcontext_struct t;
 ; return 0; }
 EOF
-if { (eval echo configure:3507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3506: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_sigcontext_struct=yes
 else
@@ -3518,12 +3517,12 @@
 echo "$ac_t""$ac_cv_struct_sigcontext_struct" 1>&6
 
 echo $ac_n "checking for struct sigcontext_struct (with asm/sigcontext.h)""... $ac_c" 1>&6
-echo "configure:3522: checking for struct sigcontext_struct (with asm/sigcontext.h)" >&5
+echo "configure:3521: checking for struct sigcontext_struct (with asm/sigcontext.h)" >&5
 if eval "test \"`echo '$''{'ac_cv_struct_sigcontext_struct_with'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3527 "configure"
+#line 3526 "configure"
 #include "confdefs.h"
 #include <asm/signal.h>
 #include <asm/sigcontext.h>
@@ -3531,7 +3530,7 @@
 struct sigcontext_struct t;
 ; return 0; }
 EOF
-if { (eval echo configure:3535: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3534: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_struct_sigcontext_struct_with=yes
 else
@@ -3555,12 +3554,12 @@
 
 
 echo $ac_n "checking for strftime""... $ac_c" 1>&6
-echo "configure:3559: checking for strftime" >&5
+echo "configure:3558: checking for strftime" >&5
 if eval "test \"`echo '$''{'ac_cv_func_strftime'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3564 "configure"
+#line 3563 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char strftime(); below.  */
@@ -3583,7 +3582,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3587: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_strftime=yes"
 else
@@ -3605,7 +3604,7 @@
   echo "$ac_t""no" 1>&6
 # strftime is in -lintl on SCO UNIX.
 echo $ac_n "checking for strftime in -lintl""... $ac_c" 1>&6
-echo "configure:3609: checking for strftime in -lintl" >&5
+echo "configure:3608: checking for strftime in -lintl" >&5
 ac_lib_var=`echo intl'_'strftime | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3613,7 +3612,7 @@
   ac_save_LIBS="$LIBS"
 LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3617 "configure"
+#line 3616 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -3624,7 +3623,7 @@
 strftime()
 ; return 0; }
 EOF
-if { (eval echo configure:3628: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -3654,17 +3653,17 @@
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3658: checking for $ac_hdr" >&5
+echo "configure:3657: checking for $ac_hdr" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3663 "configure"
+#line 3662 "configure"
 #include "confdefs.h"
 #include <$ac_hdr>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3668: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3667: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3693,12 +3692,12 @@
 for ac_func in getpagesize
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3697: checking for $ac_func" >&5
+echo "configure:3696: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3702 "configure"
+#line 3701 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3721,7 +3720,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3724: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3746,7 +3745,7 @@
 done
 
 echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:3750: checking for working mmap" >&5
+echo "configure:3749: checking for working mmap" >&5
 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -3754,7 +3753,7 @@
   ac_cv_func_mmap_fixed_mapped=no
 else
   cat > conftest.$ac_ext <<EOF
-#line 3758 "configure"
+#line 3757 "configure"
 #include "confdefs.h"
 
 /* Thanks to Mike Haertel and Jim Avera for this test.
@@ -3894,7 +3893,7 @@
 }
 
 EOF
-if { (eval echo configure:3898: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_func_mmap_fixed_mapped=yes
 else
@@ -3919,12 +3918,12 @@
 for ac_func in select socket getsockname
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3923: checking for $ac_func" >&5
+echo "configure:3922: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3928 "configure"
+#line 3927 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -3947,7 +3946,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:3951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -3974,12 +3973,12 @@
 for ac_func in memcpy memmove
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3978: checking for $ac_func" >&5
+echo "configure:3977: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3983 "configure"
+#line 3982 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4002,7 +4001,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4005: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4029,12 +4028,12 @@
 for ac_func in mkdir
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4033: checking for $ac_func" >&5
+echo "configure:4032: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4038 "configure"
+#line 4037 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4057,7 +4056,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4061: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4060: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4084,12 +4083,12 @@
 for ac_func in getcwd getwd gettimeofday ftime time uname getuid
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4088: checking for $ac_func" >&5
+echo "configure:4087: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4093 "configure"
+#line 4092 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4112,7 +4111,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4116: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4139,12 +4138,12 @@
 for ac_func in remainder remainderf fmod drem rint floor ceil finite isinf isnan strtod strdup
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4143: checking for $ac_func" >&5
+echo "configure:4142: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4148 "configure"
+#line 4147 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4167,7 +4166,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4170: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4194,12 +4193,12 @@
 for ac_func in strerror hstrerror
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4198: checking for $ac_func" >&5
+echo "configure:4197: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4203 "configure"
+#line 4202 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4222,7 +4221,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4225: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4249,12 +4248,12 @@
 for ac_func in fcntl ioctl
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4253: checking for $ac_func" >&5
+echo "configure:4252: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4258 "configure"
+#line 4257 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4277,7 +4276,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4281: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4280: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4304,12 +4303,12 @@
 for ac_func in alarm setitimer
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4308: checking for $ac_func" >&5
+echo "configure:4307: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4313 "configure"
+#line 4312 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4332,7 +4331,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4359,12 +4358,12 @@
 for ac_func in sigprocmask sigsetmask sigemptyset sigaddset signal sigaction
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4363: checking for $ac_func" >&5
+echo "configure:4362: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4368 "configure"
+#line 4367 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4387,7 +4386,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4391: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4390: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4414,12 +4413,12 @@
 for ac_func in sbrk valloc memalign mallopt
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4418: checking for $ac_func" >&5
+echo "configure:4417: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4423 "configure"
+#line 4422 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4442,7 +4441,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4446: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4445: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4469,12 +4468,12 @@
 for ac_func in waitpid kill fork execve execvp
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4473: checking for $ac_func" >&5
+echo "configure:4472: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4478 "configure"
+#line 4477 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4497,7 +4496,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4501: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4524,12 +4523,12 @@
 for ac_func in rld_load shl_load LoadLibrary dld_link
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4528: checking for $ac_func" >&5
+echo "configure:4527: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4533 "configure"
+#line 4532 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4552,7 +4551,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4556: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4555: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4579,12 +4578,12 @@
 for ac_func in sync fsync
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4583: checking for $ac_func" >&5
+echo "configure:4582: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4588 "configure"
+#line 4587 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4607,7 +4606,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4610: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4634,12 +4633,12 @@
 for ac_func in atexit on_exit vsnprintf snprintf
 do
 echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4638: checking for $ac_func" >&5
+echo "configure:4637: checking for $ac_func" >&5
 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4643 "configure"
+#line 4642 "configure"
 #include "confdefs.h"
 /* System header to define __stub macros and hopefully few prototypes,
     which can conflict with char $ac_func(); below.  */
@@ -4662,7 +4661,7 @@
 
 ; return 0; }
 EOF
-if { (eval echo configure:4666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4665: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   eval "ac_cv_func_$ac_func=yes"
 else
@@ -4688,12 +4687,12 @@
 
 
 echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:4692: checking for dlopen" >&5
+echo "configure:4691: checking for dlopen" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4697 "configure"
+#line 4696 "configure"
 #include "confdefs.h"
 #ifdef HAVE_DLFCN_H
 #include <dlfcn.h>
@@ -4704,7 +4703,7 @@
 dlopen(0, 0)
 ; return 0; }
 EOF
-if { (eval echo configure:4708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_dlopen=yes
 else
@@ -4726,12 +4725,12 @@
 fi
 
 echo $ac_n "checking for dlerror""... $ac_c" 1>&6
-echo "configure:4730: checking for dlerror" >&5
+echo "configure:4729: checking for dlerror" >&5
 if eval "test \"`echo '$''{'ac_cv_func_dlerror'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4735 "configure"
+#line 4734 "configure"
 #include "confdefs.h"
 #ifdef HAVE_DLFCN_H
 #include <dlfcn.h>
@@ -4742,7 +4741,7 @@
 dlerror()
 ; return 0; }
 EOF
-if { (eval echo configure:4746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4745: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_func_dlerror=yes
 else
@@ -4766,19 +4765,19 @@
 
 if test "$host_cpu" = "alpha" ; then
   echo $ac_n "checking for alpha support of amask instruction""... $ac_c" 1>&6
-echo "configure:4770: checking for alpha support of amask instruction" >&5
+echo "configure:4769: checking for alpha support of amask instruction" >&5
 if eval "test \"`echo '$''{'ac_cv_alpha_asm_amask'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4775 "configure"
+#line 4774 "configure"
 #include "confdefs.h"
 
 int main() {
  long r; __asm__("amask 1,%0" : "=r"(r)); return !r; 
 ; return 0; }
 EOF
-if { (eval echo configure:4782: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4781: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_alpha_asm_amask=yes
 else
@@ -4803,12 +4802,12 @@
 
 
 echo $ac_n "checking for declaration of select""... $ac_c" 1>&6
-echo "configure:4807: checking for declaration of select" >&5
+echo "configure:4806: checking for declaration of select" >&5
 if eval "test \"`echo '$''{'ac_cv_declared_select'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4812 "configure"
+#line 4811 "configure"
 #include "confdefs.h"
 
 #ifdef HAVE_UNISTD_H
@@ -4825,7 +4824,7 @@
  void *foo = select; 
 ; return 0; }
 EOF
-if { (eval echo configure:4829: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4828: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
   rm -rf conftest*
   ac_cv_declared_select=yes; cat >> confdefs.h <<\EOF
 #define HAVE_DECLARED_SELECT 1
@@ -4846,7 +4845,7 @@
 
 
 echo $ac_n "checking for underscore in dlsym""... $ac_c" 1>&6
-echo "configure:4850: checking for underscore in dlsym" >&5
+echo "configure:4849: checking for underscore in dlsym" >&5
 if eval "test \"`echo '$''{'ac_cv_underscore'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -4855,13 +4854,13 @@
   ac_cv_underscore=cross
 else
   cat > conftest.$ac_ext <<EOF
-#line 4859 "configure"
+#line 4858 "configure"
 #include "confdefs.h"
 main()
 {void* lib = (void*)dlopen(_LIBC_);
   if (dlsym(lib, "_printf") != 0) { exit(0); } else { exit(1); } }
 EOF
-if { (eval echo configure:4865: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
 then
   ac_cv_underscore=yes
 else
@@ -4884,19 +4883,19 @@
 fi
 
 echo $ac_n "checking for underscore in C assembly names""... $ac_c" 1>&6
-echo "configure:4888: checking for underscore in C assembly names" >&5
+echo "configure:4887: checking for underscore in C assembly names" >&5
 if eval "test \"`echo '$''{'ac_cv_underscore_c_names'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 4893 "configure"
+#line 4892 "configure"
 #include "confdefs.h"
 extern int foo_alias();asm("\n_foo_alias:");void foo() {};
 int main() {
 foo_alias();
 ; return 0; }
 EOF
-if { (eval echo configure:4900: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:4899: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
   rm -rf conftest*
   ac_cv_underscore_c_names=yes
 else
@@ -4953,12 +4952,29 @@
 fi
 
 
+if test x"$enable_guarana" != xno &&
+   test -d $srcdir/kaffe/kaffevm/guarana ; then
+	cat >> confdefs.h <<\EOF
+#define GUARANA 1
+EOF
+
+	COMMENT_GUARANA=
+	GUARANALIB="../kaffevm/libguarana$LIBEXT"
+else
+	COMMENT_GUARANA="#"
+	GUARANALIB=
+fi
+
+
+
 if test "$dynamic_libraries" = "yes" ; then
 	NOSHAREDLIBS="-L../kaffevm -lkaffevm $VM_LIBRARIES $STD_LIBRARIES"
 	KAFFE_LIBDEP=""
 else
 	NOSHAREDLIBS="../kaffevm/libkaffevm$LIBEXT $JAVA_LIBRARIES $STD_LIBRARIES $ZIP_LIBRARIES $NET_LIBRARIES $X_LIBRARIES $AWTLIB"
 	KAFFE_LIBDEP="$KAFFE_LIBDEP ../kaffevm/libkaffevm$LIBEXT $JAVA_LIBRARIES"
+	NOSHAREDLIBS="$NOSHAREDLIBS $GUARANALIB"
+	KAFFE_LIBDEP="$KAFFE_LIBDEP $GUARANALIB"
 	PIC=""
 	PICVM=""
 	LIBSHARE=""
@@ -5098,7 +5114,7 @@
 ac_given_srcdir=$srcdir
 ac_given_INSTALL="$INSTALL"
 
-trap 'rm -fr `echo "$output config/config.h include/jtypes.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+trap 'rm -fr `echo "$output config/config.h include/jtypes.h include/guarana.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
 EOF
 cat >> $CONFIG_STATUS <<EOF
 
@@ -5190,6 +5206,8 @@
 s%@PNG_LIBRARIES@%$PNG_LIBRARIES%g
 s%@GIF_LIBRARIES@%$GIF_LIBRARIES%g
 s%@AWTLIB@%$AWTLIB%g
+s%@GVER@%$GVER%g
+s%@COMMENT_GUARANA@%$COMMENT_GUARANA%g
 s%@subdirs@%$subdirs%g
 s%@packages@%$packages%g
 s%@KAFFE_LIBDEP@%$KAFFE_LIBDEP%g
@@ -5315,7 +5333,7 @@
 if test "${CONFIG_HEADERS+set}" != set; then
 EOF
 cat >> $CONFIG_STATUS <<EOF
-  CONFIG_HEADERS="config/config.h include/jtypes.h"
+  CONFIG_HEADERS="config/config.h include/jtypes.h include/guarana.h"
 EOF
 cat >> $CONFIG_STATUS <<\EOF
 fi
Index: kaffe/configure.in
diff -u kaffe/configure.in:1.1.1.16 kaffe/configure.in:1.22
--- kaffe/configure.in:1.1.1.16	Mon Sep  7 14:15:14 1998
+++ kaffe/configure.in	Fri Sep 11 23:02:43 1998
@@ -1,6 +1,6 @@
 AC_INIT(kaffe)
-
 dnl Setup version number.
+GVER=1.4.1; dnl Guarana reflective kernel
 KVER=1.00
 
 dnl Find the compiler early on in case we need to override.
@@ -667,6 +667,19 @@
 
 changequote([, ])dnl
 
+dnl Configure in the Guarana stuff.
+if test x"$enable_guarana" != xno &&
+   test -d $srcdir/kaffe/kaffevm/guarana ; then
+	AC_DEFINE(GUARANA)
+	COMMENT_GUARANA=
+	GUARANALIB="../kaffevm/libguarana$LIBEXT"
+else
+	COMMENT_GUARANA="#"
+	GUARANALIB=
+fi
+AC_SUBST(GVER)
+AC_SUBST(COMMENT_GUARANA)
+
 dnl If we have share libraries, cancel all the non-shared ones.
 dnl  Otherwise, add on the machine again to help linking.
 if test "$dynamic_libraries" = "yes" ; then
@@ -675,6 +688,8 @@
 else
 	NOSHAREDLIBS="../kaffevm/libkaffevm$LIBEXT $JAVA_LIBRARIES $STD_LIBRARIES $ZIP_LIBRARIES $NET_LIBRARIES $X_LIBRARIES $AWTLIB"
 	KAFFE_LIBDEP="$KAFFE_LIBDEP ../kaffevm/libkaffevm$LIBEXT $JAVA_LIBRARIES"
+	NOSHAREDLIBS="$NOSHAREDLIBS $GUARANALIB"
+	KAFFE_LIBDEP="$KAFFE_LIBDEP $GUARANALIB"
 	PIC=""
 	PICVM=""
 	LIBSHARE=""
@@ -716,7 +731,7 @@
 kaffehome=`eval echo $datadir`/kaffe
 AC_DEFINE_UNQUOTED(DEFAULT_KAFFEHOME, "$kaffehome")
 
-AC_CONFIG_HEADER(config/config.h include/jtypes.h)
+AC_CONFIG_HEADER(config/config.h include/jtypes.h include/guarana.h)
 AC_OUTPUT($output)
 
 dnl =========================================================================
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.1.1.12 kaffe/config/config.h.in:1.14
--- kaffe/config/config.h.in:1.1.1.12	Mon Sep  7 14:15:24 1998
+++ kaffe/config/config.h.in	Fri Sep 11 22:09:48 1998
@@ -362,6 +362,9 @@
 /* Kaffe version number */
 #undef	KAFFEVERSION
 
+/* Enable Guarana reflective kernel */
+#undef  GUARANA
+
 /* Define default KAFFEHOME */
 #undef  DEFAULT_KAFFEHOME
 
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.1.1.11 kaffe/include/Makefile.in:1.12
--- kaffe/include/Makefile.in:1.1.1.11	Wed Sep  9 21:35:45 1998
+++ kaffe/include/Makefile.in	Wed Sep  9 22:34:41 1998
@@ -20,6 +20,7 @@
 SHELL=		/bin/sh
 
 BUILT_INCLUDEFILES= \
+		guarana.h \
 		jtypes.h
 
 INCLUDEFILES= \
Index: kaffe/include/guarana.h.in
diff -u /dev/null kaffe/include/guarana.h.in:1.1
--- /dev/null	Fri Sep 11 23:06:48 1998
+++ kaffe/include/guarana.h.in	Fri May 16 19:21:19 1997
@@ -0,0 +1,18 @@
+/* guarana.h
+ * Enable or disable Guarana's Reflective Kernel and MetaObject support
+ *
+ * Written by Alexandre Oliva <oliva@dcc.unicamp.br>
+ */
+
+#ifndef __guarana_h
+#define __guarana_h
+
+#ifndef GUARANA
+#undef GUARANA
+#endif
+
+#ifdef GUARANA
+struct HBR_unicamp_Guarana_MetaObject;
+#endif
+
+#endif
Index: kaffe/include/java_lang_Object.h
diff -u kaffe/include/java_lang_Object.h:1.1.1.2 kaffe/include/java_lang_Object.h:1.3
--- kaffe/include/java_lang_Object.h:1.1.1.2	Mon Mar 30 20:11:46 1998
+++ kaffe/include/java_lang_Object.h	Sun Apr 19 13:12:10 1998
@@ -11,6 +11,8 @@
 #ifndef __java_lang_object_h
 #define __java_lang_object_h
 
+#include <guarana.h>
+
 struct _dispatchTable;
 struct _iLock;
 
@@ -18,6 +20,9 @@
 	struct _dispatchTable*  dtable;
 #if defined(USE_LOCK_CACHE)
 	struct _iLock*		lock;
+#endif
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject* meta_object;
 #endif
 	/* Data follows on immediately */
 } Hjava_lang_Object;
Index: kaffe/kaffe/kaffe/main.c
diff -u kaffe/kaffe/kaffe/main.c:1.1.1.10 kaffe/kaffe/kaffe/main.c:1.4
--- kaffe/kaffe/kaffe/main.c:1.1.1.10	Mon Sep  7 14:16:43 1998
+++ kaffe/kaffe/kaffe/main.c	Mon Sep  7 15:03:34 1998
@@ -27,6 +27,9 @@
 
 extern char* engine_name;
 extern char* engine_version;
+#ifdef GUARANA
+extern char* guarana_version;
+#endif
 static char* java_version;
 
 #include "jni.h"
@@ -227,6 +230,9 @@
 			fprintf(stderr, "Kaffe Virtual Machine\n");
 			fprintf(stderr, "Copyright (c) 1996, 1997, 1998\nTransvirtual Technologies, Inc.  All rights reserved\n");
 			fprintf(stderr, "Engine: %s   Version: %s   Java Version: %s\n", engine_name, engine_version, java_version);
+#ifdef GUARANA
+			fprintf(stderr, "\nInstrumented with Guarana %s\nCopyright (c) 1997, 1998  Alexandre Oliva\n", guarana_version);
+#endif
 			exit(0);
 		}
 		else if (strcmp(argv[i], "-classpath") == 0) {
Index: kaffe/kaffe/kaffevm/Makefile.in
diff -u kaffe/kaffe/kaffevm/Makefile.in:1.1.1.13 kaffe/kaffe/kaffevm/Makefile.in:1.18
--- kaffe/kaffe/kaffevm/Makefile.in:1.1.1.13	Mon Sep  7 14:16:53 1998
+++ kaffe/kaffe/kaffevm/Makefile.in	Wed Sep  9 04:59:11 1998
@@ -11,6 +11,7 @@
 prefix=		@prefix@
 exec_prefix=	@exec_prefix@
 libdir=		@libdir@
+classdir=	@datadir@/kaffe
 INSTROOT=	@INSTROOT@
 INSTALL=	@INSTALL@
 INSTALL_DATA=	@INSTALL_DATA@
@@ -27,13 +28,14 @@
 LIBS=		@LIBS@
 LDTAIL=		@LDTAIL@ @NET_LIBRARIES@ @STD_LIBRARIES@ @VM_LIBRARIES@
 KVER=		@KVER@
+GVER=		@GVER@
 OBJEXT=		@OBJEXT@
 LIBEXT=		@LIBVMEXT@
 
 INCLUDES=	-I. -I$(srcdir) -I$(srcdir)/../../config -I../../config -I../../include -I$(srcdir)/../../include -I../../libraries/clib
 CPPFLAGS=	@CPPFLAGS@
 CFLAGS=		@CFLAGS@
-ALL_CFLAGS=	$(CPPFLAGS) $(CFLAGS) @KAFFEVMFLAGS@ $(INCLUDES) $(ENGINE_CFLAGS) -DKVER=\"$(KVER)\" $(EXTRA_CFLAGS)
+ALL_CFLAGS=	$(CPPFLAGS) $(CFLAGS) @KAFFEVMFLAGS@ $(INCLUDES) $(ENGINE_CFLAGS) -DKVER=\"$(KVER)\" -DGVER=\"$(GVER)\" $(EXTRA_CFLAGS)
 
 LIBNAME=	libkaffevm
 LIB=		$(LIBNAME)$(LIBEXT).$(KVER)
@@ -74,8 +76,45 @@
 @cpu_os_frag@
 @threads_frag@
 
-OBJECT=		$(COMMON) $(THREAD) $(ENGINE_OBJECTS) $(CPU_OBJECTS) $(CPUOS_OBJECTS)
+GUARANA_OBJECTS = \
+		guarana/GuaraNative$(OBJEXT)
 
+OBJECT=		$(COMMON) $(THREAD) $(ENGINE_OBJECTS) $(CPU_OBJECTS) $(CPUOS_OBJECTS) @COMMENT_GUARANA@ $(GUARANA_OBJECTS)
+
+LIBGUARANA_OBJECTS = \
+		guarana/Guarana$(OBJEXT) \
+		guarana/Operation$(OBJEXT) \
+		guarana/OperationFactoryInternal$(OBJEXT) \
+		guarana/Result$(OBJEXT)
+
+$(LIBGUARANA_OBJECTS) $(GUARANA_OBJECTS) : guarana/Makefile.build
+
+LIBGEXT=	@LIBEXT@
+LIBGUARANAME=	libguarana
+LIBGUARANA=	$(LIBGUARANAME)$(LIBGEXT).$(GVER)
+LLIBGUARANA=	$(LIBGUARANAME)$(LIBGEXT)
+
+guarana/Makefile.build:
+		test -d guarana || mkdir guarana
+		cp $(srcdir)/guarana/Makefile $@
+
+@COMMENT_GUARANA@ all: $(LLIBGUARANA)
+
+$(LLIBGUARANA): $(LIBGUARANA)
+		rm -f $(LLIBGUARANA)
+		$(LN) $(LIBGUARANA) $(LLIBGUARANA)
+
+$(LIBGUARANA): $(LIBGUARANA_OBJECTS) libguarana.exp
+		$(MAKE) LIB="$(LIBGUARANA)" OBJECT="$(LIBGUARANA_OBJECTS)" mkguarana
+
+.PHONY: mkguarana
+mkguarana:
+		@LINKLIB@
+
+libguarana.exp:
+		$(DLLTOOL) --def $(srcdir)/$(LIBGUARANAME).def --output-exp libguarana.exp --output-lib $(LIBGUARANAME).a --dllname $(LLIBGUARANA)
+		touch libguarana.exp
+
 DEPENDS=       $(OBJECT:@OBJEXT@=.d)
 
 mkkaffevm:	$(LLIB)
@@ -97,6 +136,7 @@
 
 clean:
 		rm -f $(LIB) $(LLIB) $(OBJECT) lib.exp
+@COMMENT_GUARANA@	rm -f $(LIBGUARANA) $(LLIBGUARANA) $(LIBGUARANA_OBJECTS) libguarana.exp
 		rm -f $(DEPENDS)
 		rm -f .depend
 		touch .depend
@@ -111,10 +151,16 @@
 		$(INSTALL_DATA) $(LIB) $(INSTROOT)$(libdir)/$(LIB)
 		rm -f $(INSTROOT)$(libdir)/$(LLIB)
 		$(LN) $(LIB) $(INSTROOT)$(libdir)/$(LLIB)
+@COMMENT_GUARANA@	$(INSTALL_DATA) $(LIBGUARANA) $(INSTROOT)$(libdir)/$(LIBGUARANA)
+@COMMENT_GUARANA@	rm -f $(INSTROOT)$(libdir)/$(LLIBGUARANA)
+@COMMENT_GUARANA@	$(LN) $(LIBGUARANA) $(INSTROOT)$(libdir)/$(LLIBGUARANA)
+@COMMENT_GUARANA@	test -d $(INSTROOT)$(classdir) || $(MKDIR) $(INSTROOT)$(classdir)
+@COMMENT_GUARANA@	$(INSTALL_DATA) $(srcdir)/guarana/guarana.jar $(INSTROOT)$(classdir)/guarana.jar
 
 derived-files:
 
 depend:         $(DEPENDS)
+@COMMENT_GUARANA@	test -d guarana || mkdir guarana
 		rm -f .depend
 		cat $(DEPENDS) > .depend
 
Index: kaffe/kaffe/kaffevm/baseClasses.c
diff -u kaffe/kaffe/kaffevm/baseClasses.c:1.1.1.9 kaffe/kaffe/kaffevm/baseClasses.c:1.6
--- kaffe/kaffe/kaffevm/baseClasses.c:1.1.1.9	Mon Sep  7 14:16:54 1998
+++ kaffe/kaffe/kaffevm/baseClasses.c	Wed Sep  9 05:01:36 1998
@@ -28,6 +28,9 @@
 #include "exception.h"
 #include "itypes.h"
 #include "md.h"
+#ifdef GUARANA
+#include "external.h"
+#endif
 
 Utf8Const* init_name;
 Utf8Const* void_signature;
@@ -103,6 +106,18 @@
 	/* Init native support */
 	initNative();
 
+#ifdef GUARANA
+#ifdef NO_SHARED_LIBRARIES
+	java_lang_Class_init_function_pointers();
+#else
+	{
+	  void (*init_func_ptrs)(void) =
+	    loadNativeLibrarySym("java_lang_Class_init_function_pointers");
+	  init_func_ptrs();
+	}
+#endif
+#endif
+	
 	/* Create the initialise and finalize names and signatures. */
 	init_name = makeUtf8ConstFixed(INIT, -1);
 	void_signature = makeUtf8ConstFixed(VOIDSIG, -1);
Index: kaffe/kaffe/kaffevm/classMethod.c
diff -u kaffe/kaffe/kaffevm/classMethod.c:1.1.1.10 kaffe/kaffe/kaffevm/classMethod.c:1.13
--- kaffe/kaffe/kaffevm/classMethod.c:1.1.1.10	Mon Sep  7 14:16:57 1998
+++ kaffe/kaffe/kaffevm/classMethod.c	Mon Sep  7 15:03:36 1998
@@ -298,7 +298,7 @@
 void
 registerClass(classEntry* entry)
 {
-	lockMutex(entry);
+	lockCEntryMutex(entry);
 
 	/*
 	 * It is necessary to add the entry->class to the GC in some
@@ -306,7 +306,7 @@
 	 * however, this isn't possible right now.
 	 */
 
-	unlockMutex(entry);
+	unlockCEntryMutex(entry);
 }
 
 static
@@ -536,7 +536,7 @@
 	} 
 
 	/* Lock centry before setting centry->class */
-	lockMutex(centry);
+	lockCEntryMutex(centry);
 
 	/* Check again in case someone else did it */
 	if (centry->class == NULL) {
@@ -558,7 +558,7 @@
 	}
 
 	/* Release lock now class has been entered and processed */
-	unlockMutex(centry);
+	unlockCEntryMutex(centry);
 
 	if (clazz == NULL) {
 		throwException(ClassNotFoundException(name->data));
@@ -582,12 +582,12 @@
 	(*class) = newClass();
 
         centry = lookupClassEntry(makeUtf8Const(name, -1), 0);
-	lockMutex(centry);
+	lockCEntryMutex(centry);
 	if (centry->class == 0) {
 		centry->class = *class;
 		findClass(centry);
 	}
-	unlockMutex(centry);
+	unlockCEntryMutex(centry);
 
 	processClass(centry->class, CSTATE_LINKED);
 }
@@ -621,13 +621,13 @@
 	 * else may update it while we're doing this.  Once we've got the
 	 * name we don't really care.
 	 */
-	lockMutex(this->centry);
+	lockCEntryMutex(this->centry);
 	if (FIELD_RESOLVED(fld)) {
-		unlockMutex(this->centry);
+		unlockCEntryMutex(this->centry);
 		return (FIELD_TYPE(fld));
 	}
 	name = ((Utf8Const*)fld->type)->data;
-	unlockMutex(this->centry);
+	unlockCEntryMutex(this->centry);
 
 	clas = getClassFromSignature(name, this->loader);
 
@@ -746,7 +746,7 @@
 	int idx;
 	int n;
 
-	lockMutex(class->centry);
+	lockCEntryMutex(class->centry);
 
 	pool = CLASS_CONSTANTS(class);
 	fld = CLASS_SFIELDS(class);
@@ -798,7 +798,7 @@
 		}
 	}
 
-	unlockMutex(class->centry);
+	unlockCEntryMutex(class->centry);
 }
 
 static
@@ -806,7 +806,11 @@
 buildDispatchTable(Hjava_lang_Class* class)
 {
 	Method* meth;
+#ifdef GUARANA
+	dispatchMethod* mtab;
+#else
 	void** mtab;
+#endif
 	int i;
 #if defined(TRANSLATOR)
 	int ntramps = 0;
@@ -859,10 +863,10 @@
 	   one block of memory.  This is primarily done for GC reasons in
 	   that I didn't want to add another slot on class just for holding
 	   the trampolines, but it also works out for space reasons.  */
-	class->dtable = (dispatchTable*)gc_malloc(sizeof(dispatchTable) + class->msize * sizeof(void*) + ntramps * sizeof(methodTrampoline), GC_ALLOC_DISPATCHTABLE);
+	class->dtable = (dispatchTable*)gc_malloc(sizeof(dispatchTable) + class->msize * DTABLE_METHODSIZE + ntramps * sizeof(methodTrampoline), GC_ALLOC_DISPATCHTABLE);
 	tramp = (methodTrampoline*) &class->dtable->method[class->msize];
 #else
-	class->dtable = (dispatchTable*)gc_malloc(sizeof(dispatchTable) + (class->msize * sizeof(void*)), GC_ALLOC_DISPATCHTABLE);
+	class->dtable = (dispatchTable*)gc_malloc(sizeof(dispatchTable) + (class->msize * DTABLE_METHODSIZE), GC_ALLOC_DISPATCHTABLE);
 #endif
 
 	class->dtable->class = class;
@@ -870,9 +874,18 @@
 
 	/* Install inherited methods into dispatch table. */
 	if (class->superclass != NULL) {
+#ifdef GUARANA
+		dispatchMethod* super_mtab = class->superclass->dtable->method;
+#else
 		Method** super_mtab = (Method**)class->superclass->dtable->method;
+#endif
 		for (i = 0; i < class->superclass->msize; i++) {
+#ifdef GUARANA
+			DMETHOD_ADDR(mtab[i]) = DMETHOD_ADDR(super_mtab[i]);
+			DMETHOD_DESC(mtab[i]) = DMETHOD_DESC(super_mtab[i]);
+#else
 			mtab[i] = super_mtab[i];
+#endif
 		}
 	}
 
@@ -892,7 +905,12 @@
 			tramp++;
 		}
 		if (meth->idx >= 0) {
+#ifdef GUARANA
+		        DMETHOD_DESC(mtab[meth->idx]) = meth;
+		        DMETHOD_ADDR(mtab[meth->idx]) = METHOD_NATIVECODE(meth);
+#else
 			mtab[meth->idx] = METHOD_NATIVECODE(meth);
+#endif
 		}
 	}
 	FLUSH_DCACHE(class->dtable, tramp);
@@ -908,7 +926,11 @@
 	 * See "Java Language Specification" (1996) section 12.3.2. */
 	if ((class->accflags & ACC_ABSTRACT) == 0) {
 		for (i = class->msize - 1; i >= 0; i--) {
+#ifdef GUARANA
+			if (DMETHOD_ADDR(mtab[i]) == NULL) {
+#else
 			if (mtab[i] == NULL) {
+#endif
 				throwException(AbstractMethodError);
 			}
 		}
@@ -955,7 +977,7 @@
 	int idx;
 	constants* pool;
 
-	lockMutex(class->centry);
+	lockCEntryMutex(class->centry);
 
 	/* Scan constant pool and convert any constant strings into true
 	 * java strings.
@@ -974,7 +996,7 @@
 		}
 	}
 
-	unlockMutex(class->centry);
+	unlockCEntryMutex(class->centry);
 }
 
 classEntry*
@@ -1185,11 +1207,11 @@
 	}
 
 	/* Lock class entry */
-	lockMutex(centry);
+	lockCEntryMutex(centry);
 
 	/* Incase someone else did it */
 	if (centry->class != 0) {
-		unlockMutex(centry);
+		unlockCEntryMutex(centry);
 #if !INTERN_UTF8CONSTS
 		gc_free(arr_name);
 #endif
@@ -1215,7 +1237,7 @@
 	arr_class->state = CSTATE_OK;
 	arr_class->centry = centry;
 
-	unlockMutex(centry);
+	unlockCEntryMutex(centry);
 
 	found:;
 	if (CLASS_IS_PRIMITIVE(c)) {
Index: kaffe/kaffe/kaffevm/classMethod.h
diff -u kaffe/kaffe/kaffevm/classMethod.h:1.1.1.11 kaffe/kaffe/kaffevm/classMethod.h:1.17
--- kaffe/kaffe/kaffevm/classMethod.h:1.1.1.11	Mon Sep  7 14:16:58 1998
+++ kaffe/kaffe/kaffevm/classMethod.h	Mon Sep  7 15:03:36 1998
@@ -139,16 +139,49 @@
 	constIndex*		declared_exceptions;
 } methods;
 
+#ifdef GUARANA
+
+#if defined(TRANSLATOR)
+
+#define METHOD_NATIVEOFFSET	((int)&(((methods*)0)->ncode))
+
+typedef struct _dispatchMethod {
+	void *addr;
+	Method *desc;
+} dispatchMethod;
+
+#define DMETHOD_ADDR(dm)	((dm).addr)
+#define DMETHOD_DESC(dm)	((dm).desc)
+#define DMETHOD_DESCOFFSET	((int)&(((dispatchMethod*)0)->desc))
+
+#else
+typedef void *dispatchMethod;
+
+#define DMETHOD_ADDR(dm)	(dm)
+#define DMETHOD_DESC(dm)	(dm)
+#define DMETHOD_DESCOFFSET	0
+#endif
+#endif
+
 typedef struct _dispatchTable {
 	Hjava_lang_Class*	class;
-	void*			method[1];
+#ifdef GUARANA
+        dispatchMethod		method[1];
+#else
+        void*			method[1];
+#endif
 } dispatchTable;
 
 #define	CLASS_STATE		((int)&(((Hjava_lang_Class*)0)->state))
 
 #define	DTABLE_CLASS		0
+#ifdef GUARANA
+#define	DTABLE_METHODOFFSET	((int)&(((dispatchTable*)0)->method[0]))
+#define	DTABLE_METHODSIZE	(sizeof(((dispatchTable*)0)->method[0]))
+#else
 #define	DTABLE_METHODOFFSET	(sizeof(void*))
 #define	DTABLE_METHODSIZE	(sizeof(void*))
+#endif
 
 typedef struct _fields {
 	Utf8Const*		name;
Index: kaffe/kaffe/kaffevm/exception.c
diff -u kaffe/kaffe/kaffevm/exception.c:1.1.1.11 kaffe/kaffe/kaffevm/exception.c:1.6
--- kaffe/kaffe/kaffevm/exception.c:1.1.1.11	Mon Sep  7 14:17:04 1998
+++ kaffe/kaffe/kaffevm/exception.c	Mon Sep  7 15:03:36 1998
@@ -170,7 +170,7 @@
 			/* If not here, exit monitor if synchronised. */
 			lk = getLock(obj);
 			if (lk != 0 && lk->holder == (*Kaffe_ThreadInterface.currentNative)()) {
-				unlockMutex(obj);
+				unlockObjMutex(obj);
 			}
 		}
 	}
@@ -212,7 +212,7 @@
 			/* If method found and synchronised, unlock the lock */
 			lk = getLock(obj);
 			if (lk != 0 && lk->holder == (*Kaffe_ThreadInterface.currentNative)()) {
-				unlockMutex(obj);
+				unlockObjMutex(obj);
 			}
 		}
 	}
Index: kaffe/kaffe/kaffevm/findInJar.c
diff -u kaffe/kaffe/kaffevm/findInJar.c:1.1.1.12 kaffe/kaffe/kaffevm/findInJar.c:1.10
--- kaffe/kaffe/kaffevm/findInJar.c:1.1.1.12	Mon Sep  7 14:17:07 1998
+++ kaffe/kaffe/kaffevm/findInJar.c	Mon Sep  7 15:03:37 1998
@@ -99,7 +99,7 @@
 			class = newClass();
 		}
 
-		lockMutex(centry);
+		lockCEntryMutex(centry);
 
 		class->name = centry->name;
 		class->centry = centry;
@@ -107,7 +107,7 @@
 		readClass(class, &hand, NULL);
 		class->state = CSTATE_LOADED;
 
-		unlockMutex(centry);
+		unlockCEntryMutex(centry);
 
 		if (hand.base != 0) {
 			gc_free_fixed(hand.base);
Index: kaffe/kaffe/kaffevm/jni.c
diff -u kaffe/kaffe/kaffevm/jni.c:1.1.1.7 kaffe/kaffe/kaffevm/jni.c:1.9
--- kaffe/kaffe/kaffevm/jni.c:1.1.1.7	Mon Sep  7 14:17:14 1998
+++ kaffe/kaffe/kaffevm/jni.c	Mon Sep  7 15:03:37 1998
@@ -14,6 +14,9 @@
 #endif
 
 #include "config.h"
+#ifdef GUARANA
+#include "guarana/GuaraNative.h"
+#endif
 #include "config-std.h"
 #include "config-mem.h"
 #include "jni.h"
@@ -388,7 +391,18 @@
 	}
 	obj = newObject(clazz);
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	ADD_REF(obj);
 	END_EXCEPTION_HANDLING();
@@ -428,7 +442,18 @@
 	}
 	obj = newObject(clazz);
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	ADD_REF(obj);
 	END_EXCEPTION_HANDLING();
@@ -495,7 +520,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	ADD_REF(retval.l);
 	END_EXCEPTION_HANDLING();
@@ -531,7 +567,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.l);
@@ -550,7 +597,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.z);
@@ -585,7 +643,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.z);
@@ -604,7 +673,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.b);
@@ -639,7 +719,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.b);
@@ -658,7 +749,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.c);
@@ -693,7 +795,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.c);
@@ -712,7 +825,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.s);
@@ -747,7 +871,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.s);
@@ -766,7 +901,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.i);
@@ -801,7 +947,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.i);
@@ -820,7 +977,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.j);
@@ -855,7 +1023,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.j);
@@ -874,7 +1053,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.f);
@@ -909,7 +1099,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.f);
@@ -928,7 +1129,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.d);
@@ -963,7 +1175,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, &retval);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, &retval);
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.d);
@@ -981,7 +1204,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_resolve_method_invocation(mo, obj, m, args, 0);
+	    } else {
+		callMethodV(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, 0);
+	    }
+	}
+#else
 	callMethodV(m, o->dtable->method[m->idx], obj, args, 0);
+#endif
 
 	END_EXCEPTION_HANDLING();
 }
@@ -1012,7 +1246,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_resolve_method_invocation(obj, m, (slots*)args, 0);
+	    } else {
+		callMethodA(m, DMETHOD_ADDR(o->dtable->method[m->idx]), obj, args, 0);
+	    }
+	}
+#else
 	callMethodA(m, o->dtable->method[m->idx], obj, args, 0);
+#endif
 
 	END_EXCEPTION_HANDLING();
 }
@@ -1029,7 +1274,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	ADD_REF(retval.l);
 	END_EXCEPTION_HANDLING();
@@ -1064,7 +1320,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	ADD_REF(retval.l);
 	END_EXCEPTION_HANDLING();
@@ -1083,7 +1350,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.z);
@@ -1117,7 +1395,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.z);
@@ -1135,7 +1424,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.b);
@@ -1169,7 +1469,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.b);
@@ -1187,7 +1498,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.c);
@@ -1221,7 +1543,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.c);
@@ -1239,7 +1572,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.s);
@@ -1273,7 +1617,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.s);
@@ -1291,7 +1646,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.i);
@@ -1325,7 +1691,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.i);
@@ -1343,7 +1720,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.j);
@@ -1377,7 +1765,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.j);
@@ -1395,7 +1794,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.f);
@@ -1429,7 +1839,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.f);
@@ -1447,7 +1868,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.d);
@@ -1481,7 +1913,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.d);
@@ -1498,7 +1941,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, obj, m, args, 0);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), obj, args, 0);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 }
@@ -1528,7 +1982,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)obj)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(obj, m, (slots*)args, 0);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), obj, args, 0);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 }
@@ -1778,7 +2243,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	ADD_REF(retval.l);
 	END_EXCEPTION_HANDLING();
@@ -1813,7 +2289,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	ADD_REF(retval.l);
 	END_EXCEPTION_HANDLING();
@@ -1832,7 +2319,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.z);
@@ -1866,7 +2364,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.z);
@@ -1884,7 +2393,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.b);
@@ -1918,7 +2438,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.b);
@@ -1936,7 +2467,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.c);
@@ -1970,7 +2512,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.c);
@@ -1988,7 +2541,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.s);
@@ -2022,7 +2586,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.s);
@@ -2040,7 +2615,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.i);
@@ -2074,7 +2660,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.i);
@@ -2092,7 +2689,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.j);
@@ -2126,7 +2734,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.j);
@@ -2144,7 +2763,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.f);
@@ -2178,7 +2808,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.f);
@@ -2196,7 +2837,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.d);
@@ -2230,7 +2882,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 	return (retval.d);
@@ -2248,7 +2911,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_va_list_reify_method_invocation(mo, cls, m, args, (slots*)&retval);
+	    } else {
+#endif
 	callMethodV(m, JNI_METHOD_CODE(m), 0, args, &retval);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 }
@@ -2278,7 +2952,18 @@
 		throwException(NoSuchMethodError(m->name->data));
 	}
 
+#ifdef GUARANA
+	{
+	    struct HBR_unicamp_Guarana_MetaObject *mo = ((Hjava_lang_Object*)cls)->meta_object;
+	    if (mo) {
+		guarana_slots_reify_method_invocation(cls, m, (slots*)args, 0);
+	    } else {
+#endif
 	callMethodA(m, JNI_METHOD_CODE(m), 0, args, 0);
+#ifdef GUARANA
+	    }
+	}
+#endif
 
 	END_EXCEPTION_HANDLING();
 }
@@ -3366,7 +4051,7 @@
 {
 	BEGIN_EXCEPTION_HANDLING(0);
 
-	lockMutex(obj);
+	lockObjMutex(obj);
 
 	END_EXCEPTION_HANDLING();
 	return (0);
@@ -3377,7 +4062,7 @@
 {
 	BEGIN_EXCEPTION_HANDLING(0);
 
-	unlockMutex(obj);
+	unlockObjMutex(obj);
 
 	END_EXCEPTION_HANDLING();
 	return (0);
Index: kaffe/kaffe/kaffevm/kaffe.def
diff -u kaffe/kaffe/kaffevm/kaffe.def:1.1.1.10 kaffe/kaffe/kaffevm/kaffe.def:1.18
--- kaffe/kaffe/kaffevm/kaffe.def:1.1.1.10	Wed Aug  5 19:17:18 1998
+++ kaffe/kaffe/kaffevm/kaffe.def	Wed Aug  5 22:35:48 1998
@@ -1,4 +1,4 @@
-/*
+/* -*- C -*-
  * kaffe.def
  * Kaffe instruction definitions.
  *
@@ -9,6 +9,10 @@
  * of this file. 
  */
 
+#ifdef GUARANA
+# define guarana_spill_and_clean_registers() end_sub_block()
+#endif
+
 define_insn(NOP)
 {
         /*
@@ -315,10 +319,36 @@
 
 	CHECK_NULL (IALOAD, rstack(1), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(IALOAD, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(1), rstack(0));
 
 	load_offset_scaled_int(stack(1), rstack(1), rstack(0), object_array_offset);
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(IALOAD, 33));
+
+	set_label(IALOAD, 32);
+
+	start_sub_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), int, wstack(1));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(IALOAD, 33);
+	start_sub_block();
+#endif
+
 	pop(1);
 }
 
@@ -332,10 +362,35 @@
 
 	CHECK_NULL (LALOAD, stack(1), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(LALOAD, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(1), rstack(0));
 
 	load_offset_scaled_long(stack_long(0), stack(1), stack(0), object_array_offset);
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(LALOAD, 33));
+
+	set_label(LALOAD, 32);
+
+	start_sub_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), long, stack_long(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(LALOAD, 33);
+	start_sub_block();
+#endif
 }
 
 define_insn(FALOAD)
@@ -348,11 +403,36 @@
 
 	CHECK_NULL (FALOAD, stack(1), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(FALOAD, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(1), rstack(0));
 
 	load_offset_scaled_float(stack(1), stack(1), stack(0), object_array_offset);
 
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(FALOAD, 33));
+
+	set_label(FALOAD, 32);
+
+	start_sub_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), float, wstack(1));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(FALOAD, 33);
+	start_sub_block();
+#endif
+
 	pop(1);
 }
 
@@ -366,10 +446,35 @@
 
 	CHECK_NULL (DALOAD, stack(1), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(DALOAD, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(1), rstack(0));
 
 	load_offset_scaled_double(stack_double(0), stack(1), stack(0), object_array_offset);
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(DALOAD, 33));
+
+	set_label(DALOAD, 32);
+
+	start_sub_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), double, stack_double(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(DALOAD, 33);
+	start_sub_block();
+#endif
 }
 
 define_insn(AALOAD)
@@ -382,10 +487,36 @@
 
 	CHECK_NULL(AALOAD, rstack(1), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(AALOAD, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(1), rstack(0));
 
 	load_offset_scaled_ref(stack(1), rstack(1), rstack(0), object_array_offset);
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(AALOAD, 33));
+
+	set_label(AALOAD, 32);
+
+	start_sub_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), ref, wstack(1));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(AALOAD, 33);
+	start_sub_block();
+#endif
+
 	pop(1);
 }
 
@@ -399,10 +530,36 @@
 
 	CHECK_NULL(BALOAD, rstack(1), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(BALOAD, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(1), rstack(0));
 
 	load_offset_scaled_byte(stack(1), rstack(1), rstack(0), object_array_offset);
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(BALOAD, 33));
+
+	set_label(BALOAD, 32);
+
+	start_sub_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), byte, wstack(1));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(BALOAD, 33);
+	start_sub_block();
+#endif
+
 	pop(1);
 }
 
@@ -416,10 +573,36 @@
 
 	CHECK_NULL(CALOAD, rstack(1), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(CALOAD, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(1), rstack(0));
 
 	load_offset_scaled_char(stack(1), rstack(1), rstack(0), object_array_offset);
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(CALOAD, 33));
+
+	set_label(CALOAD, 32);
+
+	start_sub_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), char, wstack(1));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(CALOAD, 33);
+	start_sub_block();
+#endif
+
 	pop(1);
 }
 
@@ -433,10 +616,36 @@
 
 	CHECK_NULL(SALOAD, rstack(1), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(1), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(SALOAD, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(1), rstack(0));
 
 	load_offset_scaled_short(stack(1), rstack(1), rstack(0), object_array_offset);
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(SALOAD, 33));
+
+	set_label(SALOAD, 32);
+
+	start_sub_block();
+	softcall_reify_array_load(tmp2, rstack(1), rstack(0), short, wstack(1));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(SALOAD, 33);
+	start_sub_block();
+#endif
+
 	pop(1);
 }
 
@@ -591,10 +800,36 @@
 
 	CHECK_NULL(IASTORE, rstack(2), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(IASTORE, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(2), rstack(1));
 
 	store_offset_scaled_int(rstack(2), rstack(1), object_array_offset, rstack(0));
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(IASTORE, 33));
+
+	set_label(IASTORE, 32);
+
+	start_sub_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), int, rstack(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(IASTORE, 33);
+	start_sub_block();
+#endif
+
 	pop(3);
 }
 
@@ -609,10 +844,36 @@
 
 	CHECK_NULL(LASTORE, stack(3), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(3), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(LASTORE, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(3), rstack(2));
 
 	store_offset_scaled_long(stack(3), stack(2), object_array_offset, stack_long(0));
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(LASTORE, 33));
+
+	set_label(LASTORE, 32);
+
+	start_sub_block();
+	softcall_reify_array_store(tmp2, rstack(3), rstack(2), long, stack_long(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(LASTORE, 33);
+	start_sub_block();
+#endif
+
 	pop(4);
 }
 
@@ -627,10 +888,36 @@
 
 	CHECK_NULL(FASTORE, stack(2), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(FASTORE, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(2), rstack(1));
 
 	store_offset_scaled_float(stack(2), stack(1), object_array_offset, stack(0));
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(FASTORE, 33));
+
+	set_label(FASTORE, 32);
+
+	start_sub_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), float, rstack(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(FASTORE, 33);
+	start_sub_block();
+#endif
+
 	pop(3);
 }
 
@@ -645,11 +932,36 @@
 
 	CHECK_NULL(DASTORE, stack(3), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(3), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(DASTORE, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(3), rstack(2));
 
 	store_offset_scaled_long(stack(3), stack(2), object_array_offset, stack_double(0));
 
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(DASTORE, 33));
+
+	set_label(DASTORE, 32);
+
+	start_sub_block();
+	softcall_reify_array_store(tmp2, rstack(3), rstack(2), double, stack_double(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(DASTORE, 33);
+	start_sub_block();
+#endif
+
 	pop(4);
 }
 
@@ -664,6 +976,16 @@
 
 	CHECK_NULL(AASTORE, rstack(2), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(AASTORE, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(2), rstack(1));
 
@@ -672,6 +994,22 @@
 	SOFT_ADDREFERENCE(rstack(2), rstack(0));
 
 	store_offset_scaled_ref(rstack(2), rstack(1), object_array_offset, rstack(0));
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(AASTORE, 33));
+
+	set_label(AASTORE, 32);
+
+	start_sub_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), ref, rstack(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(AASTORE, 33);
+	start_sub_block();
+#endif
+
 	pop(3);
 }
 
@@ -686,10 +1024,36 @@
 
 	CHECK_NULL(BASTORE, rstack(2), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(BASTORE, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(2), rstack(1));
 
 	store_offset_scaled_byte(rstack(2), rstack(1), object_array_offset, rstack(0));
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(BASTORE, 33));
+
+	set_label(BASTORE, 32);
+
+	start_sub_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), byte, rstack(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(BASTORE, 33);
+	start_sub_block();
+#endif
+
 	pop(3);
 }
 
@@ -704,10 +1068,36 @@
 
 	CHECK_NULL(CASTORE, rstack(2), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(CASTORE, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(2), rstack(1));
 
 	store_offset_scaled_char(rstack(2), rstack(1), object_array_offset, rstack(0));
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(CASTORE, 33));
+
+	set_label(CASTORE, 32);
+
+	start_sub_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), char, rstack(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(CASTORE, 33);
+	start_sub_block();
+#endif
+
 	pop(3);
 }
 
@@ -722,10 +1112,36 @@
 
 	CHECK_NULL(SASTORE, rstack(2), 34);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	load_offset_ref(tmp2, rstack(2), META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(SASTORE, 32));
+#endif
+
 	/* Check we are within the array bounds */
 	check_array_index(rstack(2), rstack(1));
 
 	store_offset_scaled_short(rstack(2), rstack(1), object_array_offset, rstack(0));
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(SASTORE, 33));
+
+	set_label(SASTORE, 32);
+
+	start_sub_block();
+	softcall_reify_array_store(tmp2, rstack(2), rstack(1), short, rstack(0));
+	slot_nowriteback(tmp2);
+	end_sub_block();
+	set_label(SASTORE, 33);
+	start_sub_block();
+#endif
+
 	pop(3);
 }
 
@@ -1884,6 +2300,17 @@
 	get_static_field_info(idx);
 	INIT_STATIC_CLASS(field_class());
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	move_ref_const(tmp2, finfo.class);
+	load_offset_ref(tmp2, tmp2, META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(GETSTATIC, 32));
+#endif
+
 	/* Use the proper load to increase the chances of the translator
 	   getting data in the right type of register.  */
 
@@ -1924,6 +2351,39 @@
 	default:
 		ABORT();
 	}
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(GETSTATIC, 33));
+
+	if (FIELD_ISREF(finfo.field)) {
+		pop(1);
+	}
+	else switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) {
+	default:
+		pop(1);
+		break;
+	case 'J':
+	case 'D':
+		pop(2);
+		break;
+	}
+
+	set_label(GETSTATIC, 32);
+
+	start_sub_block();
+	slot_alloctmp(tmp);
+	move_ref_const(tmp, finfo.class);
+	push(1);
+	softcall_reify_field_load(tmp2, tmp);
+	slot_nowriteback(tmp);
+	slot_nowriteback(tmp2);
+	end_sub_block();
+
+	set_label(GETSTATIC, 33);
+	start_sub_block();
+#endif
 }
 
 define_insn(PUTSTATIC)
@@ -1938,6 +2398,17 @@
 	get_static_field_info(idx);
 	INIT_STATIC_CLASS(field_class());
 
+#ifdef GUARANA
+	slot_alloctmp(tmp2);
+
+	move_ref_const(tmp2, finfo.class);
+	load_offset_ref(tmp2, tmp2, META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(PUTSTATIC, 32));
+#endif
+
 	if (FIELD_ISREF(finfo.field)) {
 		SOFT_ADDREFERENCE_STATIC(field_statics(), stack(0));
 		store_addr_ref(FIELD_ADDRESS(finfo.field), stack(0));
@@ -1976,6 +2447,40 @@
 	default:
 		ABORT();
 	}
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(PUTSTATIC, 33));
+
+	if (FIELD_ISREF(finfo.field)) {
+		push(1);
+	}
+	else switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) {
+	default:
+		push(1);
+		break;
+	case 'J':
+	case 'D':
+		push(2);
+		break;
+	}
+
+	set_label(PUTSTATIC, 32);
+	
+	start_sub_block();
+
+	slot_alloctmp(tmp);
+	move_ref_const(tmp, finfo.class);
+	softcall_reify_field_store(tmp2, tmp);
+
+	slot_nowriteback(tmp);
+	slot_nowriteback(tmp2);
+
+	end_sub_block();
+
+	set_label(PUTSTATIC, 33);
+	start_sub_block();
+#endif
 }
 
 define_insn(GETFIELD)
@@ -1995,6 +2500,17 @@
 	/* Use the proper load to increase the chances of the translator
 	   getting data in the right type of register.  */
 
+#ifdef GUARANA
+	slot_alloctmp(tmp);
+	move_ref(tmp, rstack(0));
+	slot_alloctmp(tmp2);
+	load_offset_ref(tmp2, tmp, META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(GETFIELD, 32));
+#endif
+
 	if (FIELD_ISREF(finfo.field)) {
 		load_offset_ref(stack(0), rstack(0), FIELD_OFFSET(finfo.field));
 	}
@@ -2027,6 +2543,32 @@
 	default:
 		ABORT();
 	}
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(GETFIELD, 33));
+
+	if (!FIELD_ISREF(finfo.field))
+	  switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) {
+	  case 'J':
+	  case 'D':
+	    pop(1);
+	    break;
+	}
+
+	set_label(GETFIELD, 32);
+	
+	start_sub_block();
+	softcall_reify_field_load(tmp2, tmp);
+	slot_nowriteback(tmp2);
+	slot_nowriteback(tmp);
+
+	end_sub_block();
+
+	set_label(GETFIELD, 33);
+	start_sub_block();
+#endif
 }
 
 define_insn(PUTFIELD)
@@ -2040,6 +2582,43 @@
 
 	get_field_info(idx);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp);
+	slot_alloctmp(tmp2);
+
+	/* since we have moved the check_stack_ref and CHECK_NULL
+	   tests here, they might have been commented out from the
+	   non-intercepted branch, but then, they usually expand to
+	   nothing... */
+
+	if (FIELD_ISREF(finfo.field)) {
+	  check_stack_ref(1);
+	  move_ref(tmp, rstack(1));
+	  CHECK_NULL(PUTFIELD, tmp, 42);
+	} else switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) {
+	default:
+	  check_stack_ref(1);
+	  move_ref(tmp, rstack(1));
+	  CHECK_NULL(PUTFIELD, tmp, 43);
+	  break;
+	case 'J':
+	  check_stack_ref(2);
+	  move_ref(tmp, rstack(2));
+	  CHECK_NULL(PUTFIELD, tmp, 44);
+	  break;
+	case 'D':
+	  check_stack_ref(2);
+	  move_ref(tmp, rstack(2));
+	  CHECK_NULL(PUTFIELD, tmp, 44);
+	  break;
+	}
+	load_offset_ref(tmp2, tmp, META_OBJECT_OFFSET);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(PUTFIELD, 32));
+#endif
+
 	/* Use the proper store to increase the chances of the translator
 	   having the data in the right type of register already.  */
 
@@ -2097,6 +2676,38 @@
 	default:
 		ABORT();
 	}
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(PUTFIELD, 33));
+
+	if (FIELD_ISREF(finfo.field)) {
+	  push(2);
+	} else switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) {
+	default:
+	  push(2);
+	  break;
+	case 'J':
+	case 'D':
+	  push(3);
+	  break;
+	}
+
+	set_label(PUTFIELD, 32);
+	
+	start_sub_block();
+	softcall_reify_field_store(tmp2, tmp);
+	pop(1);
+
+	slot_nowriteback(tmp2);
+	slot_nowriteback(tmp);
+
+	end_sub_block();
+
+	set_label(PUTFIELD, 33);
+	start_sub_block();
+#endif
 }
 
 #define	METHOD_RETURN_VALUE()					\
@@ -2163,6 +2774,14 @@
 
 		check_stack_ref(idx);
 
+#ifdef GUARANA
+		guarana_spill_and_clean_registers();
+
+		load_offset_ref(tmp, rstack(idx), META_OBJECT_OFFSET);
+
+		cbranch_ref_const_ne(tmp, 0, reference_label(INVOKEVIRTUAL, 26));
+#endif
+
 		/* Find dispatch table in object */
 		load_offset_ref(mtable, stack(idx), method_dtable_offset);
 
@@ -2185,6 +2804,38 @@
 		/* Pop args */
 		popargs();
 
+#ifdef GUARANA
+		branch_a(reference_label(INVOKEVIRTUAL, 27));
+
+		push(idx);
+		--idx;
+
+		set_label(INVOKEVIRTUAL, 26);
+		/* Otherwise call through MetaObject */
+
+		start_sub_block();
+
+		/* Find dispatch table in object */
+		load_offset_ref(mtable, stack(idx), method_dtable_offset);
+
+		load_offset_ref(tmp, mtable,
+				DTABLE_METHODOFFSET + DMETHOD_DESCOFFSET +
+				method_idx() * DTABLE_METHODSIZE);
+ 			
+		slot_nowriteback(tmp);
+
+		/* Call it */
+		low = method_returntype();
+		softcall_reify_method_invocation(tmp);
+
+		idx++;
+		pop(idx);
+
+		end_sub_block();
+
+		set_label(INVOKEVIRTUAL, 27);
+#endif
+
 		start_sub_block();
 		METHOD_RETURN_VALUE();
 	}
@@ -2217,6 +2868,18 @@
 
 		check_stack_ref(idx);
 
+#ifdef GUARANA
+		slot_alloctmp(tmp2);
+
+		load_offset_ref(tmp2, rstack(idx), META_OBJECT_OFFSET);
+
+		slot_nowriteback(tmp2);
+
+		guarana_spill_and_clean_registers();
+
+		cbranch_ref_const_ne(tmp2, 0, reference_label(INVOKESPECIAL, 28));
+#endif
+
 		/* Push arguments & object */
 		build_call_frame(method_sig(), stack(idx), idx);
 		idx++;
@@ -2232,6 +2895,31 @@
 		/* Pop args */
 		popargs();
 
+#ifdef GUARANA
+		branch_a(reference_label(INVOKESPECIAL, 29));
+
+		push(idx);
+		--idx;
+
+		set_label(INVOKESPECIAL, 28);
+		/* Otherwise call through MetaObject */
+
+		start_sub_block();
+
+		move_ref_const(tmp2, method_method());
+
+		/* Call it */
+		low = method_returntype();
+		softcall_reify_method_invocation(tmp2);
+
+		++idx;
+		pop(idx);
+
+		end_sub_block();
+
+		set_label(INVOKESPECIAL, 29);
+#endif
+
 		start_sub_block();
 		METHOD_RETURN_VALUE();
 	}
@@ -2258,6 +2946,19 @@
 	else {
 		idx = method_nargs();
 
+#ifdef GUARANA
+		slot_alloctmp(tmp2);
+
+		move_ref_const(tmp2, method_class ());
+		load_offset_ref(tmp2, tmp2, META_OBJECT_OFFSET);
+
+		slot_nowriteback(tmp2);
+
+		guarana_spill_and_clean_registers();
+		
+		cbranch_ref_const_ne(tmp2, 0, reference_label(INVOKESTATIC, 30));
+#endif
+
 		/* Push arguments */
 		build_call_frame(method_sig(), 0, idx);
 
@@ -2272,7 +2973,30 @@
 		/* Pop args */
 		popargs();
 
+#ifdef GUARANA
+		branch_a(reference_label(INVOKESTATIC, 31));
+
+		push(idx);
+
+		set_label(INVOKESTATIC, 30);
+		/* Otherwise call through MetaObject */
+
 		start_sub_block();
+
+		move_ref_const(tmp2, method_method());
+
+		/* Call it */
+		low = method_returntype();
+		softcall_reify_method_invocation(tmp2);
+
+		pop(idx);
+
+		end_sub_block();
+
+		set_label(INVOKESTATIC, 31);
+#endif
+
+		start_sub_block();
 		METHOD_RETURN_VALUE();
 	}
 }
@@ -2307,6 +3031,23 @@
 
 		softcall_lookupmethod(tmp, method_method(), stack(idx));
 
+#ifdef GUARANA
+		slot_alloctmp(tmp2);
+
+		load_offset_ref(tmp2, rstack(idx), META_OBJECT_OFFSET);
+
+		slot_nowriteback(tmp2);
+
+		guarana_spill_and_clean_registers();
+
+		cbranch_ref_const_ne(tmp2, 0, reference_label(INVOKEINTERFACE, 32));
+
+#ifdef TRANSLATOR
+		load_offset_ref(tmp, tmp, METHOD_NATIVEOFFSET);
+#endif
+
+#endif
+
 		/* Push arguments & object */
 		build_call_frame(method_sig(), stack(idx), idx);
 		idx++;
@@ -2322,7 +3063,31 @@
 		/* Pop args */
 		popargs();
 
+#ifdef GUARANA
+		branch_a(reference_label(INVOKEINTERFACE, 33));
+
+		push(idx);
+		--idx;
+
+		set_label(INVOKEINTERFACE, 32);
+		/* Otherwise call through MetaObject */
+
 		start_sub_block();
+
+		low = method_returntype();
+
+		/* Call it */
+		softcall_reify_method_invocation(tmp);
+
+		idx++;
+		pop(idx);
+
+		end_sub_block();
+
+		set_label(INVOKEINTERFACE, 33);
+#endif
+
+		start_sub_block();
 		METHOD_RETURN_VALUE();
 	}
 }
@@ -2376,7 +3141,38 @@
 
 	check_stack_array(0);
 
+#ifdef GUARANA
+	slot_alloctmp(tmp);
+	slot_alloctmp(tmp2);
+
+	move_ref(tmp, rstack(0));
+	load_offset_ref(tmp2, tmp, META_OBJECT_OFFSET);
+
+	slot_nowriteback(tmp2);
+
+	guarana_spill_and_clean_registers();
+
+	cbranch_ref_const_ne(tmp2, 0, reference_label(ARRAYLENGTH, 35));
+#endif
+
 	load_offset_int(stack(0), rstack(0), object_array_length);
+
+#ifdef GUARANA
+	end_sub_block();
+
+	branch_a(reference_label(ARRAYLENGTH, 36));
+
+	set_label(ARRAYLENGTH, 35);
+
+	start_sub_block();
+
+	softcall_reify_arraylength(stack(0), rstack(0));
+
+	end_sub_block();
+
+	set_label(ARRAYLENGTH, 36);
+	start_sub_block();
+#endif
 }
 
 define_insn(ATHROW)
Index: kaffe/kaffe/kaffevm/locks.h
diff -u kaffe/kaffe/kaffevm/locks.h:1.1.1.8 kaffe/kaffe/kaffevm/locks.h:1.7
--- kaffe/kaffe/kaffevm/locks.h:1.1.1.8	Mon Sep  7 14:17:19 1998
+++ kaffe/kaffe/kaffevm/locks.h	Wed Sep  9 05:08:32 1998
@@ -13,9 +13,33 @@
 #define __locks_h
 
 #include "md.h"
+#include "guarana.h"
 
-#define	lockMutex			_lockMutex
-#define	unlockMutex			_unlockMutex
+#ifdef GUARANA
+
+struct Hjava_lang_Object;
+extern void guarana_reify_monitorEnter(struct Hjava_lang_Object *o);
+extern void guarana_reify_monitorExit(struct Hjava_lang_Object *o);
+
+# define lockObjMutex			guarana_reify_monitorEnter
+# define unlockObjMutex			guarana_reify_monitorExit
+
+# define lockCEntryMutex		_lockMutex
+# define unlockCEntryMutex		_unlockMutex
+
+#else
+
+# define lockObjMutex			_lockMutex
+# define unlockObjMutex			_unlockMutex
+
+# define lockCEntryMutex		_lockMutex
+# define unlockCEntryMutex		_unlockMutex
+
+#endif
+
+#define lockObjMutexDirect		_lockMutex
+#define unlockObjMutexDirect		_unlockMutex
+
 #define	waitCond			_waitCond
 #define	signalCond			_signalCond
 #define	broadcastCond			_broadcastCond
Index: kaffe/kaffe/kaffevm/lookup.c
diff -u kaffe/kaffe/kaffevm/lookup.c:1.1.1.8 kaffe/kaffe/kaffevm/lookup.c:1.7
--- kaffe/kaffe/kaffevm/lookup.c:1.1.1.8	Tue Jun 30 03:28:29 1998
+++ kaffe/kaffe/kaffevm/lookup.c	Tue Jun 30 03:53:42 1998
@@ -109,10 +109,10 @@
 		 * lock and get the tag & name again just in case.  If we
 		 * have been resolved then we just return the answer.
 		 */
-		lockMutex(this->centry);
+		lockCEntryMutex(this->centry);
 		tag = pool->tags[idx];
 		name = WORD2UTF(pool->data[idx]);
-		unlockMutex(this->centry);
+		unlockCEntryMutex(this->centry);
 
 		if (tag == CONSTANT_ResolvedClass) {
 			return (CLASS_CLASS(idx, pool));
@@ -140,10 +140,10 @@
 	/* Lock the class while we update the constant pool.  Someone
 	 * may have done this already but we don't care.
 	 */
-	lockMutex(this->centry);
+	lockCEntryMutex(this->centry);
 	pool->data[idx] = (ConstSlot)class;
 	pool->tags[idx] = CONSTANT_ResolvedClass;
-	unlockMutex(this->centry);
+	unlockCEntryMutex(this->centry);
 
 	return (class);
 }
Index: kaffe/kaffe/kaffevm/object.c
diff -u kaffe/kaffe/kaffevm/object.c:1.1.1.5 kaffe/kaffe/kaffevm/object.c:1.6
--- kaffe/kaffe/kaffevm/object.c:1.1.1.5	Mon Mar 30 20:13:31 1998
+++ kaffe/kaffe/kaffevm/object.c	Sun Apr 19 13:12:31 1998
@@ -30,6 +30,10 @@
 #include "external.h"
 #include "gc.h"
 
+#ifdef GUARANA
+#include "guarana/GuaraNative.h"
+#endif
+
 extern Hjava_lang_Class* ThreadClass;
 
 extern gcFuncs gcFinalizeObject;
@@ -44,7 +48,11 @@
  * it with the object for it's later use.  Otherwise the object is normal.
  */
 Hjava_lang_Object*
+#ifdef GUARANA
+newObjectNoMessage(Hjava_lang_Class* class)
+#else
 newObject(Hjava_lang_Class* class)
+#endif
 {
 	Hjava_lang_Object* obj;
 	int type;
@@ -63,6 +71,10 @@
         /* Fill in object information */
         obj->dtable = class->dtable;
 
+#ifdef GUARANA
+	obj->meta_object = 0;
+#endif
+
 ADBG(	printf("newObject %x class %s\n", obj,
 		(class ? class->name->data : "<none>"));
 		fflush(stdout);						)
@@ -95,7 +107,11 @@
  * Allocate a new array, of whatever types.
  */
 Hjava_lang_Object*
+#ifdef GUARANA
+newArrayNoMessage(Hjava_lang_Class* elclass, int count)
+#else
 newArray(Hjava_lang_Class* elclass, int count)
+#endif
 {
 	Hjava_lang_Class* class;
 	Hjava_lang_Object* obj;
@@ -108,6 +124,9 @@
 	}
 	class = lookupArray(elclass);
 	obj->dtable = class->dtable;
+#ifdef GUARANA
+	obj->meta_object = 0;
+#endif
 	ARRAY_SIZE(obj) = count;
 	return (obj);
 }
@@ -116,17 +135,30 @@
  * Allocate a new multi-dimensional array.
  */
 Hjava_lang_Object*
+#ifdef GUARANA
+guarana_newMultiArray(Hjava_lang_Class *clazz, Hjava_lang_Object *creator, int *dims)
+#else
 newMultiArray(Hjava_lang_Class* clazz, int* dims)
+#endif
 {
 	Hjava_lang_Object* obj;
 	Hjava_lang_Object** array;
 	int i;
 	
+#ifdef GUARANA
+	obj = guarana_newArray(CLASS_ELEMENT_TYPE(clazz), dims[0], creator);
+#else
 	obj = newArray(CLASS_ELEMENT_TYPE(clazz), dims[0]);
+#endif
 	if (dims[1] > 0) {
 		array = OBJARRAY_DATA(obj);
 		for (i = 0; i < dims[0]; i++) {
+#ifdef GUARANA
+		        /* FIXME: reify assignment? */
+			array[i] = guarana_newMultiArray(CLASS_ELEMENT_TYPE(clazz), obj, &dims[1]);
+#else
 			array[i] = newMultiArray(CLASS_ELEMENT_TYPE(clazz), &dims[1]);
+#endif
 		}
 	}
 
Index: kaffe/kaffe/kaffevm/object.h
diff -u kaffe/kaffe/kaffevm/object.h:1.1.1.4 kaffe/kaffe/kaffevm/object.h:1.4
--- kaffe/kaffe/kaffevm/object.h:1.1.1.4	Mon Mar 30 20:13:33 1998
+++ kaffe/kaffe/kaffevm/object.h	Sun Apr 19 13:12:33 1998
@@ -33,6 +33,10 @@
 #define	ARRAY_SIZE_OFFSET	((int)&ARRAY_SIZE(0))
 #define	ARRAY_DATA_OFFSET	((int)(((Array*)0)+1))
 
+#ifdef GUARANA
+#define META_OBJECT_OFFSET      ((int)&(*(Hjava_lang_Object*)0).meta_object)
+#endif
+
 struct Hjava_lang_Class;
 
 Hjava_lang_Object*	newObject(struct Hjava_lang_Class*);
Index: kaffe/kaffe/kaffevm/soft.c
diff -u kaffe/kaffe/kaffevm/soft.c:1.1.1.9 kaffe/kaffe/kaffevm/soft.c:1.15
--- kaffe/kaffe/kaffevm/soft.c:1.1.1.9	Mon Sep  7 14:17:24 1998
+++ kaffe/kaffe/kaffevm/soft.c	Mon Sep  7 15:03:38 1998
@@ -36,16 +36,28 @@
 #include "itypes.h"
 #include "machine.h"
 
+#ifdef GUARANA
+#include "guarana/GuaraNative.h"
+#endif
+
 /*
  * soft_new
  */
 void*
+#ifdef GUARANA
+soft_new(Hjava_lang_Class* c, Hjava_lang_Object *creator)
+#else
 soft_new(Hjava_lang_Class* c)
+#endif
 {
 	Hjava_lang_Object* obj;
 
 	processClass(c, CSTATE_OK);
+#ifdef GUARANA
+	obj = guarana_newObject(c, creator);
+#else
 	obj = newObject(c);
+#endif
 
 DBG(NEWINSTR,	
 	dprintf("New object of type %s (%d,%x)\n", 
@@ -58,7 +70,11 @@
  * soft_newarray
  */
 void*
+#ifdef GUARANA
+soft_newarray(jint type, jint size, struct Hjava_lang_Object *creator)
+#else
 soft_newarray(jint type, jint size)
+#endif
 {
 	Hjava_lang_Object* obj;
 
@@ -66,7 +82,12 @@
 		throwException(NegativeArraySizeException);
 	}
 
+
+#ifdef GUARANA
+	obj = guarana_newArray(TYPE_CLASS(type), size, creator);
+#else
 	obj = newArray(TYPE_CLASS(type), size);
+#endif
 
 DBG(NEWINSTR,	
 	dprintf("New array of %s [%d] (%x)\n", 
@@ -79,7 +100,11 @@
  * soft_anewarray
  */
 void*
+#ifdef GUARANA
+soft_anewarray(Hjava_lang_Class* elclass, jint size, struct Hjava_lang_Object *creator)
+#else
 soft_anewarray(Hjava_lang_Class* elclass, jint size)
+#endif
 {
 	Hjava_lang_Object* obj;
 
@@ -87,7 +112,11 @@
 		throwException(NegativeArraySizeException);
 	}
 
+#ifdef GUARANA
+	obj = guarana_newArray(elclass, size, creator);
+#else
 	obj = newArray(elclass, size);
+#endif
 
 DBG(NEWINSTR,	
 	dprintf("New array object [%d] of %s (%x)\n", size,
@@ -102,7 +131,11 @@
 
 #if defined(INTERPRETER)
 void*
+#ifdef GUARANA
+soft_multianewarray(Hjava_lang_Class* class, struct Hjava_lang_Object *creator, jint dims, slots* args)
+#else
 soft_multianewarray(Hjava_lang_Class* class, jint dims, slots* args)
+#endif
 {
         int array[MAXDIMS];
         Hjava_lang_Object* obj;
@@ -131,7 +164,11 @@
         arraydims[i] = 0;
 
         /* Mmm, okay now build the array using the wonders of recursion */
+#ifdef GUARANA
+	obj = guarana_newMultiArray(class, creator, arraydims);
+#else
         obj = newMultiArray(class, arraydims);
+#endif
 
 
 	if (arraydims != array) {
@@ -145,7 +182,11 @@
 
 #if defined(TRANSLATOR)
 void*
+#ifdef GUARANA
+soft_multianewarray(Hjava_lang_Class* class, struct Hjava_lang_Object *creator, jint dims, ...)
+#else
 soft_multianewarray(Hjava_lang_Class* class, jint dims, ...)
+#endif
 {
 	va_list ap;
 	int array[MAXDIMS];
@@ -174,7 +215,11 @@
 	va_end(ap);
 
 	/* Mmm, okay now build the array using the wonders of recursion */
+#ifdef GUARANA
+	obj = guarana_newMultiArray(class, creator, arraydims);
+#else
         obj = newMultiArray(class, arraydims);
+#endif
 
 	if (arraydims != array) {
 		gc_free_fixed(arraydims);
@@ -200,7 +245,7 @@
 		throwException(NoSuchMethodError(name->data));
 	}
 
-#if defined(TRANSLATOR)
+#if defined(TRANSLATOR) && !defined(GUARANA)
 	return (METHOD_NATIVECODE(meth));
 #else
 	return (meth);
@@ -443,7 +488,11 @@
 
 	/* Update dispatch table */
 	if (meth->idx >= 0) {
+#ifdef GUARANA
+		DMETHOD_ADDR(meth->class->dtable->method[meth->idx]) = METHOD_NATIVECODE(meth);
+#else
 		meth->class->dtable->method[meth->idx] = METHOD_NATIVECODE(meth);
+#endif
 	}
 
 #if 0
Index: kaffe/kaffe/kaffevm/soft.h
diff -u kaffe/kaffe/kaffevm/soft.h:1.1.1.5 kaffe/kaffe/kaffevm/soft.h:1.8
--- kaffe/kaffe/kaffevm/soft.h:1.1.1.5	Mon Mar 30 20:13:46 1998
+++ kaffe/kaffe/kaffevm/soft.h	Sun Apr 19 13:12:36 1998
@@ -16,9 +16,15 @@
 struct Hjava_lang_Class;
 struct Hjava_lang_Object;
 
+#ifdef GUARANA
+void*	soft_new(struct Hjava_lang_Class*, struct Hjava_lang_Object* creator);
+void*	soft_newarray(jint, jint, struct Hjava_lang_Object* creator);
+void*	soft_anewarray(struct Hjava_lang_Class*, jint, struct Hjava_lang_Object* creator);
+#else
 void*	soft_new(struct Hjava_lang_Class*);
 void*	soft_newarray(jint, jint);
 void*	soft_anewarray(struct Hjava_lang_Class*, jint);
+#endif
 void	soft_initialise_class(struct Hjava_lang_Class*);
 nativecode* soft_get_method_code (Method*);
 
@@ -43,8 +49,12 @@
 jint	soft_rem(jint, jint);
 
 #if defined(INTERPRETER)
+#ifdef GUARANA
+void*	soft_multianewarray(struct Hjava_lang_Class*, struct Hjava_lang_Object *creator, jint, slots*);
+#else
 void*	soft_multianewarray(struct Hjava_lang_Class*, jint, slots*);
 #endif
+#endif
 
 #if defined(TRANSLATOR)
 jlong	soft_lmul(jlong, jlong);
@@ -58,7 +68,11 @@
 jlong	soft_ashrl(jlong, jint);
 jlong	soft_lshrl(jlong, jint);
 jint	soft_lcmp(jlong, jlong);
+#ifdef GUARANA
+void*	soft_multianewarray(struct Hjava_lang_Class*, struct Hjava_lang_Object *creator, jint, ...);
+#else
 void*	soft_multianewarray(struct Hjava_lang_Class*, jint, ...);
+#endif
 #endif
 
 jlong	soft_cvtil(jint);
Index: kaffe/kaffe/kaffevm/support.c
diff -u kaffe/kaffe/kaffevm/support.c:1.1.1.15 kaffe/kaffe/kaffevm/support.c:1.17
--- kaffe/kaffe/kaffevm/support.c:1.1.1.15	Mon Sep  7 14:17:28 1998
+++ kaffe/kaffe/kaffevm/support.c	Mon Sep  7 15:03:38 1998
@@ -32,6 +32,10 @@
 #include "thread.h"
 #include "locks.h"
 
+#ifdef GUARANA
+#include "guarana/GuaraNative.h"
+#endif
+
 #if !defined(HAVE_GETTIMEOFDAY)
 #include <sys/timeb.h>
 #endif
@@ -58,6 +62,9 @@
 do_execute_java_method_v(void* obj, char* method_name, char* signature, Method* mb, int isStaticCall, va_list argptr)
 {
 	jvalue retval;
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
 	if (mb == 0) {
 		if (isStaticCall) {
@@ -78,7 +85,20 @@
 		throwException(NoSuchMethodError(method_name));
 	}
 
+#ifdef GUARANA
+	if (isStaticCall) {
+	  mo = mb->class->head.meta_object;
+	} else {
+	  mo = ((struct Hjava_lang_Object *)obj)->meta_object;
+	}
+	if (mo) {
+	  guarana_va_list_reify_method_invocation(mo, obj, mb, argptr, (slots*)&retval);
+	} else {
+#endif
 	callMethodV(mb, METHOD_INDIRECTMETHOD(mb), obj, argptr, &retval);
+#ifdef GUARANA
+	}
+#endif
 
 	return (retval);
 }
@@ -105,6 +125,9 @@
 	Method* mb;
 	jvalue retval;
 	char cnname[CLASSMAXSIG];	/* Unchecked buffer - FIXME! */
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
 	/* Convert "." to "/" */
 	classname2pathname(cname, cnname);
@@ -117,7 +140,17 @@
 	}
 
 	/* Make the call */
+#ifdef GUARANA
+	mo = mb->class->head.meta_object;
+
+	if (mo) {
+	  guarana_va_list_reify_method_invocation(mo, 0, mb, argptr, (slots*)&retval);
+	} else {
+#endif
 	callMethodV(mb, METHOD_INDIRECTMETHOD(mb), 0, argptr, &retval);
+#ifdef GUARANA
+	}
+#endif
 
 	return (retval);
 }
@@ -145,6 +178,9 @@
 	Method* mb;
 	char buf[MAXEXCEPTIONLEN];
 	jvalue retval;
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
 	if (cc == 0) {
 		/* Convert "." to "/" */
@@ -172,7 +208,16 @@
 	assert(obj != 0);
 
 	/* Make the call */
+#ifdef GUARANA
+	mo = ((struct Hjava_lang_Object *)obj)->meta_object;
+	if (mo) {
+	  guarana_va_list_reify_method_invocation(mo, obj, mb, argptr, (slots*)&retval);
+	} else {
+#endif
 	callMethodV(mb, METHOD_INDIRECTMETHOD(mb), obj, argptr, &retval);
+#ifdef GUARANA
+	}
+#endif
 
 	return (obj);
 }
@@ -349,7 +394,7 @@
 			else {
 				sync = (Hjava_lang_Object*)call.args[0].l;
 			}
-			lockMutex(sync);
+			lockObjMutex(sync);
 		}
 		else {
 			sync = 0;
@@ -359,7 +404,7 @@
 		sysdepCallMethod(&call);
 
 		if (sync != 0) {
-			unlockMutex(sync);
+			unlockObjMutex(sync);
 		}
 	}
 #endif
@@ -525,7 +570,7 @@
 			else {
 				sync = (Hjava_lang_Object*)call.args[0].l;
 			}
-			lockMutex(sync);
+			lockObjMutex(sync);
 		}
 		else {
 			sync = 0;
@@ -535,7 +580,7 @@
 		sysdepCallMethod(&call);
 
 		if (sync != 0) {
-			unlockMutex(sync);
+			unlockObjMutex(sync);
 		}
 	}
 #endif
Index: kaffe/kaffe/kaffevm/thread.c
diff -u kaffe/kaffe/kaffevm/thread.c:1.1.1.12 kaffe/kaffe/kaffevm/thread.c:1.7
--- kaffe/kaffe/kaffevm/thread.c:1.1.1.12	Wed Aug  5 19:17:32 1998
+++ kaffe/kaffe/kaffevm/thread.c	Wed Aug  5 22:35:51 1998
@@ -121,10 +121,10 @@
 	else {
 #ifdef LET_TIM_DECIDE_IF_HE_REALLY_WANTS_THAT
 		/* Stop the thread - and wait for it to terminate */
-		lockMutex(tid);
+		lockObjMutex(tid);
 		(*Kaffe_ThreadInterface.stop)(tid);
 		waitCond(tid, 0);
-		unlockMutex(tid);
+		unlockObjMutex(tid);
 #else
 		/* 
 		 * Waiting for the thread to exit could cause a deadlock,
Index: kaffe/kaffe/kaffevm/intrp/icode.h
diff -u kaffe/kaffe/kaffevm/intrp/icode.h:1.1.1.8 kaffe/kaffe/kaffevm/intrp/icode.h:1.12
--- kaffe/kaffe/kaffevm/intrp/icode.h:1.1.1.8	Mon Sep  7 14:17:33 1998
+++ kaffe/kaffe/kaffevm/intrp/icode.h	Mon Sep  7 15:03:39 1998
@@ -142,6 +142,10 @@
 #define	return_float(s)				(s)[0].v.tfloat = retval[0].v.tfloat
 #define	return_double(s)			(s)[0].v.tdouble = retval[0].v.tdouble
 #define	return_ref(s)				(s)[0].v.taddr = retval[0].v.taddr
+#define return_boolean return_int
+#define return_byte return_int
+#define return_short return_int
+#define return_char return_int
 
 #define	monitor_enter()				/* Not needed for interpreter */
 #define	monitor_exit()				/* Not needed for interpreter */
@@ -268,18 +272,29 @@
 #define	cvt_double_float(t, f)			(t)[0].v.tfloat = (f)[0].v.tdouble
 
 #define	softcall_lookupmethod(r, n, t)		(r)[0].v.taddr = soft_lookupmethod((t)[0].v.taddr, (n)->name, (n)->signature)
+#ifdef GUARANA
+#define CREATOR ((methaccflags & ACC_STATIC) ? &meth->class->head : (Hjava_lang_Object*)local(0)->v.taddr)
+#define	softcall_new(r, t)			(r)->v.taddr = soft_new(t, CREATOR)
+#define	softcall_newarray(r, s, t)		(r)->v.taddr = soft_newarray(t, (s)->v.tint, CREATOR)
+#define	softcall_anewarray(r, s, t)		(r)->v.taddr = soft_anewarray(t, (s)->v.tint, CREATOR)
+#else
 #define	softcall_new(r, t)			(r)->v.taddr = soft_new(t)
 #define	softcall_newarray(r, s, t)		(r)->v.taddr = soft_newarray(t, (s)->v.tint)
 #define	softcall_anewarray(r, s, t)		(r)->v.taddr = soft_anewarray(t, (s)->v.tint)
+#endif
 #define	softcall_athrow(s)			soft_athrow((s)[0].v.taddr)
 #define	softcall_checkcast(n, o, t)		soft_checkcast(t, (o)->v.taddr)
 #define softcall_initialise_class(cl)		soft_initialise_class(cl)
 #define	softcall_instanceof(r, o, t)		(r)->v.tint = soft_instanceof(t, (o)->v.taddr)
 
-#define	softcall_monitorenter(o)		lockMutex((o)[0].v.taddr)
-#define	softcall_monitorexit(o)			unlockMutex((o)[0].v.taddr)
+#define	softcall_monitorenter(o)		lockObjMutex((o)[0].v.taddr)
+#define	softcall_monitorexit(o)			unlockObjMutex((o)[0].v.taddr)
 
+#ifdef GUARANA
+#define	softcall_multianewarray(r, z, s, t)	(r)->v.taddr = soft_multianewarray(t, CREATOR, z, s)
+#else
 #define	softcall_multianewarray(r, z, s, t)	(r)->v.taddr = soft_multianewarray(t, z, s)
+#endif
 
 #define	softcall_badarrayindex()		soft_badarrayindex()
 #define	softcall_nullpointer()			soft_nullpointer()
@@ -296,5 +311,66 @@
 						}
 #define	build_call_frame(SIG, OBJ, NRARGS)	/* Not needed for interpreter */
 
+
+#ifdef GUARANA
+#define softcall_reify_method_invocation(method) \
+  guarana_slots_reify_method_invocation((((Method*)((method)->v.taddr))->accflags & ACC_STATIC) ? 0 : (rstack(idx))->v.taddr, \
+					(method)->v.taddr, \
+					rstack(idx-1), retval)
+
+#define softcall_reify_field_load(mo, obj) do { \
+  jvalue *res; \
+  if (FIELD_ISREF(finfo.field)) \
+    res = (jvalue *)wstack(0); \
+  else \
+    switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) { \
+    case 'J': \
+      res = (jvalue *)stack_long(-1); \
+      push(1); \
+      break; \
+    case 'D': \
+      res = (jvalue *)stack_double(-1); \
+      push(1); \
+      break; \
+    default: \
+      res = (jvalue *)wstack(0); \
+      break; \
+    } \
+  guarana_reify_field_load((mo)->v.taddr, (obj)->v.taddr, finfo.class, finfo.field, res); \
+} while (0)
+
+#define softcall_reify_field_store(mo, obj) do { \
+  jvalue *res; \
+  if (FIELD_ISREF(finfo.field)) { \
+    res = (jvalue *)rstack(0); \
+    pop(1); \
+  } else \
+    switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) { \
+    case 'J': \
+      res = (jvalue *)stack_long(0); \
+      pop(2); \
+      break; \
+    case 'D': \
+      res = (jvalue *)stack_double(0); \
+      pop(2); \
+      break; \
+    default: \
+      res = (jvalue *)rstack(0); \
+      pop(1); \
+      break; \
+    } \
+  guarana_reify_field_store((mo)->v.taddr, (obj)->v.taddr, finfo.class, finfo.field, res); \
+} while (0)
+
+#define softcall_reify_arraylength(to, from) \
+  (to)->v.tint = guarana_reify_arraylength((from)->v.taddr)
+
+#define softcall_reify_array_load(mo, obj, index, type, retto) \
+  guarana_reify_array_load((mo)->v.taddr, (obj)->v.taddr, (index)->v.tint, (jvalue*)&(retto)->v)
+
+#define softcall_reify_array_store(mo, obj, index, type, value) \
+  guarana_reify_array_store((mo)->v.taddr, (obj)->v.taddr, (index)->v.tint, (jvalue*)&(value)->v)
+
+#endif
 
 #endif
Index: kaffe/kaffe/kaffevm/intrp/machine.c
diff -u kaffe/kaffe/kaffevm/intrp/machine.c:1.1.1.10 kaffe/kaffe/kaffevm/intrp/machine.c:1.6
--- kaffe/kaffe/kaffevm/intrp/machine.c:1.1.1.10	Mon Sep  7 14:17:34 1998
+++ kaffe/kaffe/kaffevm/intrp/machine.c	Mon Sep  7 15:03:39 1998
@@ -42,6 +42,9 @@
 #include "checks.h"
 #include "errors.h"
 #include "md.h"
+#ifdef GUARANA
+#include "guarana/GuaraNative.h"
+#endif
 
 /*
  * Define information about this engine.
@@ -167,7 +170,7 @@
 		else {
 			mobj = (Hjava_lang_Object*)lcl[0].v.taddr;
 		}
-		lockMutex(mobj);
+		lockObjMutex(mobj);
 	}       
 
 	sp = &lcl[meth->localsz - 1];
@@ -194,7 +197,7 @@
 
 	/* Unsync. if required */
 	if (mobj != 0) {
-		unlockMutex(mobj);
+		unlockObjMutex(mobj);
 	}       
 	if (tid != NULL && unhand(tid)->PrivateInfo != 0) {
 		unhand(tid)->exceptPtr = (struct Hkaffe_util_Ptr*)mjbuf.prev;
Index: kaffe/kaffe/kaffevm/jit/codeproto.h
diff -u kaffe/kaffe/kaffevm/jit/codeproto.h:1.1.1.6 kaffe/kaffe/kaffevm/jit/codeproto.h:1.4
--- kaffe/kaffe/kaffevm/jit/codeproto.h:1.1.1.6	Mon Sep  7 14:17:37 1998
+++ kaffe/kaffe/kaffevm/jit/codeproto.h	Mon Sep  7 15:03:39 1998
@@ -111,6 +111,10 @@
 void return_long(SlotInfo*);
 void return_float(SlotInfo*);
 void return_double(SlotInfo*);
+#define return_boolean return_int
+#define return_byte return_int
+#define return_short return_int
+#define return_char return_int
 
 void returnarg_int(SlotInfo*);
 void returnarg_ref(SlotInfo*);
@@ -228,11 +232,19 @@
 
 void softcall_lookupmethod(SlotInfo*, Method*, SlotInfo*);
 void softcall_nullpointer(void);
+#ifdef GUARANA
+void softcall_new_(SlotInfo*, struct Hjava_lang_Class*, Method *);
+void softcall_newarray_(SlotInfo*, SlotInfo*, int, Method *);
+void softcall_anewarray_(SlotInfo*, SlotInfo*, struct Hjava_lang_Class*, Method *);
+void softcall_multianewarray_(SlotInfo*, int, SlotInfo*,
+			      struct Hjava_lang_Class*, Method *);
+#else
 void softcall_new(SlotInfo*, struct Hjava_lang_Class*);
 void softcall_newarray(SlotInfo*, SlotInfo*, int);
 void softcall_anewarray(SlotInfo*, SlotInfo*, struct Hjava_lang_Class*);
 void softcall_multianewarray(SlotInfo*, int, SlotInfo*,
 			     struct Hjava_lang_Class*);
+#endif
 void softcall_athrow(SlotInfo*);
 void softcall_checkcast(SlotInfo*, SlotInfo*, struct Hjava_lang_Class*);
 void softcall_get_method_code(SlotInfo*, SlotInfo*);
Index: kaffe/kaffe/kaffevm/jit/icode.c
diff -u kaffe/kaffe/kaffevm/jit/icode.c:1.1.1.9 kaffe/kaffe/kaffevm/jit/icode.c:1.10
--- kaffe/kaffe/kaffevm/jit/icode.c:1.1.1.9	Mon Sep  7 14:17:40 1998
+++ kaffe/kaffe/kaffevm/jit/icode.c	Mon Sep  7 15:03:40 1998
@@ -30,6 +30,9 @@
 #include "locks.h"
 #include "machine.h"
 #include "codeproto.h"
+#ifdef GUARANA
+#include "guarana/GuaraNative.h"
+#endif
 
 #if defined(WORDS_BIGENDIAN)
 #define	LSLOT(_s)	((_s)+1)
@@ -251,7 +254,7 @@
 	else {
 		pusharg_ref(obj, 0);
 	}
-	call_soft(lockMutex);
+	call_soft(lockObjMutex);
 	popargs();
 	start_sub_block();
 }
@@ -266,7 +269,7 @@
 	else {
 		pusharg_ref(obj, 0);
 	}
-	call_soft(unlockMutex);
+	call_soft(unlockObjMutex);
 	popargs();
 	start_sub_block();
 }
@@ -3168,7 +3171,11 @@
 /*									   */
 
 void
+#ifdef GUARANA
+build_call_frame_guarana(Utf8Const* sig, SlotInfo* obj, int sp_idx, int minidx)
+#else
 build_call_frame(Utf8Const* sig, SlotInfo* obj, int sp_idx)
+#endif
 {
 	struct pusharg_info {
 		char type;
@@ -3178,17 +3185,19 @@
 	static struct pusharg_info* args;
 	static int sz_args = 0;
 	int arg_idx;
-	int idx;
+#ifndef GUARANA
+	int minidx = 0;
+#endif
+	int idx = minidx;
 	char* sigptr;
 
 	/* Make sure we have enough argument space */
-	if (sp_idx + 1 > sz_args) {
-		sz_args = sp_idx + 1;
+	if (sp_idx + minidx + 1 > sz_args) {
+		sz_args = sp_idx + minidx + 1;
 		args = gc_realloc_fixed(args, sizeof(struct pusharg_info) * sz_args);
 	}
 
 	/* If we've got an object ... */
-	idx = 0;
 	if (obj != 0) {
 		args[idx].type = 'O';
 		args[idx].arg_idx = idx;
@@ -3244,7 +3253,7 @@
 		idx++;
 	}
 
-	for (idx--; idx >= 0; idx--) {
+	for (idx--; idx >= minidx; idx--) {
 		sp_idx = args[idx].sp_idx;
 		arg_idx = args[idx].arg_idx;
 		switch (args[idx].type) {
@@ -3378,10 +3387,25 @@
 	fixup_function_call();
 }
 
-void
+void 
+#ifdef GUARANA
+softcall_new_(SlotInfo* dst, Hjava_lang_Class* classobj, Method *meth)
+#else
 softcall_new(SlotInfo* dst, Hjava_lang_Class* classobj)
+#endif
 {
 	prepare_function_call();
+#ifdef GUARANA
+	if (meth->accflags & ACC_STATIC) {
+		SlotInfo* tmp;
+		slot_alloctmp(tmp);
+		move_ref_const(tmp, meth->class);
+		pusharg_ref(tmp, 1);
+		slot_nowriteback(tmp);
+	} else {
+		pusharg_ref(local(0), 1);
+	}
+#endif
 	pusharg_class_const(classobj, 0);
 	call_soft(soft_new);
 	popargs();
@@ -3390,12 +3414,23 @@
 }
 
 void
+#ifdef GUARANA
+softcall_newarray_(SlotInfo* dst, SlotInfo* size, int type, Method *meth)
+#else
 softcall_newarray(SlotInfo* dst, SlotInfo* size, int type)
+#endif
 {
 	if (size == dst) {
 		slot_nowriteback(size);
 	}
 	prepare_function_call();
+#ifdef GUARANA
+	if (meth->accflags & ACC_STATIC) {
+		pusharg_ref_const(meth->class, 2);
+	} else {
+		pusharg_ref(local(0), 2);
+	}
+#endif
 	pusharg_int(size, 1);
 	pusharg_int_const(type, 0);
 	call_soft(soft_newarray);
@@ -3405,12 +3440,23 @@
 }
 
 void
+#ifdef GUARANA
+softcall_anewarray_(SlotInfo* dst, SlotInfo* size, Hjava_lang_Class* type, Method *meth)
+#else
 softcall_anewarray(SlotInfo* dst, SlotInfo* size, Hjava_lang_Class* type)
+#endif
 {
 	if (dst == size) {
 		slot_nowriteback(size);
 	}
 	prepare_function_call();
+#ifdef GUARANA
+	if (meth->accflags & ACC_STATIC) {
+		pusharg_ref_const(meth->class, 2);
+	} else {
+		pusharg_ref(local(0), 2);
+	}
+#endif
 	pusharg_int(size, 1);
 	pusharg_class_const(type, 0);
 	call_soft(soft_anewarray);
@@ -3421,15 +3467,31 @@
 
 
 void
+#ifdef GUARANA
+softcall_multianewarray_(SlotInfo* dst, int size, SlotInfo* stktop, Hjava_lang_Class* classobj, Method *meth)
+#else
 softcall_multianewarray(SlotInfo* dst, int size, SlotInfo* stktop, Hjava_lang_Class* classobj)
+#endif
 {
 	int i;
 
 	prepare_function_call();
+#ifdef GUARANA
+	for (i = 0; i < size; i++) {
+		pusharg_int(&stktop[i], 2+size-i);
+	}
+	pusharg_int_const(size, 2);
+	if (meth->accflags & ACC_STATIC) {
+		pusharg_ref_const(meth->class, 1);
+	} else {
+		pusharg_ref(local(0), 1);
+	}
+#else
 	for (i = 0; i < size; i++) {
 		pusharg_int(&stktop[i], 1+size-i);
 	}
 	pusharg_int_const(size, 1);
+#endif
 	pusharg_class_const(classobj, 0);
 	call_soft(soft_multianewarray);
 	popargs();
@@ -3482,7 +3544,7 @@
 	slot_nowriteback(mon);
 	prepare_function_call();
 	pusharg_ref(mon, 0);
-	call_soft(lockMutex);
+	call_soft(lockObjMutex);
 	popargs();
 	fixup_function_call();
 }
@@ -3493,7 +3555,7 @@
 	slot_nowriteback(mon);
 	prepare_function_call();
 	pusharg_ref(mon, 0);
-	call_soft(unlockMutex);
+	call_soft(unlockObjMutex);
 	popargs();
 	fixup_function_call();
 }
Index: kaffe/kaffe/kaffevm/jit/icode_internal.h
diff -u kaffe/kaffe/kaffevm/jit/icode_internal.h:1.1.1.1 kaffe/kaffe/kaffevm/jit/icode_internal.h:1.2
--- kaffe/kaffe/kaffevm/jit/icode_internal.h:1.1.1.1	Mon Sep  7 14:17:35 1998
+++ kaffe/kaffe/kaffevm/jit/icode_internal.h	Wed Sep  9 05:13:23 1998
@@ -41,6 +41,10 @@
 extern void store_offset_short(SlotInfo*, jint, SlotInfo*);
 
 extern void move_string_const(SlotInfo*, void*);
+#ifdef GUARANA
+extern void build_call_frame_guarana(Utf8Const*, SlotInfo*, int, int);
+#else
 extern void build_call_frame(Utf8Const*, SlotInfo*, int);
+#endif
 extern void softcall_nosuchmethod(Hjava_lang_Class*, Utf8Const*, Utf8Const*);
 
Index: kaffe/kaffe/kaffevm/jit/machine.c
diff -u kaffe/kaffe/kaffevm/jit/machine.c:1.1.1.12 kaffe/kaffe/kaffevm/jit/machine.c:1.9
--- kaffe/kaffe/kaffevm/jit/machine.c:1.1.1.12	Mon Sep  7 14:17:42 1998
+++ kaffe/kaffe/kaffevm/jit/machine.c	Mon Sep  7 15:03:40 1998
@@ -42,6 +42,9 @@
 #include "external.h"
 #include "soft.h"
 #include "jni.h"
+#ifdef GUARANA
+#include "guarana/GuaraNative.h"
+#endif
 
 /*
  * Define information about this engine.
@@ -160,7 +163,7 @@
 		return;
 	}
 
-	lockMutex(meth->class);
+	lockObjMutexDirect(&meth->class->head);
 
 	if (Kaffe_JavaVMArgs[0].enableVerboseJIT) {
 		tms = currentTime();
@@ -176,7 +179,7 @@
 		KAFFEJIT_TO_NATIVE(meth);
 		/* Note that this is a real function not a trampoline.  */
 		meth->c.ncode.ncode_end = METHOD_NATIVECODE(meth);
-		unlockMutex(meth->class);
+		unlockObjMutexDirect(&meth->class->head);
 		unlockStaticMutex(&translatorlock);
 		return;
 	}
@@ -284,7 +287,7 @@
 		       METHOD_NATIVECODE(meth));
 	}
 
-	unlockMutex(meth->class);
+	unlockObjMutexDirect(&meth->class->head);
 	unlockStaticMutex(&translatorlock);
 }
 
Index: kaffe/kaffe/kaffevm/jit/machine.h
diff -u kaffe/kaffe/kaffevm/jit/machine.h:1.1.1.7 kaffe/kaffe/kaffevm/jit/machine.h:1.16
--- kaffe/kaffe/kaffevm/jit/machine.h:1.1.1.7	Mon Sep  7 14:17:43 1998
+++ kaffe/kaffe/kaffevm/jit/machine.h	Wed Sep  9 05:15:22 1998
@@ -89,6 +89,195 @@
 struct _methods;
 void translate(struct _methods*);
 
+#ifdef GUARANA
+#define	softcall_new(r, t)			softcall_new_((r), (t), meth)
+#define	softcall_newarray(r, s, t)		softcall_newarray_((r), (s), (t), meth)
+#define	softcall_anewarray(r, s, t)		softcall_anewarray_((r), (s), (t), meth)
+#define	softcall_multianewarray(r, z, s, t)	softcall_multianewarray_((r), (z), (s), (t), meth)
+
+#define build_call_frame(sig, obj, sp) build_call_frame_guarana((sig), (obj), (sp), 0)
+
+#define softcall_reify_method_invocation(method) do { \
+  end_sub_block(); \
+  prepare_function_call() ; \
+  if (method_method()->accflags & ACC_STATIC) {\
+    build_call_frame_guarana(method_sig(), 0, idx, 2); \
+    pusharg_ref_const(0, 1); \
+  } else { \
+    build_call_frame_guarana(method_sig(), stack(idx), idx, 1); \
+  } \
+  pusharg_ref((method), 0); \
+  switch (low) { \
+  case 'V': \
+    call_soft(jvoid_reify_method_invocation); \
+    break; \
+  case 'L': \
+  case '[': \
+    call_soft(jref_reify_method_invocation); \
+    break; \
+  case 'Z': \
+    call_soft(jboolean_reify_method_invocation); \
+    break; \
+  case 'C': \
+    call_soft(jchar_reify_method_invocation); \
+    break; \
+  case 'B': \
+    call_soft(jbyte_reify_method_invocation); \
+    break; \
+  case 'S': \
+    call_soft(jshort_reify_method_invocation); \
+    break; \
+  case 'I': \
+    call_soft(jint_reify_method_invocation); \
+    break; \
+  case 'J': \
+    call_soft(jlong_reify_method_invocation); \
+    break; \
+  case 'F': \
+    call_soft(jfloat_reify_method_invocation); \
+    break; \
+  case 'D': \
+    call_soft(jdouble_reify_method_invocation); \
+    break; \
+  default: \
+    ABORT(); \
+  } \
+  popargs(); \
+  fixup_function_call(); \
+  start_sub_block(); \
+} while (0)
+
+#define softcall_reify_field_load(mo, obj) do { \
+  void *func = 0; SlotInfo *slot = 0; void (*retfunc)(SlotInfo *) = 0; \
+  prepare_function_call(); \
+  pusharg_ref_const(finfo.field, 3); \
+  pusharg_ref_const(finfo.class, 2); \
+  pusharg_ref((obj), 1); \
+  pusharg_ref((mo), 0); \
+  if (FIELD_ISREF(finfo.field)) { \
+    func = jref_reify_field_load; slot = wstack(0); retfunc = return_ref; \
+  } else switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) { \
+  case 'Z': \
+    func = jboolean_reify_field_load; slot = wstack(0); retfunc = return_int; \
+    break; \
+  case 'C': \
+    func = jchar_reify_field_load; slot = wstack(0); retfunc = return_int; \
+    break; \
+  case 'B': \
+    func = jbyte_reify_field_load; slot = wstack(0); retfunc = return_int; \
+    break; \
+  case 'S': \
+    func = jshort_reify_field_load;  slot = wstack(0); retfunc = return_int; \
+    break; \
+  case 'I': \
+    func = jint_reify_field_load; slot = wstack(0); retfunc = return_int; \
+    break; \
+  case 'J': \
+    func = jlong_reify_field_load; push(1); slot = stack_long(0); retfunc = return_long; \
+    break; \
+  case 'F': \
+    func = jfloat_reify_field_load; slot = wstack(0); retfunc = return_float; \
+    break; \
+  case 'D': \
+    func = jdouble_reify_field_load; push(1); slot = stack_double(0); retfunc = return_double; \
+    break; \
+  default: \
+    ABORT(); \
+  } \
+  call_soft(func); \
+  popargs(); \
+  fixup_function_call(); \
+  retfunc(slot); \
+} while (0)
+
+#ifndef pusharg_char
+#define pusharg_char pusharg_int
+#endif
+#ifndef pusharg_bool
+#define pusharg_bool pusharg_int
+#endif
+#ifndef pusharg_byte
+#define pusharg_byte pusharg_int
+#endif
+#ifndef pusharg_short
+#define pusharg_short pusharg_int
+#endif
+
+#define softcall_reify_field_store(mo, obj) do { \
+  void *func = 0; \
+  prepare_function_call(); \
+  if (FIELD_ISREF(finfo.field)) { \
+    pusharg_ref(rstack(0), 4); pop(1); func = jref_reify_field_store; \
+  } else switch (CLASS_PRIM_SIG(FIELD_TYPE(finfo.field))) { \
+  case 'Z': \
+    pusharg_bool(rstack(0), 4); pop(1); func = jboolean_reify_field_store; \
+    break; \
+  case 'C': \
+    pusharg_char(rstack(0), 4); pop(1); func = jchar_reify_field_store; \
+    break; \
+  case 'B': \
+    pusharg_byte(rstack(0), 4); pop(1); func = jbyte_reify_field_store; \
+    break; \
+  case 'S': \
+    pusharg_short(rstack(0), 4); pop(1); func = jshort_reify_field_store; \
+    break; \
+  case 'I': \
+    pusharg_int(rstack(0), 4); pop(1); func = jint_reify_field_store; \
+    break; \
+  case 'J': \
+    pusharg_long(stack_long(0), 4); pop(2); func = jlong_reify_field_store; \
+    break; \
+  case 'F': \
+    pusharg_float(rstack(0), 4); pop(1); func = jfloat_reify_field_store; \
+    break; \
+  case 'D': \
+    pusharg_double(stack_double(0), 4); pop(2); func = jdouble_reify_field_store; \
+    break; \
+  default: \
+    ABORT(); \
+  } \
+  pusharg_ref_const(finfo.field, 3); \
+  pusharg_ref_const(finfo.class, 2); \
+  pusharg_ref((obj), 1); \
+  pusharg_ref((mo), 0); \
+  call_soft(func); \
+  popargs(); \
+  fixup_function_call(); \
+} while (0)
+
+#define softcall_reify_array_load(mo, obj, index, type, retto) do { \
+  prepare_function_call(); \
+  pusharg_int((index), 2); \
+  pusharg_ref((obj), 1); \
+  pusharg_ref((mo), 0); \
+  call_soft(j##type##_reify_array_load); \
+  popargs(); \
+  fixup_function_call(); \
+  return_##type(retto); \
+} while (0)
+
+#define softcall_reify_array_store(mo, obj, index, type, value) do { \
+  prepare_function_call(); \
+  pusharg_##type((value), 3); \
+  pusharg_int((index), 2); \
+  pusharg_ref((obj), 1); \
+  pusharg_ref((mo), 0); \
+  call_soft(j##type##_reify_array_store); \
+  popargs(); \
+  fixup_function_call(); \
+} while(0)
+
+#define softcall_reify_arraylength(to, from) do { \
+  prepare_function_call(); \
+  pusharg_ref((from), 0); \
+  call_soft(guarana_reify_arraylength); \
+  popargs(); \
+  fixup_function_call(); \
+  return_int((to)); \
+} while (0)
+
+#endif /* GUARANA */
+
 typedef struct _nativeCodeInfo {
 	void*	mem;
 	int	memlen;
Index: kaffe/kaffe/kaffevm/mem/gc-incremental.c
diff -u kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.1.1.4 kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.5
--- kaffe/kaffe/kaffevm/mem/gc-incremental.c:1.1.1.4	Mon Sep  7 14:17:47 1998
+++ kaffe/kaffe/kaffevm/mem/gc-incremental.c	Mon Sep  7 15:03:41 1998
@@ -121,6 +121,9 @@
 static void walkClass(void*, uint32);
 static void walkObject(void*, uint32);
 static void walkRefArray(void*, uint32);
+#ifdef GUARANA
+static void walkPrimArray(void*, uint32);
+#endif
 
 /* Standard GC function sets */
 static gcFuncs gcFunctions[] = {
@@ -128,7 +131,11 @@
 	{ walkNull,	    GC_OBJECT_NORMAL },	/* GC_ALLOC_NOWALK */
 	{ walkNull,	    GC_OBJECT_FIXED  },	/* GC_ALLOC_FIXED */
 	{ walkObject,	    GC_OBJECT_NORMAL },	/* GC_ALLOC_NORMALOBJECT */
+#ifdef GUARANA
+	{ walkPrimArray,    GC_OBJECT_NORMAL },	/* GC_ALLOC_PRIMARRAY */
+#else
 	{ walkNull,	    GC_OBJECT_NORMAL },	/* GC_ALLOC_PRIMARRAY */
+#endif
 	{ walkRefArray,     GC_OBJECT_NORMAL },	/* GC_ALLOC_REFARRAY */
 	{ walkClass,        GC_OBJECT_NORMAL },	/* GC_ALLOC_CLASSOBJECT */
 	{ walkObject,       finalizeObject   },	/* GC_ALLOC_FINALIZEOBJECT */
@@ -328,6 +335,9 @@
 	gcStats.markedmem += size;
 
 	class = (Hjava_lang_Class*)base;
+#ifdef GUARANA
+	markObject(class->head.meta_object);
+#endif
 
 	markObject(class->name);
 	if (class->state >= CSTATE_PREPARED) {
@@ -355,7 +365,7 @@
 }
 
 /*
- * Walk an array object objects.
+ * Walk an array of objects.
  */
 static
 void
@@ -371,6 +381,9 @@
 	gcStats.markedmem += size;
 
 	arr = (Hjava_lang_Object*)base;
+#ifdef GUARANA
+	markObject(arr->meta_object);
+#endif
 	ptr = OBJARRAY_DATA(arr);
 	for (i = ARRAY_SIZE(arr); --i>= 0; ) {
 		Hjava_lang_Object* el = *ptr++;
@@ -379,6 +392,24 @@
 		}
 	}
 }
+
+#ifdef GUARANA
+/*
+ * Walk an array of primitive type.
+ */
+static
+void
+walkPrimArray(void* base, uint32 size)
+{
+	Hjava_lang_Object* arr;
+
+	gcStats.markedobj += 1;
+	gcStats.markedmem += size;
+
+	arr = (Hjava_lang_Object*)base;
+	markObject(arr->meta_object);
+}
+#endif
 
 /*
  * The Garbage Collector sits in a loop starting a collection, waiting
Index: kaffe/kaffe/kaffevm/systems/unix-jthreads/internal.c
diff -u kaffe/kaffe/kaffevm/systems/unix-jthreads/internal.c:1.1.1.5 kaffe/kaffe/kaffevm/systems/unix-jthreads/internal.c:1.4
--- kaffe/kaffe/kaffevm/systems/unix-jthreads/internal.c:1.1.1.5	Mon Sep  7 14:17:52 1998
+++ kaffe/kaffe/kaffevm/systems/unix-jthreads/internal.c	Mon Sep  7 15:03:41 1998
@@ -65,9 +65,9 @@
         Hjava_lang_Thread *tid = jlThread;
 
         /* Notify on the object just in case anyone is waiting */
-        lockMutex(&tid->base);
+        lockObjMutex(&tid->base);
         broadcastCond(&tid->base);
-        unlockMutex(&tid->base);
+        unlockObjMutex(&tid->base);
 }
 
 static void 
Index: kaffe/kaffe/scripts/Makefile.in
diff -u kaffe/kaffe/scripts/Makefile.in:1.1.1.9 kaffe/kaffe/scripts/Makefile.in:1.5
--- kaffe/kaffe/scripts/Makefile.in:1.1.1.9	Mon Sep  7 14:17:55 1998
+++ kaffe/kaffe/scripts/Makefile.in	Mon Sep  7 15:03:42 1998
@@ -63,6 +63,11 @@
 			$(INSTALL_SCRIPT) $$i $(INSTROOT)$(bindir)/$(KPREFIX)$$i ;\
 		done
 
+@COMMENT_GUARANA@install: install-guarana
+@COMMENT_GUARANA@install-guarana: install-sun @suncompatible@
+@COMMENT_GUARANA@	$(INSTALL_SCRIPT) $(INSTROOT)$(bindir)/$(KPREFIX)kaffe$(SCREXT) $(INSTROOT)$(bindir)/$(KPREFIX)guarana$(SCREXT)
+@COMMENT_GUARANA@	$(INSTALL_SCRIPT) $(INSTROOT)$(bindir)/$(KPREFIX)javac$(SCREXT) $(INSTROOT)$(bindir)/$(KPREFIX)guaranac$(SCREXT)
+
 derived-files:
 
 depend:
Index: kaffe/kaffe/scripts/kaffe.in
diff -u kaffe/kaffe/scripts/kaffe.in:1.1.1.4 kaffe/kaffe/scripts/kaffe.in:1.4
--- kaffe/kaffe/scripts/kaffe.in:1.1.1.4	Wed Sep  9 21:36:50 1998
+++ kaffe/kaffe/scripts/kaffe.in	Mon Sep  7 16:29:46 1998
@@ -14,6 +14,7 @@
 #	2. Klasses.jar in $prefix/share/kaffe
 #	3. pizza.jar in $prefix/share/kaffe
 #	4. classes.zip in $prefix/share/kaffe iff it exists.
+#	5. guarana.jar in $prefix/share/kaffe iff it exists.
 #
 
 # If KAFFE_DEBUG is set to either gdb or emacs, a debugging session
@@ -26,6 +27,9 @@
 : ${KAFFE_CLASSDIR="@datadir@/kaffe"}
 : ${KAFFE_LIB="@libdir@"}
 CLASSPATH="${CLASSPATH-.}:$KAFFE_CLASSDIR/Klasses.jar:$KAFFE_CLASSDIR/pizza.jar"`test -f $KAFFE_CLASSDIR/classes.zip && echo ":$KAFFE_CLASSDIR/classes.zip"`
+if test -f $KAFFE_CLASSDIR/guarana.jar; then
+  CLASSPATH="$CLASSPATH:$KAFFE_CLASSDIR/guarana.jar"
+fi
 export CLASSPATH
 LD_LIBRARY_PATH="$KAFFE_LIB"${LD_LIBRARY_PATH+":$LD_LIBRARY_PATH"}
 export LD_LIBRARY_PATH
Index: kaffe/libraries/clib/external_wrappers.h
diff -u kaffe/libraries/clib/external_wrappers.h:1.1.1.2 kaffe/libraries/clib/external_wrappers.h:1.2
--- kaffe/libraries/clib/external_wrappers.h:1.1.1.2	Tue Jul 14 22:56:58 1998
+++ kaffe/libraries/clib/external_wrappers.h	Wed Sep  9 05:04:31 1998
@@ -19,3 +19,6 @@
 #if defined(HAVE_X)
 #include "awt/external_wrappers.h"
 #endif
+#ifdef GUARANA
+#include "../../kaffe/kaffevm/guarana/external_wrappers.h"
+#endif
Index: kaffe/libraries/clib/native/Array.c
diff -u kaffe/libraries/clib/native/Array.c:1.1.1.5 kaffe/libraries/clib/native/Array.c:1.5
--- kaffe/libraries/clib/native/Array.c:1.1.1.5	Mon Sep  7 14:18:23 1998
+++ kaffe/libraries/clib/native/Array.c	Wed Sep  9 05:20:11 1998
@@ -28,18 +28,31 @@
 #include <native.h>
 #include "defs.h"
 
+#ifdef GUARANA
+extern void guarana_reify_array_load(struct HBR_unicamp_Guarana_MetaObject *mo, struct Hjava_lang_Object *o, int index, jvalue *res);
+extern void guarana_reify_array_store(struct HBR_unicamp_Guarana_MetaObject *mo, struct Hjava_lang_Object *o, int index, jvalue *val);
+extern int guarana_reify_arraylength(struct Hjava_lang_Object *o);
+#endif
+
 jint
 java_lang_reflect_Array_getLength(struct Hjava_lang_Object* obj)
 {
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
 		SignalError("java.lang.IllegalArgumentException", "");
 
+#ifdef GUARANA
+	return guarana_reify_arraylength(obj);
+#else
 	return (obj_length((HArrayOfObject*)obj));
+#endif
 }
 
 struct Hjava_lang_Object*
 java_lang_reflect_Array_get(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -49,6 +62,16 @@
 	
 	if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return execute_java_constructor(0,javaLangIntegerClass,"(I)V",
+							res.i);
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -57,6 +80,16 @@
 	}
 	else if ( clazz == shortClass ) {
 		HArrayOfShort *arr = (HArrayOfShort *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return execute_java_constructor(0,javaLangShortClass,"(I)V",
+							res.i);
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -65,6 +98,16 @@
 	}
 	else if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return execute_java_constructor(0,javaLangLongClass,"(J)V",
+							res.j);
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -73,6 +116,16 @@
 	}
 	else if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return execute_java_constructor(0,javaLangByteClass,"(B)V",
+							res.i);
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -89,6 +142,16 @@
 	}
 	else if ( clazz == charClass ) {
 		HArrayOfChar *arr = (HArrayOfChar *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return execute_java_constructor(0,javaLangCharacterClass,"(C)V",
+							res.i);
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -97,6 +160,16 @@
 	}
 	else if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return execute_java_constructor(0,javaLangFloatClass,"(F)V",
+							res.f);
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -105,6 +178,16 @@
 	}
 	else if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return execute_java_constructor(0,javaLangDoubleClass,"(D)V",
+							res.d);
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -117,6 +200,15 @@
 		 */
 
 		HArrayOfObject *arr = (HArrayOfObject *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.l;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -127,6 +219,9 @@
 jbool
 java_lang_reflect_Array_getBoolean(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -136,6 +231,15 @@
 	
 	if ( clazz == booleanClass ) {
 		HArrayOfBoolean *arr = (HArrayOfBoolean *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -148,6 +252,9 @@
 jbyte
 java_lang_reflect_Array_getByte(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -157,6 +264,15 @@
 	
 	if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+	}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -169,6 +285,9 @@
 jchar
 java_lang_reflect_Array_getChar(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -178,12 +297,30 @@
 	
 	if ( clazz == charClass ) {
 		HArrayOfChar *arr = (HArrayOfChar *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -196,6 +333,9 @@
 jshort
 java_lang_reflect_Array_getShort(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -205,12 +345,30 @@
 	
 	if ( clazz == shortClass ) {
 		HArrayOfShort *arr = (HArrayOfShort *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -223,6 +381,9 @@
 jint
 java_lang_reflect_Array_getInt(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -232,24 +393,60 @@
 	
 	if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == shortClass ) {
 		HArrayOfShort *arr = (HArrayOfShort *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == charClass ) {
 		HArrayOfChar *arr = (HArrayOfChar *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -262,6 +459,9 @@
 jlong
 java_lang_reflect_Array_getLong(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -271,30 +471,75 @@
 	
 	if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.j;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == shortClass ) {
 		HArrayOfShort *arr = (HArrayOfShort *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == charClass ) {
 		HArrayOfChar *arr = (HArrayOfChar *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -307,6 +552,9 @@
 jfloat
 java_lang_reflect_Array_getFloat(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -316,36 +564,90 @@
 	
 	if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.f;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.j;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == shortClass ) {
 		HArrayOfShort *arr = (HArrayOfShort *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == charClass ) {
 		HArrayOfChar *arr = (HArrayOfChar *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -358,6 +660,9 @@
 jdouble
 java_lang_reflect_Array_getDouble(struct Hjava_lang_Object* obj, jint elem)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -367,42 +672,105 @@
 	
 	if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.d;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.f;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.j;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == shortClass ) {
 		HArrayOfShort *arr = (HArrayOfShort *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == charClass ) {
 		HArrayOfChar *arr = (HArrayOfChar *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		return unhand(arr)->body[elem];
 	} else if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue res;
+			guarana_reify_array_load(mo, obj, elem, &res);
+			return res.i;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -415,6 +783,9 @@
 void
 java_lang_reflect_Array_set(struct Hjava_lang_Object* obj, jint elem, struct Hjava_lang_Object* val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -422,6 +793,15 @@
 
 	if (!CLASS_IS_PRIMITIVE(CLASS_ELEMENT_TYPE(OBJECT_CLASS(obj)))) {
 		HArrayOfObject *arr = (HArrayOfObject *)obj;
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.l = val;
+			guarana_reify_array_store(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -466,6 +846,9 @@
 void
 java_lang_reflect_Array_setBoolean(struct Hjava_lang_Object* obj, jint elem, jbool val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -475,6 +858,16 @@
 	
 	if ( clazz == booleanClass ) {
 		HArrayOfBoolean *arr = (HArrayOfBoolean *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -487,6 +880,9 @@
 void
 java_lang_reflect_Array_setByte(struct Hjava_lang_Object* obj, jint elem, jbyte val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -496,42 +892,112 @@
 	
 	if ( clazz == byteClass ) {
 		HArrayOfByte *arr = (HArrayOfByte *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == shortClass ) {
 		HArrayOfShort *arr = (HArrayOfShort *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == charClass ) {
 		HArrayOfChar *arr = (HArrayOfChar *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.j = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.f = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.d = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -544,6 +1010,9 @@
 void
 java_lang_reflect_Array_setChar(struct Hjava_lang_Object* obj, jint elem, jchar val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -553,30 +1022,80 @@
 	
 	if ( clazz == charClass ) {
 		HArrayOfChar *arr = (HArrayOfChar *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.j = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.f = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.d = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -589,6 +1108,9 @@
 void
 java_lang_reflect_Array_setShort(struct Hjava_lang_Object* obj, jint elem, jshort val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -598,30 +1120,80 @@
 	
 	if ( clazz == shortClass ) {
 		HArrayOfShort *arr = (HArrayOfShort *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.j = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.f = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.d = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -634,6 +1206,9 @@
 void
 java_lang_reflect_Array_setInt(struct Hjava_lang_Object* obj, jint elem, jint val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -643,24 +1218,64 @@
 	
 	if ( clazz == intClass ) {
 		HArrayOfInt *arr = (HArrayOfInt *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.i = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.j = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.f = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.d = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -673,6 +1288,9 @@
 void
 java_lang_reflect_Array_setLong(struct Hjava_lang_Object* obj, jint elem, jlong val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -682,18 +1300,48 @@
 	
 	if ( clazz == longClass ) {
 		HArrayOfLong *arr = (HArrayOfLong *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.j = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.f = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.d = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -706,6 +1354,9 @@
 void
 java_lang_reflect_Array_setFloat(struct Hjava_lang_Object* obj, jint elem, jfloat val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -715,12 +1366,32 @@
 	
 	if ( clazz == floatClass ) {
 		HArrayOfFloat *arr = (HArrayOfFloat *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.f = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
 		unhand(arr)->body[elem] = val;
 	} else if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.d = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
@@ -733,6 +1404,9 @@
 void
 java_lang_reflect_Array_setDouble(struct Hjava_lang_Object* obj, jint elem, jdouble val)
 {
+#ifdef GUARANA
+	struct HBR_unicamp_Guarana_MetaObject *mo = obj->meta_object;
+#endif
 	Hjava_lang_Class *clazz;
 
 	if (!CLASS_IS_ARRAY(OBJECT_CLASS(obj)))
@@ -742,6 +1416,16 @@
 	
 	if ( clazz == doubleClass ) {
 		HArrayOfDouble *arr = (HArrayOfDouble *)obj;
+
+#ifdef GUARANA
+		if (mo) {
+			jvalue value;
+			value.d = val;
+			guarana_reify_array_load(mo, obj, elem, &value);
+			return;
+		}
+#endif
+
 		if (elem < 0 || elem >= obj_length(arr))
 			SignalError("java.lang.ArrayIndexOutOfBoundsException", "");
 		
Index: kaffe/libraries/clib/native/Class.c
diff -u kaffe/libraries/clib/native/Class.c:1.1.1.6 kaffe/libraries/clib/native/Class.c:1.10
--- kaffe/libraries/clib/native/Class.c:1.1.1.6	Mon Sep  7 14:18:26 1998
+++ kaffe/libraries/clib/native/Class.c	Wed Sep  9 05:16:46 1998
@@ -459,6 +459,30 @@
 	return (field);
 }
  
+#ifdef GUARANA
+extern HArrayOfObject* (*p_makeParameters)(Method *meth);
+
+extern Hjava_lang_Class* (*p_makeReturn)(Method *meth);
+
+extern Hjava_lang_reflect_Constructor* (*p_makeConstructor)(struct Hjava_lang_Class* clazz, int slot);
+
+extern Hjava_lang_reflect_Method* (*p_makeMethod)(struct Hjava_lang_Class* clazz, int slot);
+
+extern Hjava_lang_reflect_Field* (*p_makeField)(struct Hjava_lang_Class* clazz, int slot);
+
+extern Hjava_lang_String* (*p_getClassName)(struct Hjava_lang_Class *clazz);
+
+void
+java_lang_Class_init_function_pointers(void) {
+	p_makeParameters = makeParameters;
+	p_makeReturn = makeReturn;
+	p_makeConstructor = makeConstructor;
+	p_makeMethod = makeMethod;
+	p_makeField = makeField;
+	p_getClassName = java_lang_Class_getName;
+}
+#endif
+
 /*
  * count the number of methods in a class that are not constructors.
  * If declared is not set, count only public methods.
Index: kaffe/libraries/clib/native/ClassLoader.c
diff -u kaffe/libraries/clib/native/ClassLoader.c:1.1.1.5 kaffe/libraries/clib/native/ClassLoader.c:1.4
--- kaffe/libraries/clib/native/ClassLoader.c:1.1.1.5	Tue Jul 14 22:57:11 1998
+++ kaffe/libraries/clib/native/ClassLoader.c	Wed Jul 15 03:43:28 1998
@@ -83,16 +83,16 @@
 	/*
 	 * see if somebody loaded that class already
 	 */
-	lockMutex(centry);
+	lockCEntryMutex(centry);
 	if (centry->class != NULL) {
-		unlockMutex(centry);
+		unlockCEntryMutex(centry);
 		SignalError("java.lang.ClassFormatError", "Duplicate name");
 	}
 
 	/* enter the class we loaded and return */
 	centry->class = clazz;
 	clazz->centry = centry;
-	unlockMutex(centry);
+	unlockCEntryMutex(centry);
 
 	/*
 	 * While it is not necessary that one be able to actually *use*
Index: kaffe/libraries/clib/native/Field.c
diff -u kaffe/libraries/clib/native/Field.c:1.1.1.3 kaffe/libraries/clib/native/Field.c:1.4
--- kaffe/libraries/clib/native/Field.c:1.1.1.3	Mon Sep  7 14:18:31 1998
+++ kaffe/libraries/clib/native/Field.c	Wed Sep  9 05:21:28 1998
@@ -36,6 +36,11 @@
 #include <native.h>
 #include "defs.h"
 
+#ifdef GUARANA
+extern void guarana_reify_field_load(struct HBR_unicamp_Guarana_MetaObject *mo, struct Hjava_lang_Object *o, struct Hjava_lang_Class *declass, Field *field, jvalue *res);
+extern void guarana_reify_field_store(struct HBR_unicamp_Guarana_MetaObject *mo, struct Hjava_lang_Object *o, struct Hjava_lang_Class *declass, Field *field, jvalue *val);
+#endif
+
 static
 char*
 getFieldAddress(Hjava_lang_reflect_Field* this, struct Hjava_lang_Object* obj)
@@ -82,9 +87,40 @@
         Hjava_lang_Class* clas;
         Field* fld;
         char* base;
+#ifdef GUARANA
+	jvalue result;
+	struct HBR_unicamp_Guarana_MetaObject *mo;
+#endif
 
         clas = (Hjava_lang_Class*) unhand(this)->clazz;
         fld = CLASS_FIELDS(clas) + unhand(this)->slot;
+#ifdef GUARANA
+	if (fld->accflags & ACC_STATIC)
+	  mo = clas->head.meta_object;
+	else
+	  mo = obj->meta_object;
+
+	if (mo) {
+	  guarana_reify_field_load(mo, obj, clas, fld, base = (char*)&result);
+
+	  if (FIELD_ISREF(fld))
+	    switch (CLASS_PRIM_SIG(FIELD_TYPE(fld))) {
+	    case 'Z':
+	      result.z = result.i;
+	      break;
+	    case 'B':
+	      result.b = result.i;
+	      break;
+	    case 'S':
+	      result.s = result.i;
+	      break;
+	    case 'C':
+	      result.c = result.i;
+	      break;
+	    }
+
+        } else
+#endif
         base = getFieldAddress(this, obj);
 
 	if ( fld->type == intClass ) {
@@ -132,6 +168,20 @@
         base = getFieldAddress(this, obj);
 
         if ( fld->type == booleanClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return *(jbool*)base;
 	}
         else {
@@ -152,6 +202,20 @@
         base = getFieldAddress(this, obj);
 
         if ( fld->type == byteClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return *(jbyte*)base;
 	}
         else {
@@ -171,6 +235,20 @@
         base = getFieldAddress(this, obj);
 
         if ( fld->type == charClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return *(jchar*)base;
 	}
         else {
@@ -191,9 +269,37 @@
         base = getFieldAddress(this, obj);
 
         if ( fld->type == shortClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return *(jshort*)base;
 	}
         else if ( fld->type == byteClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jshort)(*(jbyte*)base);
 	}
         else {
@@ -213,15 +319,71 @@
         base = getFieldAddress(this, obj);
 
         if ( fld->type == intClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return *(jint*)base;
 	}
         else if ( fld->type == shortClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jint)(*(jshort*)base);
 	}
         else if ( fld->type == byteClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jint)(*(jbyte*)base);
 	}
         else if ( fld->type == charClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jint)(*(jchar*)base);
 	}
         else {
@@ -241,18 +403,88 @@
         base = getFieldAddress(this, obj);
 
         if ( fld->type == longClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.j;
+		} else
+#endif
                 return *(jlong*)base;
 	}
         else if ( fld->type == intClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jlong)(*(jint*)base);
 	}
         else if ( fld->type == shortClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jlong)(*(jshort*)base);
 	}
         else if ( fld->type == byteClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jlong)(*(jbyte*)base);
 	}
         else if ( fld->type == charClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jlong)(*(jchar*)base);
 	}
         else {
@@ -272,21 +504,105 @@
         base = getFieldAddress(this, obj);
 
         if ( fld->type == floatClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.f;
+		} else
+#endif
                 return *(jfloat*)base;
 	}
         else if ( fld->type == longClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.j;
+		} else
+#endif
                 return (jfloat)(*(jlong*)base);
 	}
         else if ( fld->type == intClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jfloat)(*(jint*)base);
 	}
         else if ( fld->type == shortClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jfloat)(*(jshort*)base);
 	}
         else if ( fld->type == byteClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jfloat)(*(jbyte*)base);
 	}
         else if ( fld->type == charClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jfloat)(*(jchar*)base);
 	}
         else {
@@ -306,24 +622,122 @@
         base = getFieldAddress(this, obj);
 
         if ( fld->type == doubleClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.d;
+		} else
+#endif
                 return *(jdouble*)base;
 	}
         else if ( fld->type == floatClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.f;
+		} else
+#endif
                 return (jdouble)(*(jfloat*)base);
 	}
         else if ( fld->type == longClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.j;
+		} else
+#endif
                 return (jdouble)(*(jlong*)base);
 	}
         else if ( fld->type == intClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jdouble)(*(jint*)base);
 	}
         else if ( fld->type == shortClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jdouble)(*(jshort*)base);
 	}
         else if ( fld->type == byteClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jdouble)(*(jbyte*)base);
 	}
         else if ( fld->type == charClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue result;
+		  guarana_reify_field_load(mo, obj, clas, fld, &result);
+		  return result.i;
+		} else
+#endif
                 return (jdouble)(*(jchar*)base);
 	}
         else {
@@ -348,6 +762,20 @@
         }
 
         if ( fld->type == booleanClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jbool*)base = val;
 	}
         else {
@@ -371,21 +799,105 @@
         }
 
         if ( fld->type == byteClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jbyte*)base = val;
 	}
         else if ( fld->type == shortClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jshort*)base = (jshort)val;
 	}
         else if ( fld->type == intClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jint*)base = (jint)val;
 	}
         else if ( fld->type == longClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.j = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jlong*)base = (jlong)val;
 	}
         else if ( fld->type == floatClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.f = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jfloat*)base = (jfloat)val;
 	}
         else if ( fld->type == doubleClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.d = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jdouble*)base =(jdouble)val;
 	}
         else {
@@ -409,18 +921,88 @@
         }
 
         if ( fld->type == charClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jchar*)base = val;
 	}
         else if ( fld->type == intClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jint*)base = (jint)val;
 	}
         else if ( fld->type == longClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.j = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jlong*)base = (jlong)val;
 	}
         else if ( fld->type == floatClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.f = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jfloat*)base = (jfloat)val;
 	}
         else if ( fld->type == doubleClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.d = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jdouble*)base =(jdouble)val;
 	}
         else {
@@ -444,18 +1026,88 @@
         }
 
         if ( fld->type == shortClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jshort*)base = val;
 	}
         else if ( fld->type == intClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jint*)base = (jint)val;
 	}
         else if ( fld->type == longClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.j = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jlong*)base = (jlong)val;
 	}
         else if ( fld->type == floatClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.f = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jfloat*)base = (jfloat)val;
 	}
         else if ( fld->type == doubleClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.d = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jdouble*)base =(jdouble)val;
 	}
         else {
@@ -479,15 +1131,71 @@
         }
 
         if ( fld->type == intClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.i = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jint*)base = val;
 	}
         else if ( fld->type == longClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.j = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jlong*)base = (jlong)val;
 	}
         else if ( fld->type == floatClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.f = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jfloat*)base = (jfloat)val;
 	}
         else if ( fld->type == doubleClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.d = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jdouble*)base =(jdouble)val;
 	}
         else {
@@ -511,12 +1219,54 @@
         }
 
         if ( fld->type == longClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.j = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jlong*)base = val;
 	}
         else if ( fld->type == floatClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.f = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jfloat*)base = (jfloat)val;
 	}
         else if ( fld->type == doubleClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.d = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jdouble*)base = (jdouble)val;
 	}
         else {
@@ -540,9 +1290,37 @@
         }
 
         if ( fld->type == floatClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.f = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jfloat*)base = val;
 	}
         else if ( fld->type == doubleClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.d = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jdouble*)base =(jdouble)val;
 	}
         else {
@@ -566,6 +1344,20 @@
         }
 
         if ( fld->type == doubleClass ) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.d = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		} else
+#endif
                 *(jdouble*)base = val;
 	}
         else {
@@ -588,6 +1380,22 @@
         }
 	
 	if (FIELD_ISREF(fld) && (val == NULL || soft_instanceof(resolveFieldType(fld, clas), val))) {
+#ifdef GUARANA
+		struct HBR_unicamp_Guarana_MetaObject *mo;
+
+		if (fld->accflags & ACC_STATIC)
+		  mo = clas->head.meta_object;
+		else
+		  mo = obj->meta_object;
+
+		if (mo) {
+		  jvalue value;
+		  value.l = val;
+		  guarana_reify_field_store(mo, obj, clas, fld, &value);
+		  return;
+		}
+
+#endif
 		base = getFieldAddress(this, obj);
 		*(struct Hjava_lang_Object**)base = val;
 		return;
Index: kaffe/libraries/clib/native/Thread.c
diff -u kaffe/libraries/clib/native/Thread.c:1.1.1.5 kaffe/libraries/clib/native/Thread.c:1.5
--- kaffe/libraries/clib/native/Thread.c:1.1.1.5	Mon Sep  7 14:18:48 1998
+++ kaffe/libraries/clib/native/Thread.c	Wed Sep  9 05:23:04 1998
@@ -92,17 +92,17 @@
 void
 java_lang_Thread_suspend0(struct Hjava_lang_Thread* this)
 {
-	lockMutex(this);
+	lockObjMutex((Hjava_lang_Object*)this);
 	waitCond(this, 0);
-	unlockMutex(this);
+	unlockObjMutex((Hjava_lang_Object*)this);
 }
 
 void
 java_lang_Thread_resume0(struct Hjava_lang_Thread* this)
 {
-	lockMutex(this);
+	lockObjMutex((Hjava_lang_Object*)this);
 	signalCond(this);
-	unlockMutex(this);
+	unlockObjMutex((Hjava_lang_Object*)this);
 }
 
 jbool
