1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-13 17:20:21 +02:00

Whippet can trace conservative roots

Next up, enabling it via the makefiles.
This commit is contained in:
Andy Wingo 2022-09-21 10:55:26 +02:00
parent deed415a06
commit 1944b54a19
8 changed files with 311 additions and 73 deletions

View file

@ -16,16 +16,34 @@ static inline int gc_has_conservative_intraheap_edges(void) {
return 0;
}
static inline void gc_trace_precise_mutator_roots(struct gc_mutator_roots *roots,
void (*trace_edge)(struct gc_edge edge,
void *trace_data),
void *trace_data) {
static inline int
gc_is_valid_conservative_ref_displacement(uintptr_t displacement) {
// Here is where you would allow tagged heap object references.
return displacement == 0;
}
static inline int
gc_conservative_ref_might_be_a_heap_object(struct gc_conservative_ref ref,
int possibly_interior) {
// Assume that the minimum page size is 4096, and that the first page
// will contain no heap objects.
if (gc_conservative_ref_value(ref) < 4096)
return 0;
if (possibly_interior)
return 1;
return gc_is_valid_conservative_ref_displacement
(gc_conservative_ref_value(ref) & (sizeof(uintptr_t) - 1));
}
static inline void gc_trace_precise_heap_roots(struct gc_heap_roots *roots,
void (*trace_edge)(struct gc_edge edge,
void *trace_data),
void *trace_data) {
static inline void gc_trace_mutator_roots(struct gc_mutator_roots *roots,
void (*trace_edge)(struct gc_edge edge,
void *trace_data),
void *trace_data) {
}
static inline void gc_trace_heap_roots(struct gc_heap_roots *roots,
void (*trace_edge)(struct gc_edge edge,
void *trace_data),
void *trace_data) {
}
#endif // CONSERVATIVE_ROOTS_EMBEDDER_H