|
5 | 5 |
|
6 | 6 | #ifdef LIBRARY_EXPORTS |
7 | 7 |
|
| 8 | +// Generated file, needs to be searched in include paths so that the builddir |
| 9 | +// retains priority |
| 10 | +#include <jl_internal_funcs.inc> |
| 11 | +#undef jl_setjmp |
| 12 | +#undef jl_longjmp |
| 13 | +#undef jl_egal |
| 14 | +#endif |
| 15 | + |
| 16 | +#include "julia_fasttls.h" |
| 17 | +#include "libsupport.h" |
| 18 | +#include <stdint.h> |
| 19 | +#include <string.h> |
| 20 | + |
| 21 | +#include "htable.h" |
| 22 | +#include "arraylist.h" |
| 23 | +#include "analyzer_annotations.h" |
| 24 | + |
8 | 25 | #ifdef __cplusplus |
9 | 26 | extern "C" { |
10 | 27 | #endif |
11 | 28 |
|
12 | 29 | extern int mmtk_object_is_managed_by_mmtk(void* addr); |
13 | 30 | extern unsigned char mmtk_pin_object(void* obj); |
| 31 | +extern unsigned char mmtk_unpin_object(void* obj); |
| 32 | +#ifdef __clang_gcanalyzer__ |
| 33 | +extern void PTRHASH_PIN(void* key) JL_NOTSAFEPOINT; |
| 34 | +extern void PTRHASH_UNPIN(void* key) JL_NOTSAFEPOINT; |
| 35 | +#else |
14 | 36 | // FIXME: Pinning objects that get hashed in the ptrhash table |
15 | 37 | // until we implement address space hashing. |
16 | 38 | #ifdef MMTK_GC |
17 | 39 | #define PTRHASH_PIN(key) mmtk_pin_object(key); |
| 40 | +#define PTRHASH_UNPIN(key) mmtk_unpin_object(key); |
18 | 41 | #else |
19 | 42 | #define PTRHASH_PIN(key) |
| 43 | +#define PTRHASH_UNPIN(key) |
| 44 | +#endif |
20 | 45 | #endif |
21 | 46 |
|
22 | 47 | #ifdef __cplusplus |
23 | 48 | } |
24 | 49 | #endif |
25 | 50 |
|
26 | | -// Generated file, needs to be searched in include paths so that the builddir |
27 | | -// retains priority |
28 | | -#include <jl_internal_funcs.inc> |
29 | | -#undef jl_setjmp |
30 | | -#undef jl_longjmp |
31 | | -#undef jl_egal |
32 | | -#endif |
33 | | - |
34 | | -#include "julia_fasttls.h" |
35 | | -#include "libsupport.h" |
36 | | -#include <stdint.h> |
37 | | -#include <string.h> |
38 | | - |
39 | | -#include "htable.h" |
40 | | -#include "arraylist.h" |
41 | | -#include "analyzer_annotations.h" |
42 | | - |
43 | 51 | #include <setjmp.h> |
44 | 52 | #ifndef _OS_WINDOWS_ |
45 | 53 | # define jl_jmp_buf sigjmp_buf |
@@ -907,6 +915,24 @@ extern void _JL_GC_PUSHARGS(jl_value_t **, size_t) JL_NOTSAFEPOINT; |
907 | 915 |
|
908 | 916 | extern void JL_GC_POP() JL_NOTSAFEPOINT; |
909 | 917 |
|
| 918 | +#ifdef MMTK_GC |
| 919 | +extern void JL_GC_PUSH1_NO_TPIN(void *) JL_NOTSAFEPOINT; |
| 920 | +extern void JL_GC_PUSH2_NO_TPIN(void *, void *) JL_NOTSAFEPOINT; |
| 921 | +extern void JL_GC_PUSH3_NO_TPIN(void *, void *, void *) JL_NOTSAFEPOINT; |
| 922 | +extern void JL_GC_PUSH4_NO_TPIN(void *, void *, void *, void *) JL_NOTSAFEPOINT; |
| 923 | +extern void JL_GC_PUSH5_NO_TPIN(void *, void *, void *, void *, void *) JL_NOTSAFEPOINT; |
| 924 | +extern void JL_GC_PUSH7_NO_TPIN(void *, void *, void *, void *, void *, void *, void *) JL_NOTSAFEPOINT; |
| 925 | +extern void JL_GC_PUSH8_NO_TPIN(void *, void *, void *, void *, void *, void *, void *, void *) JL_NOTSAFEPOINT; |
| 926 | +extern void _JL_GC_PUSHARGS_NO_TPIN(jl_value_t **, size_t) JL_NOTSAFEPOINT; |
| 927 | +// This is necessary, because otherwise the analyzer considers this undefined |
| 928 | +// behavior and terminates the exploration |
| 929 | +#define JL_GC_PUSHARGS_NO_TPIN(rts_var, n) \ |
| 930 | + rts_var = (jl_value_t **)alloca(sizeof(void*) * (n)); \ |
| 931 | + memset(rts_var, 0, sizeof(void*) * (n)); \ |
| 932 | + _JL_GC_PUSHARGS_NO_TPIN(rts_var, (n)); |
| 933 | + |
| 934 | +#endif |
| 935 | + |
910 | 936 | #else |
911 | 937 |
|
912 | 938 | #define JL_GC_PUSH1(arg1) \ |
|
0 commit comments