diff options
author | Sebastian Pop <sebastian.pop@inria.fr> | 2007-04-10 23:09:48 +0000 |
---|---|---|
committer | Sebastian Pop <sebastian.pop@inria.fr> | 2007-04-10 23:09:48 +0000 |
commit | 6028e8da2faa25cae8293dd77e861d405f6d18b7 (patch) | |
tree | f8534d6c6e76e829d3e35e56b153ff7d032c5dde /boehm-gc | |
parent | 1854a410f77964221a98b408322e2bc28c21c507 (diff) |
* Merge from mainline (r120733:123693).
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/graphite@123703 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc')
-rw-r--r-- | boehm-gc/ChangeLog | 70 | ||||
-rw-r--r-- | boehm-gc/Makefile.am | 5 | ||||
-rw-r--r-- | boehm-gc/Makefile.in | 6 | ||||
-rw-r--r-- | boehm-gc/aclocal.m4 | 59 | ||||
-rwxr-xr-x | boehm-gc/configure | 36 | ||||
-rw-r--r-- | boehm-gc/configure.ac | 18 | ||||
-rw-r--r-- | boehm-gc/darwin_stop_world.c | 13 | ||||
-rw-r--r-- | boehm-gc/dbg_mlc.c | 41 | ||||
-rw-r--r-- | boehm-gc/finalize.c | 63 | ||||
-rw-r--r-- | boehm-gc/include/Makefile.in | 1 | ||||
-rw-r--r-- | boehm-gc/include/gc.h | 18 | ||||
-rw-r--r-- | boehm-gc/include/gc_config.h.in | 24 | ||||
-rw-r--r-- | boehm-gc/include/private/gc_priv.h | 18 | ||||
-rw-r--r-- | boehm-gc/include/private/gcconfig.h | 8 | ||||
-rw-r--r-- | boehm-gc/os_dep.c | 12 | ||||
-rw-r--r-- | boehm-gc/pthread_stop_world.c | 2 |
16 files changed, 256 insertions, 138 deletions
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog index 9fd2d4bd23f8..aad88393f8ad 100644 --- a/boehm-gc/ChangeLog +++ b/boehm-gc/ChangeLog @@ -1,3 +1,73 @@ +2007-04-03 Jakub Jelinek <jakub@redhat.com> + + * configure.ac (NO_EXECUTE_PERMISSION): Set by default. + * configure: Rebuilt. + +2007-03-07 Alexandre Oliva <aoliva@redhat.com> + + * include/gc.h (GC_REGISTER_FINALIZER_UNREACHABLE): New. + (GC_register_finalizer_unreachable): Declare. + (GC_debug_register_finalizer_unreachable): Declare. + * finalize.c (GC_unreachable_finalize_mark_proc): New. + (GC_register_finalizer_unreachable): New. + (GC_finalize): Handle it. + * dbg_mlc.c (GC_debug_register_finalizer_unreachable): New. + (GC_debug_register_finalizer_no_order): Fix whitespace. + +2007-03-01 Brooks Moses <brooks.moses@codesourcery.com> + + * Makefile.am: Add dummy install-pdf target. + * Makefile.in: Regenerate + +2007-02-05 Roman Zippel <zippel@linux-m68k.org> + + * boehm-gc/include/private/gcconfig.h: use LINUX_STACKBOTTOM so + it works with Linux 2.6, reactivate MPROTECT_VDB + * boehm-gc/pthread_stop_world.c: save all register + on signal entry + +2007-01-24 Andreas Tobler <a.tobler@schweiz.org> + + * os_dep.c (defined(MPROTECT_VDB) && defined(DARWIN)): Moved recently + added defines to include/private/gc_priv.h + (catch_exception_raise): Added THREAD_FLD in exc_state for POWERPC too. + * darwin_stop_world.c: Removed the above defines. + * include/private/gc_priv.h: Moved definitions from darwin_stop_world.c + and os_dep.c to here. Fixed THREAD definition fixes for ppc64. + +2007-01-17 David Daney <ddaney@avtrex.com> + + * configure.ac: Don't define NO_SIGSET and NO_DEBUGGING while + cross-compiling. + * configure: Regenerated. + * include/gc_config.h.in: Regenerated. + +2007-01-17 Mike Stump <mrs@apple.com> + + * os_dep.c: Fix i686-apple-darwin9 builds. + +2007-01-16 Jack Howarth <howarth@bromo.med.uc.edu> + + * aclocal.m4: Regenerate to use multi.m4. + * configure: Regenerate. + * Makefile.in: Regenerate. + +2007-01-17 Andreas Tobler <a.tobler@schweiz.org> + + * include/gc_config.h.in: Regenerate. + +2007-01-16 Petr Salinger <Petr.Salinger@seznam.cz> + + * include/private/gcconfig.h: Handle amd64/x86-64 cpu under + GNU/kFreeBSD. + * os_dep.c: Likewise. + +2007-01-15 Andreas Tobler <a.tobler@schweiz.org> + + * os_dep.c (defined(MPROTECT_VDB) && defined(DARWIN)): Adjust mail + reference. + (catch_exception_raise): Fix typo in the I386 exc_state. + 2007-01-11 Andreas Tobler <a.tobler@schweiz.org> * configure.ac: Replaced HAS_I386_THREAD_STATE_* with diff --git a/boehm-gc/Makefile.am b/boehm-gc/Makefile.am index 66d5cb16afb0..c31d67aad50a 100644 --- a/boehm-gc/Makefile.am +++ b/boehm-gc/Makefile.am @@ -111,7 +111,8 @@ CONFIG_STATUS_DEPENDENCIES = $(srcdir)/configure.host MAKEOVERRIDES= -# No install-html support yet -.PHONY: install-html +# No install-html or install-pdf support in automake yet +.PHONY: install-html install-pdf install-html: +install-pdf: diff --git a/boehm-gc/Makefile.in b/boehm-gc/Makefile.in index 05c3972a7b6f..8467d2ea0ce2 100644 --- a/boehm-gc/Makefile.in +++ b/boehm-gc/Makefile.in @@ -70,6 +70,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ @@ -763,9 +764,10 @@ uninstall-info: uninstall-info-recursive .S.lo: $(LTCOMPILE) -Wp,-P -x assembler-with-cpp -c $< -# No install-html support yet -.PHONY: install-html +# No install-html or install-pdf support in automake yet +.PHONY: install-html install-pdf install-html: +install-pdf: # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/boehm-gc/aclocal.m4 b/boehm-gc/aclocal.m4 index c4f94668cd76..332ae52aa2d8 100644 --- a/boehm-gc/aclocal.m4 +++ b/boehm-gc/aclocal.m4 @@ -675,64 +675,6 @@ else fi AC_SUBST([mkdir_p])]) -# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) -# --------------------------------------------------- -# Add --enable-multilib to configure. -AC_DEFUN([AM_ENABLE_MULTILIB], -[# Default to --enable-multilib -AC_ARG_ENABLE(multilib, -[ --enable-multilib build many library versions (default)], -[case "$enableval" in - yes) multilib=yes ;; - no) multilib=no ;; - *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;; - esac], - [multilib=yes]) - -# We may get other options which we leave undocumented: -# --with-target-subdir, --with-multisrctop, --with-multisubdir -# See config-ml.in if you want the gory details. - -if test "$srcdir" = "."; then - if test "$with_target_subdir" != "."; then - multi_basedir="$srcdir/$with_multisrctop../$2" - else - multi_basedir="$srcdir/$with_multisrctop$2" - fi -else - multi_basedir="$srcdir/$2" -fi -AC_SUBST(multi_basedir) - -AC_OUTPUT_COMMANDS([ -# Only add multilib support code if we just rebuilt the top-level -# Makefile. -case " $CONFIG_FILES " in - *" ]m4_default([$1],Makefile)[ "*) - ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in - ;; -esac], - [ -srcdir="$srcdir" -host="$host" -target="$target" -with_multisubdir="$with_multisubdir" -with_multisrctop="$with_multisrctop" -with_target_subdir="$with_target_subdir" -ac_configure_args="${multilib_arg} ${ac_configure_args}" -multi_basedir="$multi_basedir" -CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -CC="$CC"])])dnl - # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. @@ -945,5 +887,6 @@ AC_SUBST([am__untar]) m4_include([../config/acx.m4]) m4_include([../config/depstand.m4]) m4_include([../config/lead-dot.m4]) +m4_include([../config/multi.m4]) m4_include([../config/no-executables.m4]) m4_include([../libtool.m4]) diff --git a/boehm-gc/configure b/boehm-gc/configure index bf08621dd981..c13c8ec89c4c 100755 --- a/boehm-gc/configure +++ b/boehm-gc/configure @@ -1351,6 +1351,13 @@ else fi +# Even if the default multilib is not a cross compilation, +# it may be that some of the other multilibs are. +if test $cross_compiling = no && test $multilib = yes \ + && test "x${with_multisubdir}" != x ; then + cross_compiling=maybe +fi + ac_config_commands="$ac_config_commands default-1" @@ -4773,7 +4780,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4776 "configure"' > conftest.$ac_ext + echo '#line 4783 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6819,11 +6826,9 @@ LIBS="$oldLIBS" # Configuration of machine-dependent code # -# We don't set NO_EXECUTE_PERMISSION by default because gcj (and -# anything else that creates trampolines in gc-allocated memory) -# always needs exec permission. The exceptions to this are IA-64 and -# some variations of Power PC, where trampolines don't contain -# executable code. +# Set NO_EXECUTE_PERMISSION by default because gcj already uses +# ffi_closure_{alloc,free} which takes care of allocating trampolines +# in executable memory. # echo "$as_me:$LINENO: checking which machine-dependent code should be used" >&5 echo $ECHO_N "checking which machine-dependent code should be used... $ECHO_C" >&6 @@ -6884,14 +6889,14 @@ _ACEOF machdep="sparc_mach_dep.lo" ;; ia64-*-*) + machdep="mach_dep.lo ia64_save_regs_in_stack.lo" + ;; +esac cat >>confdefs.h <<\_ACEOF #define NO_EXECUTE_PERMISSION 1 _ACEOF - machdep="mach_dep.lo ia64_save_regs_in_stack.lo" - ;; -esac if test x"$machdep" = x; then echo "$as_me:$LINENO: result: $machdep" >&5 echo "${ECHO_T}$machdep" >&6 @@ -7617,19 +7622,6 @@ cat >>confdefs.h <<\_ACEOF _ACEOF -if test -n "${with_cross_host}"; then - -cat >>confdefs.h <<\_ACEOF -#define NO_SIGSET 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define NO_DEBUGGING 1 -_ACEOF - -fi - # Check whether --enable-gc-debug or --disable-gc-debug was given. if test "${enable_gc_debug+set}" = set; then enableval="$enable_gc_debug" diff --git a/boehm-gc/configure.ac b/boehm-gc/configure.ac index 2beaa1c188b5..d4dd16b9e06f 100644 --- a/boehm-gc/configure.ac +++ b/boehm-gc/configure.ac @@ -364,11 +364,9 @@ LIBS="$oldLIBS" # Configuration of machine-dependent code # -# We don't set NO_EXECUTE_PERMISSION by default because gcj (and -# anything else that creates trampolines in gc-allocated memory) -# always needs exec permission. The exceptions to this are IA-64 and -# some variations of Power PC, where trampolines don't contain -# executable code. +# Set NO_EXECUTE_PERMISSION by default because gcj already uses +# ffi_closure_{alloc,free} which takes care of allocating trampolines +# in executable memory. # AC_MSG_CHECKING(which machine-dependent code should be used) machdep= @@ -411,10 +409,10 @@ case "$host" in machdep="sparc_mach_dep.lo" ;; ia64-*-*) - AC_DEFINE(NO_EXECUTE_PERMISSION,1,[cause some or all of the heap to not have execute permission]) machdep="mach_dep.lo ia64_save_regs_in_stack.lo" ;; esac +AC_DEFINE(NO_EXECUTE_PERMISSION,1,[cause some or all of the heap to not have execute permission]) if test x"$machdep" = x; then AC_MSG_RESULT($machdep) machdep="mach_dep.lo" @@ -488,14 +486,6 @@ AC_DEFINE(JAVA_FINALIZATION,1,[make it somewhat safer to finalize objects out of AC_DEFINE(GC_GCJ_SUPPORT,1,[include support for gcj]) AC_DEFINE(ATOMIC_UNCOLLECTABLE,1,[include code for GC_malloc_atomic_uncollectable]) -dnl This is something of a hack. When cross-compiling we turn off -dnl some functionality. These is only correct when targetting an -dnl embedded system. FIXME. -if test -n "${with_cross_host}"; then - AC_DEFINE(NO_SIGSET,1,[use empty GC_disable_signals and GC_enable_signals]) - AC_DEFINE(NO_DEBUGGING,1,[removes GC_dump]) -fi - AC_ARG_ENABLE(gc-debug, [ --enable-gc-debug include full support for pointer backtracing etc.], [ if test "$enable_gc_debug" = "yes"; then diff --git a/boehm-gc/darwin_stop_world.c b/boehm-gc/darwin_stop_world.c index 5ddb271646ee..719b1b02d35e 100644 --- a/boehm-gc/darwin_stop_world.c +++ b/boehm-gc/darwin_stop_world.c @@ -20,19 +20,6 @@ # define PPC_RED_ZONE_SIZE 320 #endif -/* Try to work out the right way to access thread state structure members. - The structure has changed its definition in different Darwin versions. */ -/* This now defaults to the (older) names without __, thus hopefully */ -/* not breaking any existing Makefile.direct builds. */ -#if defined (HAS_PPC_THREAD_STATE___R0) || \ - defined (HAS_PPC_THREAD_STATE64___R0) || \ - defined (HAS_X86_THREAD_STATE32___EAX) || \ - defined (HAS_X86_THREAD_STATE64___RAX) -# define THREAD_FLD(x) __ ## x -#else -# define THREAD_FLD(x) x -#endif - typedef struct StackFrame { unsigned long savedSP; unsigned long savedCR; diff --git a/boehm-gc/dbg_mlc.c b/boehm-gc/dbg_mlc.c index aacbb7a1b632..061a6a537b76 100644 --- a/boehm-gc/dbg_mlc.c +++ b/boehm-gc/dbg_mlc.c @@ -3,6 +3,7 @@ * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. * Copyright (c) 1997 by Silicon Graphics. All rights reserved. * Copyright (c) 1999-2004 Hewlett-Packard Development Company, L.P. + * Copyright (C) 2007 Free Software Foundation, Inc * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. @@ -1118,8 +1119,8 @@ GC_PTR *ocd; if (0 == base) return; if ((ptr_t)obj - base != sizeof(oh)) { GC_err_printf1( - "GC_debug_register_finalizer_no_order called with non-base-pointer 0x%lx\n", - obj); + "GC_debug_register_finalizer_no_order called with non-base-pointer 0x%lx\n", + obj); } if (0 == fn) { GC_register_finalizer_no_order(base, 0, 0, &my_old_fn, &my_old_cd); @@ -1129,7 +1130,41 @@ GC_PTR *ocd; &my_old_cd); } store_old(obj, my_old_fn, (struct closure *)my_old_cd, ofn, ocd); - } +} + +# ifdef __STDC__ + void GC_debug_register_finalizer_unreachable + (GC_PTR obj, GC_finalization_proc fn, + GC_PTR cd, GC_finalization_proc *ofn, + GC_PTR *ocd) +# else + void GC_debug_register_finalizer_unreachable + (obj, fn, cd, ofn, ocd) + GC_PTR obj; + GC_finalization_proc fn; + GC_PTR cd; + GC_finalization_proc *ofn; + GC_PTR *ocd; +# endif +{ + GC_finalization_proc my_old_fn; + GC_PTR my_old_cd; + ptr_t base = GC_base(obj); + if (0 == base) return; + if ((ptr_t)obj - base != sizeof(oh)) { + GC_err_printf1( + "GC_debug_register_finalizer_unreachable called with non-base-pointer 0x%lx\n", + obj); + } + if (0 == fn) { + GC_register_finalizer_unreachable(base, 0, 0, &my_old_fn, &my_old_cd); + } else { + GC_register_finalizer_unreachable(base, GC_debug_invoke_finalizer, + GC_make_closure(fn,cd), &my_old_fn, + &my_old_cd); + } + store_old(obj, my_old_fn, (struct closure *)my_old_cd, ofn, ocd); +} # ifdef __STDC__ void GC_debug_register_finalizer_ignore_self diff --git a/boehm-gc/finalize.c b/boehm-gc/finalize.c index 893f825976f6..484d421d1d68 100644 --- a/boehm-gc/finalize.c +++ b/boehm-gc/finalize.c @@ -2,6 +2,7 @@ * Copyright 1988, 1989 Hans-J. Boehm, Alan J. Demers * Copyright (c) 1991-1996 by Xerox Corporation. All rights reserved. * Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved. + * Copyright (C) 2007 Free Software Foundation, Inc * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. @@ -315,6 +316,14 @@ ptr_t p; { } +/* Possible finalization_marker procedures. Note that mark stack */ +/* overflow is handled by the caller, and is not a disaster. */ +GC_API void GC_unreachable_finalize_mark_proc(p) +ptr_t p; +{ + return GC_normal_finalize_mark_proc(p); +} + /* Register a finalization function. See gc.h for details. */ @@ -511,6 +520,23 @@ finalization_mark_proc * mp; ocd, GC_null_finalize_mark_proc); } +# if defined(__STDC__) + void GC_register_finalizer_unreachable(void * obj, + GC_finalization_proc fn, void * cd, + GC_finalization_proc *ofn, void ** ocd) +# else + void GC_register_finalizer_unreachable(obj, fn, cd, ofn, ocd) + GC_PTR obj; + GC_finalization_proc fn; + GC_PTR cd; + GC_finalization_proc * ofn; + GC_PTR * ocd; +# endif +{ + GC_register_finalizer_inner(obj, fn, cd, ofn, + ocd, GC_unreachable_finalize_mark_proc); +} + #ifndef NO_DEBUGGING void GC_dump_finalization() { @@ -638,9 +664,44 @@ void GC_finalize() if (curr_fo -> fo_mark_proc == GC_null_finalize_mark_proc) { GC_MARK_FO(real_ptr, GC_normal_finalize_mark_proc); } - GC_set_mark_bit(real_ptr); + if (curr_fo -> fo_mark_proc != GC_unreachable_finalize_mark_proc) { + GC_set_mark_bit(real_ptr); + } } } + + /* now revive finalize-when-unreachable objects reachable from + other finalizable objects */ + curr_fo = GC_finalize_now; + prev_fo = 0; + while (curr_fo != 0) { + next_fo = fo_next(curr_fo); + if (curr_fo -> fo_mark_proc == GC_unreachable_finalize_mark_proc) { + real_ptr = (ptr_t)curr_fo -> fo_hidden_base; + if (!GC_is_marked(real_ptr)) { + GC_set_mark_bit(real_ptr); + } else { + if (prev_fo == 0) + GC_finalize_now = next_fo; + else + fo_set_next(prev_fo, next_fo); + + curr_fo -> fo_hidden_base = + (word) HIDE_POINTER(curr_fo -> fo_hidden_base); + GC_words_finalized -= + ALIGNED_WORDS(curr_fo -> fo_object_size) + + ALIGNED_WORDS(sizeof(struct finalizable_object)); + + i = HASH2(real_ptr, log_fo_table_size); + fo_set_next (curr_fo, fo_head[i]); + GC_fo_entries++; + fo_head[i] = curr_fo; + curr_fo = prev_fo; + } + } + prev_fo = curr_fo; + curr_fo = next_fo; + } } /* Remove dangling disappearing links. */ diff --git a/boehm-gc/include/Makefile.in b/boehm-gc/include/Makefile.in index 13d6bb69934d..a60571d1f954 100644 --- a/boehm-gc/include/Makefile.in +++ b/boehm-gc/include/Makefile.in @@ -45,6 +45,7 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/depstand.m4 \ $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/no-executables.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h index 52ee8056ec41..c6c553d84275 100644 --- a/boehm-gc/include/gc.h +++ b/boehm-gc/include/gc.h @@ -3,6 +3,7 @@ * Copyright (c) 1991-1995 by Xerox Corporation. All rights reserved. * Copyright 1996-1999 by Silicon Graphics. All rights reserved. * Copyright 1999 by Hewlett-Packard Company. All rights reserved. + * Copyright (C) 2007 Free Software Foundation, Inc * * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED * OR IMPLIED. ANY USE IS AT YOUR OWN RISK. @@ -602,6 +603,8 @@ GC_API GC_PTR GC_debug_realloc_replacement GC_debug_register_finalizer_ignore_self(p, f, d, of, od) # define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \ GC_debug_register_finalizer_no_order(p, f, d, of, od) +# define GC_REGISTER_FINALIZER_UNREACHABLE(p, f, d, of, od) \ + GC_debug_register_finalizer_unreachable(p, f, d, of, od) # define GC_MALLOC_STUBBORN(sz) GC_debug_malloc_stubborn(sz, GC_EXTRAS); # define GC_CHANGE_STUBBORN(p) GC_debug_change_stubborn(p) # define GC_END_STUBBORN_CHANGE(p) GC_debug_end_stubborn_change(p) @@ -624,6 +627,8 @@ GC_API GC_PTR GC_debug_realloc_replacement GC_register_finalizer_ignore_self(p, f, d, of, od) # define GC_REGISTER_FINALIZER_NO_ORDER(p, f, d, of, od) \ GC_register_finalizer_no_order(p, f, d, of, od) +# define GC_REGISTER_FINALIZER_UNREACHABLE(p, f, d, of, od) \ + GC_register_finalizer_unreachable(p, f, d, of, od) # define GC_MALLOC_STUBBORN(sz) GC_malloc_stubborn(sz) # define GC_CHANGE_STUBBORN(p) GC_change_stubborn(p) # define GC_END_STUBBORN_CHANGE(p) GC_end_stubborn_change(p) @@ -716,6 +721,19 @@ GC_API void GC_debug_register_finalizer_no_order GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, GC_finalization_proc *ofn, GC_PTR *ocd)); +/* This is a special finalizer that is useful when an object's */ +/* finalizer must be run when the object is known to be no */ +/* longer reachable, not even from other finalizable objects. */ +/* This can be used in combination with finalizer_no_order so */ +/* as to release resources that must not be released while an */ +/* object can still be brought back to life by other */ +/* finalizers. */ +GC_API void GC_register_finalizer_unreachable + GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, + GC_finalization_proc *ofn, GC_PTR *ocd)); +GC_API void GC_debug_register_finalizer_unreachable + GC_PROTO((GC_PTR obj, GC_finalization_proc fn, GC_PTR cd, + GC_finalization_proc *ofn, GC_PTR *ocd)); /* The following routine may be used to break cycles between */ /* finalizable objects, thus causing cyclic finalizable */ diff --git a/boehm-gc/include/gc_config.h.in b/boehm-gc/include/gc_config.h.in index 41028c14eb16..b754e33a6d17 100644 --- a/boehm-gc/include/gc_config.h.in +++ b/boehm-gc/include/gc_config.h.in @@ -54,12 +54,6 @@ /* support for win32 threads */ #undef GC_WIN32_THREADS -/* i386_thread_state_t has field eax */ -#undef HAS_I386_THREAD_STATE_EAX - -/* i386_thread_state_t has field __eax */ -#undef HAS_I386_THREAD_STATE___EAX - /* ppc_thread_state64_t has field r0 */ #undef HAS_PPC_THREAD_STATE64_R0 @@ -72,6 +66,18 @@ /* ppc_thread_state_t has field __r0 */ #undef HAS_PPC_THREAD_STATE___R0 +/* x86_thread_state32_t has field eax */ +#undef HAS_X86_THREAD_STATE32_EAX + +/* x86_thread_state32_t has field __eax */ +#undef HAS_X86_THREAD_STATE32___EAX + +/* x86_thread_state64_t has field rax */ +#undef HAS_X86_THREAD_STATE64_RAX + +/* x86_thread_state64_t has field __rax */ +#undef HAS_X86_THREAD_STATE64___RAX + /* Define to 1 if you have the <inttypes.h> header file. */ #undef HAVE_INTTYPES_H @@ -111,9 +117,6 @@ /* Enable GC_PRINT_BACK_HEIGHT environment variable */ #undef MAKE_BACK_GRAPH -/* removes GC_dump */ -#undef NO_DEBUGGING - /* cause some or all of the heap to not have execute permission */ #undef NO_EXECUTE_PERMISSION @@ -123,9 +126,6 @@ /* does not disable signals */ #undef NO_SIGNALS -/* use empty GC_disable_signals and GC_enable_signals */ -#undef NO_SIGSET - /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT diff --git a/boehm-gc/include/private/gc_priv.h b/boehm-gc/include/private/gc_priv.h index f72faf9922a8..41c75d3bb62c 100644 --- a/boehm-gc/include/private/gc_priv.h +++ b/boehm-gc/include/private/gc_priv.h @@ -472,15 +472,17 @@ extern GC_warn_proc GC_current_warn_proc; # if defined(POWERPC) # if CPP_WORDSZ == 32 # define GC_THREAD_STATE_T ppc_thread_state_t +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT # define GC_MACH_HEADER mach_header # define GC_MACH_SECTION section # else # define GC_THREAD_STATE_T ppc_thread_state64_t +# define GC_MACH_THREAD_STATE PPC_THREAD_STATE64 +# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE64_COUNT # define GC_MACH_HEADER mach_header_64 # define GC_MACH_SECTION section_64 # endif -# define GC_MACH_THREAD_STATE PPC_THREAD_STATE -# define GC_MACH_THREAD_STATE_COUNT PPC_THREAD_STATE_COUNT # elif defined(I386) || defined(X86_64) # if CPP_WORDSZ == 32 # define GC_THREAD_STATE_T x86_thread_state32_t @@ -500,6 +502,18 @@ extern GC_warn_proc GC_current_warn_proc; # define GC_MACH_THREAD_STATE MACHINE_THREAD_STATE # define GC_MACH_THREAD_STATE_COUNT MACHINE_THREAD_STATE_COUNT # endif +/* Try to work out the right way to access thread state structure members. + The structure has changed its definition in different Darwin versions. + This now defaults to the (older) names without __, thus hopefully, + not breaking any existing Makefile.direct builds. */ +# if defined (HAS_PPC_THREAD_STATE___R0) \ + || defined (HAS_PPC_THREAD_STATE64___R0) \ + || defined (HAS_X86_THREAD_STATE32___EAX) \ + || defined (HAS_X86_THREAD_STATE64___RAX) +# define THREAD_FLD(x) __ ## x +# else +# define THREAD_FLD(x) x +# endif #endif /*********************************/ /* */ diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h index ef2223230899..27a616473211 100644 --- a/boehm-gc/include/private/gcconfig.h +++ b/boehm-gc/include/private/gcconfig.h @@ -329,6 +329,10 @@ # define I386 # define mach_type_known # endif +# if defined(FREEBSD) && defined(__x86_64__) +# define X86_64 +# define mach_type_known +# endif # if defined(__NetBSD__) && (defined(i386) || defined(__i386__)) # define I386 # define mach_type_known @@ -668,10 +672,10 @@ # endif # ifdef LINUX # define OS_TYPE "LINUX" -# define STACKBOTTOM ((ptr_t)0xf0000000) +# define LINUX_STACKBOTTOM # define USE_GENERIC_PUSH_REGS /* We never got around to the assembly version. */ -/* # define MPROTECT_VDB - Reported to not work 9/17/01 */ +# define MPROTECT_VDB # ifdef __ELF__ # define DYNAMIC_LOADING # include <features.h> diff --git a/boehm-gc/os_dep.c b/boehm-gc/os_dep.c index 5a0e59fefb75..3f0f20e834ce 100644 --- a/boehm-gc/os_dep.c +++ b/boehm-gc/os_dep.c @@ -84,7 +84,7 @@ # define NEED_FIND_LIMIT # endif -#if defined(FREEBSD) && (defined(I386) || defined(powerpc) || defined(__powerpc__)) +#if defined(FREEBSD) && (defined(I386) || defined(X86_64) || defined(powerpc) || defined(__powerpc__)) # include <machine/trap.h> # if !defined(PCR) # define NEED_FIND_LIMIT @@ -1392,7 +1392,7 @@ int * etext_addr; } # endif -# if defined(FREEBSD) && (defined(I386) || defined(powerpc) || defined(__powerpc__)) && !defined(PCR) +# if defined(FREEBSD) && (defined(I386) || defined(X86_64) || defined(powerpc) || defined(__powerpc__)) && !defined(PCR) /* Its unclear whether this should be identical to the above, or */ /* whether it should apply to non-X86 architectures. */ /* For now we don't assume that there is always an empty page after */ @@ -3371,7 +3371,7 @@ GC_bool is_ptrfree; 1. Apple's mach/xnu documentation 2. Timothy J. Wood's "Mach Exception Handlers 101" post to the omnigroup's macosx-dev list. - www.omnigroup.com/mailman/archive/macosx-dev/2000-June/002030.html + www.omnigroup.com/mailman/archive/macosx-dev/2000-June/014178.html 3. macosx-nat.c from Apple's GDB source code. */ @@ -3806,7 +3806,7 @@ catch_exception_raise( # if CPP_WORDSZ == 32 thread_state_flavor_t flavor = x86_EXCEPTION_STATE32; mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE32_COUNT; - x86_exception_state_t exc_state; + x86_exception_state32_t exc_state; # else thread_state_flavor_t flavor = x86_EXCEPTION_STATE64; mach_msg_type_number_t exc_state_count = x86_EXCEPTION_STATE64_COUNT; @@ -3844,9 +3844,9 @@ catch_exception_raise( /* This is the address that caused the fault */ #if defined(POWERPC) - addr = (char*) exc_state.dar; + addr = (char*) exc_state. THREAD_FLD(dar); #elif defined (I386) || defined (X86_64) - addr = (char*) exc_state.faultvaddr; + addr = (char*) exc_state. THREAD_FLD(faultvaddr); #else # error FIXME for non POWERPC/I386 #endif diff --git a/boehm-gc/pthread_stop_world.c b/boehm-gc/pthread_stop_world.c index de647769c7c2..211e6b89e06f 100644 --- a/boehm-gc/pthread_stop_world.c +++ b/boehm-gc/pthread_stop_world.c @@ -124,7 +124,7 @@ sem_t GC_suspend_ack_sem; void GC_suspend_handler_inner(ptr_t sig_arg); -#if defined(IA64) || defined(HP_PA) +#if defined(IA64) || defined(HP_PA) || defined(M68K) extern void GC_with_callee_saves_pushed(); void GC_suspend_handler(int sig) |