summaryrefslogtreecommitdiff
path: root/libguile/intrinsics.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2019-08-26 10:19:24 +0200
committerAndy Wingo <wingo@pobox.com>2019-08-26 10:19:24 +0200
commitb02d1b08d7d7f0eaafdd9dcfc3de3a139b25492e (patch)
treeaa592b5ff98f92d9159a52cc662a4ed25c7f9f93 /libguile/intrinsics.c
parentb959708114ad88c90cd77a08a9b9dcf6e0d4f446 (diff)
downloadguile-b02d1b08d7d7f0eaafdd9dcfc3de3a139b25492e.tar.gz
Compiler allocates boxed flonums in unmarked space
This fixes a bug whereby the compiler would sometimes allocate floats in marked space. * libguile/gc-inline.h (scm_inline_gc_malloc_pointerless_words): New internal helper. * libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): * libguile/intrinsics.c (allocate_pointerless_words): (allocate_pointerless_words_with_freelist): New intrinsics. * libguile/jit.c (compile_allocate_pointerless_words): (compile_allocate_pointerless_words_immediate): New compilers. * libguile/vm-engine.c (allocate_pointerless_words) (allocate_pointerless_words_immediate): New opcodes. * module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/effects-analysis.scm (param): * module/language/cps/reify-primitives.scm (reify-primitives): * module/language/cps/specialize-primcalls.scm (specialize-primcalls): * module/language/cps/types.scm (allocate-words): (allocate-words/immediate): * module/system/vm/assembler.scm (system): Add support for the new opcodes.
Diffstat (limited to 'libguile/intrinsics.c')
-rw-r--r--libguile/intrinsics.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libguile/intrinsics.c b/libguile/intrinsics.c
index bb7381f59..a9b2d983b 100644
--- a/libguile/intrinsics.c
+++ b/libguile/intrinsics.c
@@ -430,6 +430,21 @@ allocate_words_with_freelist (scm_thread *thread, size_t freelist_idx)
}
static SCM
+allocate_pointerless_words (scm_thread *thread, size_t n)
+{
+ return SCM_PACK_POINTER (scm_inline_gc_malloc_pointerless_words (thread, n));
+}
+
+static SCM
+allocate_pointerless_words_with_freelist (scm_thread *thread, size_t freelist_idx)
+{
+ return SCM_PACK_POINTER
+ (scm_inline_gc_alloc (&thread->pointerless_freelists[freelist_idx],
+ freelist_idx,
+ SCM_INLINE_GC_KIND_POINTERLESS));
+}
+
+static SCM
current_module (scm_thread *thread)
{
return scm_i_current_module (thread);
@@ -546,6 +561,9 @@ scm_bootstrap_intrinsics (void)
scm_vm_intrinsics.facos = acos;
scm_vm_intrinsics.fatan = atan;
scm_vm_intrinsics.fatan2 = atan2;
+ scm_vm_intrinsics.allocate_pointerless_words = allocate_pointerless_words;
+ scm_vm_intrinsics.allocate_pointerless_words_with_freelist =
+ allocate_pointerless_words_with_freelist;
scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,
"scm_init_intrinsics",