Add an inlined jit fast-path for allocate-words/immediate
* libguile/intrinsics.c (allocate_words_with_freelist) (scm_bootstrap_intrinsics): * libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): New intrinsic. * libguile/jit.c (compile_allocate_words_immediate): Add fast-path. A marginal improvement.
This commit is contained in:
parent
33aecf48b0
commit
89e28df1c9
3 changed files with 46 additions and 7 deletions
|
|
@ -418,6 +418,15 @@ allocate_words (scm_thread *thread, size_t n)
|
|||
return SCM_PACK_POINTER (scm_inline_gc_malloc_words (thread, n));
|
||||
}
|
||||
|
||||
static SCM
|
||||
allocate_words_with_freelist (scm_thread *thread, size_t freelist_idx)
|
||||
{
|
||||
return SCM_PACK_POINTER
|
||||
(scm_inline_gc_alloc (&thread->freelists[freelist_idx],
|
||||
freelist_idx,
|
||||
SCM_INLINE_GC_KIND_NORMAL));
|
||||
}
|
||||
|
||||
static SCM
|
||||
current_module (scm_thread *thread)
|
||||
{
|
||||
|
|
@ -506,6 +515,7 @@ scm_bootstrap_intrinsics (void)
|
|||
scm_vm_intrinsics.allocate_words = allocate_words;
|
||||
scm_vm_intrinsics.current_module = current_module;
|
||||
scm_vm_intrinsics.push_prompt = push_prompt;
|
||||
scm_vm_intrinsics.allocate_words_with_freelist = allocate_words_with_freelist;
|
||||
|
||||
scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,
|
||||
"scm_init_intrinsics",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue