1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00

Switch to use Whippet allocation fast paths

* libguile/Makefile.am (noinst_HEADERS, modinclude_HEADERS): Move
gc-inline.h to be a private header.
* libguile/gc-inline.h (scm_inline_gc_malloc_pointerless):
(scm_inline_gc_malloc): Use gc_allocate.
* libguile/intrinsics.c (allocate_words_with_freelist):
(allocate_pointerless_words_with_freelist): Remove these intrinsics.
Renumbers the intrinsics.
(scm_bootstrap_intrinsics):
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): Adapt to intrinsics
change.
* libguile/jit.c (emit_update_alloc_table):
(emit_allocate_bytes_fast_freelist):
(emit_allocate_words_slow): New helpers.
(compile_allocate_words):
(compile_allocate_words_immediate):
(compile_allocate_words_immediate_slow):
(compile_allocate_pointerless_words):
(compile_allocate_pointerless_words_immediate):
(compile_allocate_pointerless_words_immediate_slow): Use new helpers.
* libguile/threads.c (scm_trace_thread_mutator_roots):
(on_thread_exit):
* libguile/threads.h: Remove Guile-managed thread-local freelists.
This commit is contained in:
Andy Wingo 2025-04-22 13:44:44 +02:00
parent 7696344634
commit 0532602cd3
7 changed files with 93 additions and 185 deletions

View file

@ -132,15 +132,6 @@ scm_trace_thread_mutator_roots (struct scm_thread *thread,
{
scm_trace_vm (&thread->vm, trace_edge, heap, trace_data);
/* FIXME: Remove these in favor of Whippet inline allocation. */
for (size_t i = 0; i < SCM_INLINE_GC_FREELIST_COUNT; i++)
trace_edge (gc_edge (&thread->freelists[i]), heap, trace_data);
for (size_t i = 0; i < SCM_INLINE_GC_FREELIST_COUNT; i++)
for (void **loc = &thread->pointerless_freelists[i];
*loc;
loc = (void **) *loc)
trace_edge (gc_edge (loc), heap, trace_data);
/* FIXME: Call instead via gc_trace_object. */
scm_trace_thread (thread, trace_edge, heap, trace_data);
}
@ -521,8 +512,6 @@ on_thread_exit (void *v)
/* Although this thread has exited, the thread object might still be
alive. Release unused memory. */
for (size_t n = 0; n < SCM_INLINE_GC_FREELIST_COUNT; n++)
t->freelists[n] = t->pointerless_freelists[n] = NULL;
t->dynamic_state = NULL;
t->dynstack.base = NULL;
t->dynstack.top = NULL;