diff options
| author | Paul Eggert | 2020-07-30 09:22:01 -0700 |
|---|---|---|
| committer | Paul Eggert | 2020-07-30 09:23:51 -0700 |
| commit | 88b4516cf8c3ff39803430452b8adbb86a73642a (patch) | |
| tree | fe36151bfdc747db2937c013f2720788686e7e2b /src | |
| parent | 35564bea4d73bc266743216599d01d644aed6fd8 (diff) | |
| download | emacs-88b4516cf8c3ff39803430452b8adbb86a73642a.tar.gz emacs-88b4516cf8c3ff39803430452b8adbb86a73642a.zip | |
Port to Oracle Studio 12.6 (sparc)
* src/alloc.c (__builtin_unwind_init) [!HAVE___BUILTIN_UNWIND_INIT]:
Move from here ...
* src/lisp.h: ... to here, since flush_stack_call_func uses it.
* src/pdumper.c (dump_off_from_lisp): Avoid ‘return n;;’ to pacify
Oracle Studio.
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 31 | ||||
| -rw-r--r-- | src/lisp.h | 19 | ||||
| -rw-r--r-- | src/pdumper.c | 3 |
3 files changed, 25 insertions, 28 deletions
diff --git a/src/alloc.c b/src/alloc.c index ed30c449785..76bb20876b0 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -4966,27 +4966,6 @@ typedef union | |||
| 4966 | #endif | 4966 | #endif |
| 4967 | } stacktop_sentry; | 4967 | } stacktop_sentry; |
| 4968 | 4968 | ||
| 4969 | /* Force callee-saved registers and register windows onto the stack. | ||
| 4970 | Use the platform-defined __builtin_unwind_init if available, | ||
| 4971 | obviating the need for machine dependent methods. */ | ||
| 4972 | #ifndef HAVE___BUILTIN_UNWIND_INIT | ||
| 4973 | # ifdef __sparc__ | ||
| 4974 | /* This trick flushes the register windows so that all the state of | ||
| 4975 | the process is contained in the stack. | ||
| 4976 | FreeBSD does not have a ta 3 handler, so handle it specially. | ||
| 4977 | FIXME: Code in the Boehm GC suggests flushing (with 'flushrs') is | ||
| 4978 | needed on ia64 too. See mach_dep.c, where it also says inline | ||
| 4979 | assembler doesn't work with relevant proprietary compilers. */ | ||
| 4980 | # if defined __sparc64__ && defined __FreeBSD__ | ||
| 4981 | # define __builtin_unwind_init() asm ("flushw") | ||
| 4982 | # else | ||
| 4983 | # define __builtin_unwind_init() asm ("ta 3") | ||
| 4984 | # endif | ||
| 4985 | # else | ||
| 4986 | # define __builtin_unwind_init() ((void) 0) | ||
| 4987 | # endif | ||
| 4988 | #endif | ||
| 4989 | |||
| 4990 | /* Yield an address close enough to the top of the stack that the | 4969 | /* Yield an address close enough to the top of the stack that the |
| 4991 | garbage collector need not scan above it. Callers should be | 4970 | garbage collector need not scan above it. Callers should be |
| 4992 | declared NO_INLINE. */ | 4971 | declared NO_INLINE. */ |
| @@ -5022,16 +5001,14 @@ typedef union | |||
| 5022 | We have to mark Lisp objects in CPU registers that can hold local | 5001 | We have to mark Lisp objects in CPU registers that can hold local |
| 5023 | variables or are used to pass parameters. | 5002 | variables or are used to pass parameters. |
| 5024 | 5003 | ||
| 5025 | This code assumes that calling setjmp saves registers we need | 5004 | If __builtin_unwind_init is available, it should suffice to save |
| 5005 | registers. | ||
| 5006 | |||
| 5007 | Otherwise, assume that calling setjmp saves registers we need | ||
| 5026 | to see in a jmp_buf which itself lies on the stack. This doesn't | 5008 | to see in a jmp_buf which itself lies on the stack. This doesn't |
| 5027 | have to be true! It must be verified for each system, possibly | 5009 | have to be true! It must be verified for each system, possibly |
| 5028 | by taking a look at the source code of setjmp. | 5010 | by taking a look at the source code of setjmp. |
| 5029 | 5011 | ||
| 5030 | If __builtin_unwind_init is available (defined by GCC >= 2.8) we | ||
| 5031 | can use it as a machine independent method to store all registers | ||
| 5032 | to the stack. In this case the macros described in the previous | ||
| 5033 | two paragraphs are not used. | ||
| 5034 | |||
| 5035 | Stack Layout | 5012 | Stack Layout |
| 5036 | 5013 | ||
| 5037 | Architectures differ in the way their processor stack is organized. | 5014 | Architectures differ in the way their processor stack is organized. |
diff --git a/src/lisp.h b/src/lisp.h index 7b4f484b9b7..fdf69ab7368 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -3811,6 +3811,25 @@ extern void mark_maybe_objects (Lisp_Object const *, ptrdiff_t); | |||
| 3811 | extern void mark_stack (char const *, char const *); | 3811 | extern void mark_stack (char const *, char const *); |
| 3812 | extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg); | 3812 | extern void flush_stack_call_func1 (void (*func) (void *arg), void *arg); |
| 3813 | 3813 | ||
| 3814 | /* Force callee-saved registers and register windows onto the stack, | ||
| 3815 | so that conservative garbage collection can see their values. */ | ||
| 3816 | #ifndef HAVE___BUILTIN_UNWIND_INIT | ||
| 3817 | # ifdef __sparc__ | ||
| 3818 | /* This trick flushes the register windows so that all the state of | ||
| 3819 | the process is contained in the stack. | ||
| 3820 | FreeBSD does not have a ta 3 handler, so handle it specially. | ||
| 3821 | FIXME: Code in the Boehm GC suggests flushing (with 'flushrs') is | ||
| 3822 | needed on ia64 too. See mach_dep.c, where it also says inline | ||
| 3823 | assembler doesn't work with relevant proprietary compilers. */ | ||
| 3824 | # if defined __sparc64__ && defined __FreeBSD__ | ||
| 3825 | # define __builtin_unwind_init() asm ("flushw") | ||
| 3826 | # else | ||
| 3827 | # define __builtin_unwind_init() asm ("ta 3") | ||
| 3828 | # endif | ||
| 3829 | # else | ||
| 3830 | # define __builtin_unwind_init() ((void) 0) | ||
| 3831 | # endif | ||
| 3832 | #endif | ||
| 3814 | INLINE void | 3833 | INLINE void |
| 3815 | flush_stack_call_func (void (*func) (void *arg), void *arg) | 3834 | flush_stack_call_func (void (*func) (void *arg), void *arg) |
| 3816 | { | 3835 | { |
diff --git a/src/pdumper.c b/src/pdumper.c index 7f6876666be..865ceff6fff 100644 --- a/src/pdumper.c +++ b/src/pdumper.c | |||
| @@ -747,8 +747,9 @@ dump_off_from_lisp (Lisp_Object value) | |||
| 747 | intmax_t n = intmax_t_from_lisp (value); | 747 | intmax_t n = intmax_t_from_lisp (value); |
| 748 | eassert (DUMP_OFF_MIN <= n && n <= DUMP_OFF_MAX); | 748 | eassert (DUMP_OFF_MIN <= n && n <= DUMP_OFF_MAX); |
| 749 | ALLOW_IMPLICIT_CONVERSION; | 749 | ALLOW_IMPLICIT_CONVERSION; |
| 750 | return n; | 750 | dump_off converted = n; |
| 751 | DISALLOW_IMPLICIT_CONVERSION; | 751 | DISALLOW_IMPLICIT_CONVERSION; |
| 752 | return converted; | ||
| 752 | } | 753 | } |
| 753 | 754 | ||
| 754 | static Lisp_Object | 755 | static Lisp_Object |