1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 23:31:55 -08:00

Revert change 196178, submitted on wrong branch.

Copied from Perforce
 Change: 196185
This commit is contained in:
Gareth Rees 2019-06-05 10:36:50 +01:00
parent 88f046fff1
commit 1442df6958

View file

@ -1,7 +1,7 @@
/* ss.h: STACK SCANNING
*
* $Id$
* Copyright (c) 2001-2019 Ravenbrook Limited. See end of file for license.
* Copyright (c) 2001-2018 Ravenbrook Limited. See end of file for license.
*
* This module saves the mutator context on entry to the MPS, and
* provides functions for decoding the context and scanning the root
@ -13,12 +13,21 @@
#include "mpm.h"
/* StackContext -- some of the mutator's state */
typedef struct StackContextStruct StackContextStruct;
/* StackContext -- some of the mutator's state
*
* The jumpBuffer is used to capture most of the mutator's state on
* entry to the MPS, but can't capture it all. See
* <design/stack-scan#.sol.setjmp.scan>.
*/
#include <setjmp.h>
typedef struct StackContextStruct {
jmp_buf jumpBuffer;
} StackContextStruct;
/* StackHot -- capture a hot stack pointer
*
* Sets *stackOut to a stack pointer that includes the current frame.
@ -50,44 +59,6 @@ void StackHot(void **stackOut);
/* STACK_CONTEXT_SAVE -- save the callee-saves and stack pointer */
#if (defined(MPS_OS_FR) || defined(MPS_OS_LI)) && defined(MPS_ARCH_I3)
struct StackContextStruct {
Word calleeSave[4];
};
#define STACK_CONTEXT_SAVE(sc) \
BEGIN \
__asm__ volatile ("mov %%ebx, %0" : "=m" ((sc)->calleeSave[0])); \
__asm__ volatile ("mov %%esi, %0" : "=m" ((sc)->calleeSave[1])); \
__asm__ volatile ("mov %%edi, %0" : "=m" ((sc)->calleeSave[2])); \
__asm__ volatile ("mov %%ebp, %0" : "=m" ((sc)->calleeSave[3])); \
END
#elif (defined(MPS_OS_FR) || defined(MPS_OS_LI)) && defined(MPS_ARCH_I6)
struct StackContextStruct {
Word calleeSave[6];
};
#define STACK_CONTEXT_SAVE(sc) \
BEGIN \
__asm__ volatile ("mov %%rbp, %0" : "=m" ((sc)->calleeSave[0])); \
__asm__ volatile ("mov %%rbx, %0" : "=m" ((sc)->calleeSave[1])); \
__asm__ volatile ("mov %%r12, %0" : "=m" ((sc)->calleeSave[2])); \
__asm__ volatile ("mov %%r13, %0" : "=m" ((sc)->calleeSave[3])); \
__asm__ volatile ("mov %%r14, %0" : "=m" ((sc)->calleeSave[4])); \
__asm__ volatile ("mov %%r15, %0" : "=m" ((sc)->calleeSave[5])); \
END
#else /* jmp_buf platforms */
#include <setjmp.h>
struct StackContextStruct {
jmp_buf jumpBuffer;
};
#if defined(MPS_OS_XC)
/* We call _setjmp rather than setjmp because we can be confident what
@ -103,9 +74,7 @@ struct StackContextStruct {
#define STACK_CONTEXT_SAVE(sc) ((void)setjmp((sc)->jumpBuffer))
#endif /* jmp_buf platforms */
#endif /* platform specific code */
#endif /* platform defines */
/* StackScan -- scan the mutator's stack and registers
@ -123,7 +92,7 @@ extern Res StackScan(ScanState ss, void *stackCold,
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2019 Ravenbrook Limited <https://www.ravenbrook.com/>.
* Copyright (C) 2001-2018 Ravenbrook Limited <https://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*