[kaffe] CVS kaffe (robilad): added sun.misc.Unsafe implementation

Kaffe CVS cvs-commits at kaffe.org
Thu Feb 21 23:13:19 PST 2008


PatchSet 7765 
Date: 2008/02/22 07:00:35
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
added sun.misc.Unsafe implementation

2008-02-21  Dalibor Topic  <robilad at kaffe.org>

        * configure.ac : Check for glib.

        * kaffe/kaffevm/Makefile.am (AM_CPPFLAGS): Added GLIB_CFLAGS.
        (libkaffe_la_LIBADD) Added GLIB_LIBS.
        (libkaffevm_la_SOURCES) Added libraries/clib/native/Unsafe.c.

        * kaffe/kaffevm/jit/Makefile.am (AM_CPPFLAGS): Added GLIB_CFLAGS.
        (libengine_la_LDFLAGS) Added GLIB_LIBS.

        * kaffe/kaffevm/jit3/Makefile.am (AM_CPPFLAGS): Added GLIB_CFLAGS.
        (libengine_la_LDFLAGS) Added GLIB_LIBS.

        * kaffe/kaffevm/jit/methodcalls.c (soft_fixup_trampoline) Use glib atomic functions.

        * kaffe/kaffevm/support.h (KaffeVM_GetFieldAddress): Added declaration.

        * kaffe/kaffevm/support.c (KaffeVM_GetFieldAddress): New helper function,
        created from getFieldAddress.

        * libraries/clib/native/Field.c (getFieldAddress): Factored out into
        KaffeVM_GetFieldAddress.

        * include/Makefile.am (NOINSTALL_JNI_DERIVED_HDRS): Added sun_misc_Unsafe.h.

Members: 
	ChangeLog:1.5265->1.5266 
	Makefile.in:1.314->1.315 
	configure:1.640->1.641 
	configure.ac:1.310->1.311 
	config/Makefile.in:1.258->1.259 
	include/Makefile.am:1.146->1.147 
	include/Makefile.in:1.322->1.323 
	kaffe/Makefile.in:1.206->1.207 
	kaffe/jvmpi/Makefile.in:1.132->1.133 
	kaffe/kaffe/Makefile.in:1.231->1.232 
	kaffe/kaffeh/Makefile.in:1.213->1.214 
	kaffe/kaffevm/Makefile.am:1.112->1.113 
	kaffe/kaffevm/Makefile.in:1.287->1.288 
	kaffe/kaffevm/support.c:1.93->1.94 
	kaffe/kaffevm/support.h:1.46->1.47 
	kaffe/kaffevm/boehm-gc/Makefile.in:1.97->1.98 
	kaffe/kaffevm/gcj/Makefile.in:1.186->1.187 
	kaffe/kaffevm/intrp/Makefile.in:1.195->1.196 
	kaffe/kaffevm/jit/Makefile.am:1.26->1.27 
	kaffe/kaffevm/jit/Makefile.in:1.205->1.206 
	kaffe/kaffevm/jit/methodcalls.c:1.15->1.16 
	kaffe/kaffevm/jit3/Makefile.am:1.20->1.21 
	kaffe/kaffevm/jit3/Makefile.in:1.175->1.176 
	kaffe/kaffevm/kaffe-gc/Makefile.in:1.95->1.96 
	kaffe/kaffevm/systems/Makefile.in:1.195->1.196 
	kaffe/kaffevm/systems/beos-native/Makefile.in:1.186->1.187 
	kaffe/kaffevm/systems/drops-l4threads/Makefile.in:1.50->1.51 
	kaffe/kaffevm/systems/oskit-pthreads/Makefile.in:1.192->1.193 
	kaffe/kaffevm/systems/unix-jthreads/Makefile.in:1.196->1.197 
	kaffe/kaffevm/systems/unix-pthreads/Makefile.in:1.172->1.173 
	kaffe/man/Makefile.in:1.193->1.194 
	kaffe/scripts/Makefile.in:1.239->1.240 
	kaffe/scripts/bat/Makefile.in:1.186->1.187 
	kaffe/scripts/compat/Makefile.in:1.214->1.215 
	kaffe/xprof/Makefile.in:1.162->1.163 
	libraries/Makefile.in:1.189->1.190 
	libraries/clib/Makefile.in:1.211->1.212 
	libraries/clib/awt/Makefile.in:1.204->1.205 
	libraries/clib/awt/X/Makefile.in:1.200->1.201 
	libraries/clib/awt/nano-X/Makefile.in:1.71->1.72 
	libraries/clib/awt/qt/Makefile.in:1.152->1.153 
	libraries/clib/awt/xynth/Makefile.in:1.27->1.28 
	libraries/clib/native/Field.c:1.23->1.24 
	libraries/clib/zip/Makefile.in:1.209->1.210 
	libraries/javalib/Makefile.in:1.602->1.603 
	libraries/javalib/awt-implementations/Makefile.in:1.83->1.84 
	libraries/javalib/awt-implementations/kaffe/Makefile.in:1.106->1.107 
	libraries/javalib/vmspecific/Makefile.in:1.35->1.36 
	libraries/javalib/zlib-zip/Makefile.in:1.33->1.34 
	replace/Makefile.in:1.149->1.150 
	test/Makefile.in:1.198->1.199 
	test/internal/Makefile.in:1.174->1.175 
	test/jni/Makefile.in:1.106->1.107 
	test/regression/Makefile.in:1.277->1.278 
	test/regression/compile_time/Makefile.in:1.126->1.127 
	test/regression/compiler/Makefile.in:1.110->1.111 
	test/regression/run_time/Makefile.in:1.125->1.126 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.5265 kaffe/ChangeLog:1.5266
--- kaffe/ChangeLog:1.5265	Wed Feb 20 22:17:55 2008
+++ kaffe/ChangeLog	Fri Feb 22 07:00:35 2008
@@ -1,3 +1,29 @@
+2008-02-21  Dalibor Topic  <robilad at kaffe.org>
+
+	* configure.ac : Check for glib.
+
+	* kaffe/kaffevm/Makefile.am (AM_CPPFLAGS): Added GLIB_CFLAGS.
+	(libkaffe_la_LIBADD) Added GLIB_LIBS.
+	(libkaffevm_la_SOURCES) Added libraries/clib/native/Unsafe.c.
+
+	* kaffe/kaffevm/jit/Makefile.am (AM_CPPFLAGS): Added GLIB_CFLAGS.
+        (libengine_la_LDFLAGS) Added GLIB_LIBS.
+
+	* kaffe/kaffevm/jit3/Makefile.am (AM_CPPFLAGS): Added GLIB_CFLAGS.
+        (libengine_la_LDFLAGS) Added GLIB_LIBS.
+
+	* kaffe/kaffevm/jit/methodcalls.c (soft_fixup_trampoline) Use glib atomic functions.
+
+	* kaffe/kaffevm/support.h (KaffeVM_GetFieldAddress): Added declaration.
+
+	* kaffe/kaffevm/support.c (KaffeVM_GetFieldAddress): New helper function,
+	created from getFieldAddress.
+
+	* libraries/clib/native/Field.c (getFieldAddress): Factored out into 
+	KaffeVM_GetFieldAddress.
+
+	* include/Makefile.am (NOINSTALL_JNI_DERIVED_HDRS): Added sun_misc_Unsafe.h.
+
 2008-02-20  Dalibor Topic  <robilad at kaffe.org>
 
 	* kaffe/kaffevm/debug.c (kaffe_dprintf): Added missing casts to n.
Index: kaffe/Makefile.in
diff -u kaffe/Makefile.in:1.314 kaffe/Makefile.in:1.315
--- kaffe/Makefile.in:1.314	Sat Feb  2 16:17:48 2008
+++ kaffe/Makefile.in	Fri Feb 22 07:00:39 2008
@@ -149,6 +149,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/configure
diff -u kaffe/configure:1.640 kaffe/configure:1.641
--- kaffe/configure:1.640	Fri Feb 15 01:32:34 2008
+++ kaffe/configure	Fri Feb 22 07:00:39 2008
@@ -1004,6 +1004,8 @@
 PKG_CONFIG
 ZZIP_CFLAGS
 ZZIP_LIBS
+GLIB_CFLAGS
+GLIB_LIBS
 COND_ZLIB_ZIP_TRUE
 COND_ZLIB_ZIP_FALSE
 DLOPEN_JAVA_LIBS
@@ -1056,7 +1058,9 @@
 XMKMF
 PKG_CONFIG
 ZZIP_CFLAGS
-ZZIP_LIBS'
+ZZIP_LIBS
+GLIB_CFLAGS
+GLIB_LIBS'
 
 
 # Initialize some variables set by options.
@@ -1759,6 +1763,8 @@
   PKG_CONFIG  path to pkg-config utility
   ZZIP_CFLAGS C compiler flags for ZZIP, overriding pkg-config
   ZZIP_LIBS   linker flags for ZZIP, overriding pkg-config
+  GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config
+  GLIB_LIBS   linker flags for GLIB, overriding pkg-config
 
 Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
@@ -7232,7 +7238,7 @@
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 7235 "configure"' > conftest.$ac_ext
+  echo '#line 7241 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -9792,11 +9798,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:9795: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:9801: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:9799: \$? = $ac_status" >&5
+   echo "$as_me:9805: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -10082,11 +10088,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10085: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10091: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:10089: \$? = $ac_status" >&5
+   echo "$as_me:10095: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -10186,11 +10192,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:10189: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:10195: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:10193: \$? = $ac_status" >&5
+   echo "$as_me:10199: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -12548,7 +12554,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12551 "configure"
+#line 12557 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -12648,7 +12654,7 @@
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 12651 "configure"
+#line 12657 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -15068,11 +15074,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15071: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15077: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:15075: \$? = $ac_status" >&5
+   echo "$as_me:15081: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -15172,11 +15178,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:15175: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:15181: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:15179: \$? = $ac_status" >&5
+   echo "$as_me:15185: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -16749,11 +16755,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16752: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16758: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:16756: \$? = $ac_status" >&5
+   echo "$as_me:16762: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -16853,11 +16859,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:16856: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:16862: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:16860: \$? = $ac_status" >&5
+   echo "$as_me:16866: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -19053,11 +19059,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:19056: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19062: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:19060: \$? = $ac_status" >&5
+   echo "$as_me:19066: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -19343,11 +19349,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:19346: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19352: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:19350: \$? = $ac_status" >&5
+   echo "$as_me:19356: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -19447,11 +19453,11 @@
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:19450: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:19456: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:19454: \$? = $ac_status" >&5
+   echo "$as_me:19460: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -26002,7 +26008,7 @@
 JAVA_TEST=Test.java
 CLASS_TEST=Test.class
 cat << \EOF > $JAVA_TEST
-/* #line 26005 "configure" */
+/* #line 26011 "configure" */
 public class Test {
 }
 EOF
@@ -41937,6 +41943,118 @@
 	:
 fi
 
+
+pkg_failed=no
+{ echo "$as_me:$LINENO: checking for GLIB" >&5
+echo $ECHO_N "checking for GLIB... $ECHO_C" >&6; }
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GLIB_CFLAGS"; then
+        pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.8.6\"") >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.8.6") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.8.6" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$GLIB_LIBS"; then
+        pkg_cv_GLIB_LIBS="$GLIB_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.8.6\"") >&5
+  ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.8.6") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.8.6" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+	pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+	        GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "glib-2.0 >= 2.8.6"`
+        else
+	        GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0 >= 2.8.6"`
+        fi
+	# Put the nasty error message in config.log where it belongs
+	echo "$GLIB_PKG_ERRORS" >&5
+
+	{ { echo "$as_me:$LINENO: error: Package requirements (glib-2.0 >= 2.8.6) were not met:
+
+$GLIB_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GLIB_CFLAGS
+and GLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&5
+echo "$as_me: error: Package requirements (glib-2.0 >= 2.8.6) were not met:
+
+$GLIB_PKG_ERRORS
+
+Consider adjusting the PKG_CONFIG_PATH environment variable if you
+installed software in a non-standard prefix.
+
+Alternatively, you may set the environment variables GLIB_CFLAGS
+and GLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+" >&2;}
+   { (exit 1); exit 1; }; }
+elif test $pkg_failed = untried; then
+	{ { echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables GLIB_CFLAGS
+and GLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&5
+echo "$as_me: error: The pkg-config script could not be found or is too old.  Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
+path to pkg-config.
+
+Alternatively, you may set the environment variables GLIB_CFLAGS
+and GLIB_LIBS to avoid the need to call pkg-config.
+See the pkg-config man page for more details.
+
+To get pkg-config, see <http://pkg-config.freedesktop.org/>.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+	GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS
+	GLIB_LIBS=$pkg_cv_GLIB_LIBS
+        { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+	:
+fi
+
 # Check whether --enable-zlib_zip was given.
 if test "${enable_zlib_zip+set}" = set; then
   enableval=$enable_zlib_zip;
@@ -43849,6 +43967,8 @@
 PKG_CONFIG!$PKG_CONFIG$ac_delim
 ZZIP_CFLAGS!$ZZIP_CFLAGS$ac_delim
 ZZIP_LIBS!$ZZIP_LIBS$ac_delim
+GLIB_CFLAGS!$GLIB_CFLAGS$ac_delim
+GLIB_LIBS!$GLIB_LIBS$ac_delim
 COND_ZLIB_ZIP_TRUE!$COND_ZLIB_ZIP_TRUE$ac_delim
 COND_ZLIB_ZIP_FALSE!$COND_ZLIB_ZIP_FALSE$ac_delim
 DLOPEN_JAVA_LIBS!$DLOPEN_JAVA_LIBS$ac_delim
@@ -43878,7 +43998,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 57; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 59; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
Index: kaffe/configure.ac
diff -u kaffe/configure.ac:1.310 kaffe/configure.ac:1.311
--- kaffe/configure.ac:1.310	Fri Feb 15 01:32:34 2008
+++ kaffe/configure.ac	Fri Feb 22 07:00:41 2008
@@ -1572,6 +1572,8 @@
 # Make sure that we get a zziplib instance with zzip_fstat.
 PKG_CHECK_MODULES([ZZIP],[zziplib >= 0.13.24])
 
+PKG_CHECK_MODULES([GLIB],[glib-2.0 >= 2.8.6])
+
 AC_ARG_ENABLE([zlib_zip],
               AS_HELP_STRING([--enable-zlib-zip],
                              [Enable java.util.zip implementation using zlib]),
Index: kaffe/config/Makefile.in
diff -u kaffe/config/Makefile.in:1.258 kaffe/config/Makefile.in:1.259
--- kaffe/config/Makefile.in:1.258	Sat Feb  2 22:12:32 2008
+++ kaffe/config/Makefile.in	Fri Feb 22 07:00:44 2008
@@ -123,6 +123,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/include/Makefile.am
diff -u kaffe/include/Makefile.am:1.146 kaffe/include/Makefile.am:1.147
--- kaffe/include/Makefile.am:1.146	Wed Feb 20 14:29:09 2008
+++ kaffe/include/Makefile.am	Fri Feb 22 07:00:45 2008
@@ -62,6 +62,7 @@
 INSTALL_JNI_DERIVED_HDRS =
 
 NOINSTALL_JNI_DERIVED_HDRS = \
+	sun_misc_Unsafe.h \
 	java_math_BigInteger.h \
 	java_lang_VMProcess.h \
 	java_lang_ref_Reference.h \
Index: kaffe/include/Makefile.in
diff -u kaffe/include/Makefile.in:1.322 kaffe/include/Makefile.in:1.323
--- kaffe/include/Makefile.in:1.322	Wed Feb 20 14:29:10 2008
+++ kaffe/include/Makefile.in	Fri Feb 22 07:00:46 2008
@@ -138,6 +138,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
@@ -336,6 +338,7 @@
 DERIVED_HDRS = $(INSTALL_DERIVED_HDRS) $(NOINSTALL_DERIVED_HDRS)
 INSTALL_JNI_DERIVED_HDRS = 
 NOINSTALL_JNI_DERIVED_HDRS = \
+	sun_misc_Unsafe.h \
 	java_math_BigInteger.h \
 	java_lang_VMProcess.h \
 	java_lang_ref_Reference.h \
Index: kaffe/kaffe/Makefile.in
diff -u kaffe/kaffe/Makefile.in:1.206 kaffe/kaffe/Makefile.in:1.207
--- kaffe/kaffe/Makefile.in:1.206	Sat Feb  2 15:58:14 2008
+++ kaffe/kaffe/Makefile.in	Fri Feb 22 07:00:47 2008
@@ -127,6 +127,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/kaffe/jvmpi/Makefile.in
diff -u kaffe/kaffe/jvmpi/Makefile.in:1.132 kaffe/kaffe/jvmpi/Makefile.in:1.133
--- kaffe/kaffe/jvmpi/Makefile.in:1.132	Sat Feb  2 15:58:15 2008
+++ kaffe/kaffe/jvmpi/Makefile.in	Fri Feb 22 07:00:50 2008
@@ -136,6 +136,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/kaffe/kaffe/Makefile.in
diff -u kaffe/kaffe/kaffe/Makefile.in:1.231 kaffe/kaffe/kaffe/Makefile.in:1.232
--- kaffe/kaffe/kaffe/Makefile.in:1.231	Sat Feb  2 15:58:15 2008
+++ kaffe/kaffe/kaffe/Makefile.in	Fri Feb 22 07:00:51 2008
@@ -139,6 +139,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/kaffe/kaffeh/Makefile.in
diff -u kaffe/kaffe/kaffeh/Makefile.in:1.213 kaffe/kaffe/kaffeh/Makefile.in:1.214
--- kaffe/kaffe/kaffeh/Makefile.in:1.213	Sat Feb  2 15:58:15 2008
+++ kaffe/kaffe/kaffeh/Makefile.in	Fri Feb 22 07:00:51 2008
@@ -140,6 +140,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/kaffe/kaffevm/Makefile.am
diff -u kaffe/kaffe/kaffevm/Makefile.am:1.112 kaffe/kaffe/kaffevm/Makefile.am:1.113
--- kaffe/kaffe/kaffevm/Makefile.am:1.112	Tue Jan 22 23:21:29 2008
+++ kaffe/kaffe/kaffevm/Makefile.am	Fri Feb 22 07:00:52 2008
@@ -31,7 +31,8 @@
 	-I$(top_srcdir)/kaffe/kaffevm/verifier \
 	-I$(top_srcdir)/kaffe/kaffevm/jni \
         -I$(top_srcdir)/config/$(Khost_cpu) \
-	-I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) 
+	-I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) \
+	$(GLIB_CFLAGS)
 
 native_LTLIBRARIES = libkaffevm.la libkaffe.la
 
@@ -72,7 +73,8 @@
 	$(libkaffe_la_DEPENDENCIES) \
 	$(VM_LIBS) \
 	$(M_LIBS) \
-	$(ZZIP_LIBS)
+	$(ZZIP_LIBS) \
+	$(GLIB_LIBS)
 
 libkaffevm_la_CFLAGS = \
 	$(AM_CFLAGS) \
@@ -210,7 +212,8 @@
         $(top_srcdir)/libraries/clib/native/java_lang_Thread.c \
         $(top_srcdir)/libraries/clib/native/Throwable.c \
 	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMStackWalker.c \
-	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c 
+	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c \
+	$(top_srcdir)/libraries/clib/native/Unsafe.c
 
 CLEANFILES = so_locations
 
Index: kaffe/kaffe/kaffevm/Makefile.in
diff -u kaffe/kaffe/kaffevm/Makefile.in:1.287 kaffe/kaffe/kaffevm/Makefile.in:1.288
--- kaffe/kaffe/kaffevm/Makefile.in:1.287	Sat Feb  2 15:58:16 2008
+++ kaffe/kaffe/kaffevm/Makefile.in	Fri Feb 22 07:00:52 2008
@@ -125,7 +125,8 @@
 	libkaffevm_la-java_lang_String.lo libkaffevm_la-System.lo \
 	libkaffevm_la-java_lang_Thread.lo libkaffevm_la-Throwable.lo \
 	libkaffevm_la-gnu_classpath_VMStackWalker.lo \
-	libkaffevm_la-gnu_classpath_VMSystemProperties.lo
+	libkaffevm_la-gnu_classpath_VMSystemProperties.lo \
+	libkaffevm_la-Unsafe.lo
 libkaffevm_la_OBJECTS = $(am_libkaffevm_la_OBJECTS)
 libkaffevm_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libkaffevm_la_CFLAGS) \
@@ -202,6 +203,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
@@ -374,7 +377,8 @@
 	-I$(top_srcdir)/kaffe/kaffevm/verifier \
 	-I$(top_srcdir)/kaffe/kaffevm/jni \
         -I$(top_srcdir)/config/$(Khost_cpu) \
-	-I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) 
+	-I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) \
+	$(GLIB_CFLAGS)
 
 native_LTLIBRARIES = libkaffevm.la libkaffe.la
 @HAVE_GCJ_SUPPORT_FALSE at libgcj = #
@@ -405,7 +409,8 @@
 	$(libkaffe_la_DEPENDENCIES) \
 	$(VM_LIBS) \
 	$(M_LIBS) \
-	$(ZZIP_LIBS)
+	$(ZZIP_LIBS) \
+	$(GLIB_LIBS)
 
 libkaffevm_la_CFLAGS = \
 	$(AM_CFLAGS) \
@@ -543,7 +548,8 @@
         $(top_srcdir)/libraries/clib/native/java_lang_Thread.c \
         $(top_srcdir)/libraries/clib/native/Throwable.c \
 	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMStackWalker.c \
-	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c 
+	$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c \
+	$(top_srcdir)/libraries/clib/native/Unsafe.c
 
 CLEANFILES = so_locations
 all: all-recursive
@@ -678,6 +684,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Runtime.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-System.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Throwable.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-Unsafe.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-VMRuntime.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-gnu_classpath_VMStackWalker.Plo at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/libkaffevm_la-gnu_classpath_VMSystemProperties.Plo at am__quote@
@@ -1182,6 +1189,13 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c' object='libkaffevm_la-gnu_classpath_VMSystemProperties.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-gnu_classpath_VMSystemProperties.lo `test -f '$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/gnu_classpath_VMSystemProperties.c
+
+libkaffevm_la-Unsafe.lo: $(top_srcdir)/libraries/clib/native/Unsafe.c
+ at am__fastdepCC_TRUE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -MT libkaffevm_la-Unsafe.lo -MD -MP -MF $(DEPDIR)/libkaffevm_la-Unsafe.Tpo -c -o libkaffevm_la-Unsafe.lo `test -f '$(top_srcdir)/libraries/clib/native/Unsafe.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/Unsafe.c
+ at am__fastdepCC_TRUE@	mv -f $(DEPDIR)/libkaffevm_la-Unsafe.Tpo $(DEPDIR)/libkaffevm_la-Unsafe.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$(top_srcdir)/libraries/clib/native/Unsafe.c' object='libkaffevm_la-Unsafe.lo' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libkaffevm_la_CFLAGS) $(CFLAGS) -c -o libkaffevm_la-Unsafe.lo `test -f '$(top_srcdir)/libraries/clib/native/Unsafe.c' || echo '$(srcdir)/'`$(top_srcdir)/libraries/clib/native/Unsafe.c
 
 mostlyclean-libtool:
 	-rm -f *.lo
Index: kaffe/kaffe/kaffevm/support.c
diff -u kaffe/kaffe/kaffevm/support.c:1.93 kaffe/kaffe/kaffevm/support.c:1.94
--- kaffe/kaffe/kaffevm/support.c:1.93	Sat Apr 22 01:53:41 2006
+++ kaffe/kaffe/kaffevm/support.c	Fri Feb 22 07:00:53 2008
@@ -43,6 +43,7 @@
 #include "methodcalls.h"
 #include "native.h"
 #include "jni_i.h"
+#include "soft.h"
 
 #if !defined(HAVE_GETTIMEOFDAY)
 #include <sys/timeb.h>
@@ -647,4 +648,43 @@
 			retval++;
 	}
 	return( retval );
+}
+
+/** 
+ * Return a pointer to a field.
+ * 
+ * @param declaring_class class declaring the field
+ * @param instance        object contaning the field
+ * @param slot            index of the field in the fields array
+ */
+volatile void * 
+KaffeVM_GetFieldAddress(jclass declaring_class, jobject instance, jlong slot) {
+        Field* fld;
+	Hjava_lang_Class * clazz = (Hjava_lang_Class *) declaring_class;
+
+	/* Get the declaring class' field descriptor located at the given slot */
+        fld = CLASS_FIELDS(clazz) + slot;
+
+	/* If the field is static, complete return its address */
+        if (slot < CLASS_NSFIELDS(clazz)) {
+		errorInfo einfo;
+		/* If the instanca type is not completely initialized, 
+		   initialize it now. */
+		if (!processClass(clazz, CSTATE_COMPLETE, &einfo)) {
+			throwError(&einfo);
+		}
+
+                return FIELD_ADDRESS(fld);
+        }
+        else {
+	  /* If the field is not static, compute its address based on the location
+	     of the instance, and return it. */
+                if (instance == NULL) {
+                        SignalError("java.lang.NullPointerException", "");
+                }
+                if  (!soft_instanceof(declaring_class, instance)) {
+                        SignalError("java.lang.IllegalArgumentException","");
+                }
+                return (void*)(((char*)(instance)) + FIELD_BOFFSET(fld));
+        }
 }
Index: kaffe/kaffe/kaffevm/support.h
diff -u kaffe/kaffe/kaffevm/support.h:1.46 kaffe/kaffe/kaffevm/support.h:1.47
--- kaffe/kaffe/kaffevm/support.h:1.46	Tue Apr 18 10:06:38 2006
+++ kaffe/kaffe/kaffevm/support.h	Fri Feb 22 07:00:54 2008
@@ -138,6 +138,7 @@
 extern Method*	lookupClassMethod(struct Hjava_lang_Class*, const char*, const char*, bool, struct _errorInfo*);
 extern Method*	lookupObjectMethod(struct Hjava_lang_Object*, const char*, const char*, struct _errorInfo*);
 extern Field*   KNI_lookupFieldC(struct Hjava_lang_Class*, const char*, bool, struct _errorInfo*);
+extern volatile void * KaffeVM_GetFieldAddress(jclass declaring_class, jobject instance, jlong slot); 
 
 struct _strconst;
 extern void SignalError(const char *, const char *);
Index: kaffe/kaffe/kaffevm/boehm-gc/Makefile.in
diff -u kaffe/kaffe/kaffevm/boehm-gc/Makefile.in:1.97 kaffe/kaffe/kaffevm/boehm-gc/Makefile.in:1.98
--- kaffe/kaffe/kaffevm/boehm-gc/Makefile.in:1.97	Sat Feb  2 15:58:18 2008
+++ kaffe/kaffe/kaffevm/boehm-gc/Makefile.in	Fri Feb 22 07:00:54 2008
@@ -136,6 +136,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/kaffe/kaffevm/gcj/Makefile.in
diff -u kaffe/kaffe/kaffevm/gcj/Makefile.in:1.186 kaffe/kaffe/kaffevm/gcj/Makefile.in:1.187
--- kaffe/kaffe/kaffevm/gcj/Makefile.in:1.186	Sat Feb  2 15:58:18 2008
+++ kaffe/kaffe/kaffevm/gcj/Makefile.in	Fri Feb 22 07:00:54 2008
@@ -144,6 +144,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/kaffe/kaffevm/intrp/Makefile.in
diff -u kaffe/kaffe/kaffevm/intrp/Makefile.in:1.195 kaffe/kaffe/kaffevm/intrp/Makefile.in:1.196
--- kaffe/kaffe/kaffevm/intrp/Makefile.in:1.195	Sat Feb  2 15:58:19 2008
+++ kaffe/kaffe/kaffevm/intrp/Makefile.in	Fri Feb 22 07:00:55 2008
@@ -137,6 +137,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/kaffe/kaffevm/jit/Makefile.am
diff -u kaffe/kaffe/kaffevm/jit/Makefile.am:1.26 kaffe/kaffe/kaffevm/jit/Makefile.am:1.27
--- kaffe/kaffe/kaffevm/jit/Makefile.am:1.26	Thu Jul 13 20:23:11 2006
+++ kaffe/kaffe/kaffevm/jit/Makefile.am	Fri Feb 22 07:00:55 2008
@@ -18,7 +18,8 @@
               -I$(top_srcdir)/kaffe/jvmpi \
 	      -I$(top_builddir)/include \
               -I$(top_srcdir)/config/$(Khost_cpu) \
-	      -I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) 
+	      -I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) \
+	      $(GLIB_CFLAGS)
 
 AM_CCASFLAGS = \
 	$(DEFS) \
@@ -31,7 +32,8 @@
 noinst_LTLIBRARIES = libengine.la
 
 libengine_la_LDFLAGS = \
-	$(KVMLIBFLAGS)
+	$(KVMLIBFLAGS) \
+	$(GLIB_LIBS)
 
 libengine_la_SOURCES = \
 	basecode.c \
Index: kaffe/kaffe/kaffevm/jit/Makefile.in
diff -u kaffe/kaffe/kaffevm/jit/Makefile.in:1.205 kaffe/kaffe/kaffevm/jit/Makefile.in:1.206
--- kaffe/kaffe/kaffevm/jit/Makefile.in:1.205	Sat Feb  2 15:58:20 2008
+++ kaffe/kaffe/kaffevm/jit/Makefile.in	Fri Feb 22 07:00:55 2008
@@ -145,6 +145,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
@@ -307,7 +309,8 @@
               -I$(top_srcdir)/kaffe/jvmpi \
 	      -I$(top_builddir)/include \
               -I$(top_srcdir)/config/$(Khost_cpu) \
-	      -I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) 
+	      -I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) \
+	      $(GLIB_CFLAGS)
 
 AM_CCASFLAGS = \
 	$(DEFS) \
@@ -319,7 +322,8 @@
 
 noinst_LTLIBRARIES = libengine.la
 libengine_la_LDFLAGS = \
-	$(KVMLIBFLAGS)
+	$(KVMLIBFLAGS) \
+	$(GLIB_LIBS)
 
 libengine_la_SOURCES = \
 	basecode.c \
Index: kaffe/kaffe/kaffevm/jit/methodcalls.c
diff -u kaffe/kaffe/kaffevm/jit/methodcalls.c:1.15 kaffe/kaffe/kaffevm/jit/methodcalls.c:1.16
--- kaffe/kaffe/kaffevm/jit/methodcalls.c:1.15	Sat Jan 19 15:13:41 2008
+++ kaffe/kaffe/kaffevm/jit/methodcalls.c	Fri Feb 22 07:00:56 2008
@@ -12,6 +12,8 @@
  * of this file. 
  */
 #include "config.h"
+#include <glib.h>
+
 #if defined(HAVE_LIBFFI)
 #include "sysdepCallMethod-ffi.h"
 #else
@@ -34,6 +36,7 @@
 	Method* meth;
 	void **where;
 	void *tramp;
+	void *nativeCode;
 	errorInfo info;
 
 	/* FIXUP_TRAMPOLINE_INIT sets tramp and where */
@@ -64,28 +67,16 @@
 	 * while we were translating the method, so we have to make this
 	 * atomic.
 	 */
-#if defined(COMPARE_AND_EXCHANGE)
-	if (COMPARE_AND_EXCHANGE(where, tramp, METHOD_NATIVECODE(meth))) {
-		;
-	}
-#elif defined(ATOMIC_EXCHANGE)
-	{
-		void *tmp = METHOD_NATIVECODE(meth);
-
-		ATOMIC_EXCHANGE(where, tmp);
-	}
-#else
-#error "You have to define either COMPARE_AND_EXCHANGE or ATOMIC_EXCHANGE"
-#endif
+	nativeCode = METHOD_NATIVECODE(meth);
+	g_atomic_pointer_compare_and_exchange(where, tramp, nativeCode);
 
-TDBG(	dprintf("Calling %s:%s%s @ %p\n", meth->class->name->data, meth->name->data, METHOD_SIGD(meth), METHOD_NATIVECODE(meth));	)
+TDBG(	dprintf("Calling %s:%s%s @ %p\n", meth->class->name->data, meth->name->data, METHOD_SIGD(meth), nativeCode);	)
 
 DBG(MOREJIT,
-	dprintf("soft_fixup_trampoline(): return %p\n",
-		METHOD_NATIVECODE(meth));
+	dprintf("soft_fixup_trampoline(): return %p\n", nativeCode);
     );
 
-	return (METHOD_NATIVECODE(meth));
+	return nativeCode;
 }
 
 /*
Index: kaffe/kaffe/kaffevm/jit3/Makefile.am
diff -u kaffe/kaffe/kaffevm/jit3/Makefile.am:1.20 kaffe/kaffe/kaffevm/jit3/Makefile.am:1.21
--- kaffe/kaffe/kaffevm/jit3/Makefile.am:1.20	Thu Jul 13 20:23:13 2006
+++ kaffe/kaffe/kaffevm/jit3/Makefile.am	Fri Feb 22 07:00:56 2008
@@ -19,7 +19,8 @@
 	-I$(top_srcdir)/kaffe/jvmpi \
 	-I$(top_builddir)/include \
 	-I$(top_srcdir)/config/$(Khost_cpu) \
-	-I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) 
+	-I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) \
+	$(GLIB_CFLAGS)
 
 
 AM_CCASFLAGS = \
@@ -33,7 +34,8 @@
 noinst_LTLIBRARIES = libengine.la
 
 libengine_la_LDFLAGS = \
-	$(KVMLIBFLAGS)
+	$(KVMLIBFLAGS) \
+	$(GLIB_LIBS)
 
 libengine_la_SOURCES = \
 	basecode.c \
Index: kaffe/kaffe/kaffevm/jit3/Makefile.in
diff -u kaffe/kaffe/kaffevm/jit3/Makefile.in:1.175 kaffe/kaffe/kaffevm/jit3/Makefile.in:1.176
--- kaffe/kaffe/kaffevm/jit3/Makefile.in:1.175	Sat Feb  2 15:58:20 2008
+++ kaffe/kaffe/kaffevm/jit3/Makefile.in	Fri Feb 22 07:00:56 2008
@@ -145,6 +145,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
@@ -308,7 +310,8 @@
 	-I$(top_srcdir)/kaffe/jvmpi \
 	-I$(top_builddir)/include \
 	-I$(top_srcdir)/config/$(Khost_cpu) \
-	-I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) 
+	-I$(top_srcdir)/config/$(Khost_cpu)/$(Khost_os) \
+	$(GLIB_CFLAGS)
 
 AM_CCASFLAGS = \
 	$(DEFS) \
@@ -320,7 +323,8 @@
 
 noinst_LTLIBRARIES = libengine.la
 libengine_la_LDFLAGS = \
-	$(KVMLIBFLAGS)
+	$(KVMLIBFLAGS) \
+	$(GLIB_LIBS)
 
 libengine_la_SOURCES = \
 	basecode.c \
Index: kaffe/kaffe/kaffevm/kaffe-gc/Makefile.in
diff -u kaffe/kaffe/kaffevm/kaffe-gc/Makefile.in:1.95 kaffe/kaffe/kaffevm/kaffe-gc/Makefile.in:1.96
--- kaffe/kaffe/kaffevm/kaffe-gc/Makefile.in:1.95	Sat Feb  2 15:58:21 2008
+++ kaffe/kaffe/kaffevm/kaffe-gc/Makefile.in	Fri Feb 22 07:00:56 2008
@@ -137,6 +137,8 @@
 FFLAGS = @FFLAGS@
 GC_NAME = @GC_NAME@
 GLIBJ_ZIP = @GLIBJ_ZIP@
+GLIB_CFLAGS = @GLIB_CFLAGS@
+GLIB_LIBS = @GLIB_LIBS@
 GMSGFMT = @GMSGFMT@
 GREP = @GREP@
 INSTALL = @INSTALL@
Index: kaffe/kaffe/kaffevm/systems/Makefile.in
diff -u kaffe/kaffe/kaffevm/systems/Makefile.in:1.195 kaffe/kaffe/kaffevm/systems/Makefile.in:1.196
--- kaffe/kaffe/kaffevm/systems/Makefile.in:1.195	Sat Feb  2 15:58:22 2008
+++ kaffe/kaffe/kaffevm/systems/Makefile.in	Fri Feb 22 07:00:58 2008
@@ -126,6 +126,8 @@

*** Patch too long, truncated ***




More information about the kaffe mailing list