aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Schwab2011-01-05 14:09:07 +0100
committerAndreas Schwab2011-01-05 14:09:07 +0100
commit2018939f5da2c3171825ea1699cea4ff4f52b71c (patch)
tree27343ad94a64c306e8c6778ebda4cfaded5572da /src
parent96f129d50f65d1ced19c417aeda7f2755344228c (diff)
downloademacs-2018939f5da2c3171825ea1699cea4ff4f52b71c.tar.gz
emacs-2018939f5da2c3171825ea1699cea4ff4f52b71c.zip
Use __builtin_unwind_init if available
* configure.in: Check for __builtin_unwind_init. * src/alloc.c (mark_stack): Use __builtin_unwind_init if available.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/alloc.c21
-rw-r--r--src/config.in6
3 files changed, 28 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d2ad0afc7cd..a32e7a28dc3 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12011-01-05 Andreas Schwab <schwab@linux-m68k.org>
2
3 * alloc.c (mark_stack): Use __builtin_unwind_init if available.
4
12011-01-04 Jan Moringen <jan.moringen@uni-bielefeld.de> 52011-01-04 Jan Moringen <jan.moringen@uni-bielefeld.de>
2 6
3 * dbusbind.c (Fdbus_register_method): Added optional parameter 7 * dbusbind.c (Fdbus_register_method): Added optional parameter
@@ -29431,7 +29435,7 @@ See ChangeLog.10 for earlier changes.
29431;; coding: utf-8 29435;; coding: utf-8
29432;; End: 29436;; End:
29433 29437
29434 Copyright (C) 2007, 2008, 2009, 2010 29438 Copyright (C) 2007, 2008, 2009, 2010, 2011
29435 Free Software Foundation, Inc. 29439 Free Software Foundation, Inc.
29436 29440
29437 This file is part of GNU Emacs. 29441 This file is part of GNU Emacs.
diff --git a/src/alloc.c b/src/alloc.c
index e754e2f6aa2..089a7766ca4 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -1,6 +1,6 @@
1/* Storage allocation and gc for GNU Emacs Lisp interpreter. 1/* Storage allocation and gc for GNU Emacs Lisp interpreter.
2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2 Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999,
3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 3 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc. 4 Free Software Foundation, Inc.
5 5
6This file is part of GNU Emacs. 6This file is part of GNU Emacs.
@@ -4222,7 +4222,7 @@ Please mail the result to <emacs-devel@gnu.org>.\n\
4222 can prove that. */ 4222 can prove that. */
4223 4223
4224static void 4224static void
4225test_setjmp () 4225test_setjmp (void)
4226{ 4226{
4227 char buf[10]; 4227 char buf[10];
4228 register int x; 4228 register int x;
@@ -4270,7 +4270,7 @@ test_setjmp ()
4270/* Abort if anything GCPRO'd doesn't survive the GC. */ 4270/* Abort if anything GCPRO'd doesn't survive the GC. */
4271 4271
4272static void 4272static void
4273check_gcpros () 4273check_gcpros (void)
4274{ 4274{
4275 struct gcpro *p; 4275 struct gcpro *p;
4276 int i; 4276 int i;
@@ -4286,7 +4286,7 @@ check_gcpros ()
4286#elif GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES 4286#elif GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES
4287 4287
4288static void 4288static void
4289dump_zombies () 4289dump_zombies (void)
4290{ 4290{
4291 int i; 4291 int i;
4292 4292
@@ -4321,6 +4321,11 @@ dump_zombies ()
4321 have to be true! It must be verified for each system, possibly 4321 have to be true! It must be verified for each system, possibly
4322 by taking a look at the source code of setjmp. 4322 by taking a look at the source code of setjmp.
4323 4323
4324 If __builtin_unwind_init is available (defined by GCC >= 2.8) we
4325 can use it as a machine independent method to store all registers
4326 to the stack. In this case the macros described in the previous
4327 two paragraphs are not used.
4328
4324 Stack Layout 4329 Stack Layout
4325 4330
4326 Architectures differ in the way their processor stack is organized. 4331 Architectures differ in the way their processor stack is organized.
@@ -4359,6 +4364,13 @@ mark_stack (void)
4359 volatile int stack_grows_down_p = (char *) &j > (char *) stack_base; 4364 volatile int stack_grows_down_p = (char *) &j > (char *) stack_base;
4360 void *end; 4365 void *end;
4361 4366
4367#ifdef HAVE___BUILTIN_UNWIND_INIT
4368 /* Force callee-saved registers and register windows onto the stack.
4369 This is the preferred method if available, obviating the need for
4370 machine dependent methods. */
4371 __builtin_unwind_init ();
4372 end = &end;
4373#else /* not HAVE___BUILTIN_UNWIND_INIT */
4362 /* This trick flushes the register windows so that all the state of 4374 /* This trick flushes the register windows so that all the state of
4363 the process is contained in the stack. */ 4375 the process is contained in the stack. */
4364 /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is 4376 /* Fixme: Code in the Boehm GC suggests flushing (with `flushrs') is
@@ -4394,6 +4406,7 @@ mark_stack (void)
4394 setjmp (j.j); 4406 setjmp (j.j);
4395 end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j; 4407 end = stack_grows_down_p ? (char *) &j + sizeof j : (char *) &j;
4396#endif /* not GC_SAVE_REGISTERS_ON_STACK */ 4408#endif /* not GC_SAVE_REGISTERS_ON_STACK */
4409#endif /* not HAVE___BUILTIN_UNWIND_INIT */
4397 4410
4398 /* This assumes that the stack is a contiguous region in memory. If 4411 /* This assumes that the stack is a contiguous region in memory. If
4399 that's not the case, something has to be done here to iterate 4412 that's not the case, something has to be done here to iterate
diff --git a/src/config.in b/src/config.in
index 737d3827363..509f086a99c 100644
--- a/src/config.in
+++ b/src/config.in
@@ -816,6 +816,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
816/* Define to 1 if you want to use the X window system. */ 816/* Define to 1 if you want to use the X window system. */
817#undef HAVE_X_WINDOWS 817#undef HAVE_X_WINDOWS
818 818
819/* Define to 1 if you have the `__builtin_unwind_init' function. */
820#undef HAVE___BUILTIN_UNWIND_INIT
821
819/* Define to 1 if you have the `__executable_start' function. */ 822/* Define to 1 if you have the `__executable_start' function. */
820#undef HAVE___EXECUTABLE_START 823#undef HAVE___EXECUTABLE_START
821 824
@@ -1053,6 +1056,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
1053/* Define to `int' if <sys/types.h> does not define. */ 1056/* Define to `int' if <sys/types.h> does not define. */
1054#undef pid_t 1057#undef pid_t
1055 1058
1059/* Define to `unsigned int' if <sys/types.h> does not define. */
1060#undef size_t
1061
1056/* Define to any substitute for sys_siglist. */ 1062/* Define to any substitute for sys_siglist. */
1057#undef sys_siglist 1063#undef sys_siglist
1058 1064