diff options
author | Sverker Eriksson <[email protected]> | 2016-07-05 19:09:16 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-07-05 19:09:16 +0200 |
commit | a94f909586a7b69ba2f4539f4c40e3600cf705d2 (patch) | |
tree | dbc999e7120a41fe7acb41f6d1b4afb001318cc3 /erts/emulator/hipe/hipe_amd64_asm.m4 | |
parent | 04bb724a572c78d775df2ec12a1694870369c3b4 (diff) | |
parent | 520654d49d9f1c1548dc2a5800c7330001cd3064 (diff) | |
download | otp-a94f909586a7b69ba2f4539f4c40e3600cf705d2.tar.gz otp-a94f909586a7b69ba2f4539f4c40e3600cf705d2.tar.bz2 otp-a94f909586a7b69ba2f4539f4c40e3600cf705d2.zip |
Merge branch 'hipe-trap-gc/PR-1116/OTP-13724' into maint
* hipe-trap-gc/PR-1116:
hipe: Fix bug in trap frame allocation wrappers
hipe: Add assertion for gc in bif without wrapper
Diffstat (limited to 'erts/emulator/hipe/hipe_amd64_asm.m4')
-rw-r--r-- | erts/emulator/hipe/hipe_amd64_asm.m4 | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/erts/emulator/hipe/hipe_amd64_asm.m4 b/erts/emulator/hipe/hipe_amd64_asm.m4 index 2c0fbbee2d..409fd0ef89 100644 --- a/erts/emulator/hipe/hipe_amd64_asm.m4 +++ b/erts/emulator/hipe/hipe_amd64_asm.m4 @@ -121,6 +121,22 @@ define(NSP,%rsp)dnl /* + * Debugging macros + * + * Keeps track of whether context has been saved in the debug build, allowing us + * to detect when the garbage collector is called when it shouldn't. + */ +`#ifdef DEBUG +# define SET_GC_UNSAFE \ + movq $1, P_GCUNSAFE(P) +# define SET_GC_SAFE \ + movq $0, P_GCUNSAFE(P) +#else +# define SET_GC_UNSAFE +# define SET_GC_SAFE +#endif' + +/* * Context switching macros. */ `#define SWITCH_C_TO_ERLANG_QUICK \ @@ -133,12 +149,14 @@ define(NSP,%rsp)dnl `#define SAVE_CACHED_STATE \ SAVE_HP; \ - SAVE_FCALLS' + SAVE_FCALLS; \ + SET_GC_SAFE' `#define RESTORE_CACHED_STATE \ RESTORE_HP; \ RESTORE_HEAP_LIMIT; \ - RESTORE_FCALLS' + RESTORE_FCALLS; \ + SET_GC_UNSAFE' `#define SWITCH_C_TO_ERLANG \ RESTORE_CACHED_STATE; \ |