summaryrefslogtreecommitdiff
path: root/libguile/vm-engine.c
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-06-27 14:36:56 +0200
committerAndy Wingo <wingo@pobox.com>2018-06-27 14:56:39 +0200
commit0faa4144d14723c2774af88c146617e9ef2e066b (patch)
tree407e50377363522a9fa604ea939ffe95dd761cf9 /libguile/vm-engine.c
parent7883290d884d3e2e83d293a4d35ce4ab335a9948 (diff)
downloadguile-0faa4144d14723c2774af88c146617e9ef2e066b.tar.gz
allocate-words intrinsic
* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): * libguile/intrinsics.c (allocate_words, scm_bootstrap_intrinsics): New intrinsic. * libguile/vm-engine.c (allocate-words, allocate-words/immediate): Use new intrinsic.
Diffstat (limited to 'libguile/vm-engine.c')
-rw-r--r--libguile/vm-engine.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/libguile/vm-engine.c b/libguile/vm-engine.c
index 88cfb614f..7988536ec 100644
--- a/libguile/vm-engine.c
+++ b/libguile/vm-engine.c
@@ -1155,10 +1155,7 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
UNPACK_12_12 (op, dst, size);
SYNC_IP ();
- SP_SET (dst,
- SCM_PACK_POINTER
- (scm_inline_gc_malloc_words (thread, SP_REF_U64 (size))));
-
+ SP_SET (dst, scm_vm_intrinsics.allocate_words (thread, SP_REF_U64 (size)));
NEXT (1);
}
@@ -1169,8 +1166,7 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
UNPACK_12_12 (op, dst, size);
SYNC_IP ();
- SP_SET (dst,
- SCM_PACK_POINTER (scm_inline_gc_malloc_words (thread, size)));
+ SP_SET (dst, scm_vm_intrinsics.allocate_words (thread, size));
NEXT (1);
}
@@ -1945,7 +1941,24 @@ VM_NAME (scm_thread *thread, jmp_buf *registers, int resume)
NEXT (2);
}
- VM_DEFINE_OP (92, unused_92, NULL, NOP)
+ VM_DEFINE_OP (92, call_scm_from_thread, "call-scm<-thread", OP2 (X8_S24, C32) | OP_DST)
+ {
+ uint32_t dst;
+ scm_t_scm_from_thread_intrinsic intrinsic;
+ SCM res;
+
+ UNPACK_24 (op, dst);
+ intrinsic = intrinsics[ip[1]];
+
+ SYNC_IP ();
+ res = intrinsic (thread);
+ CACHE_SP ();
+
+ SP_SET (dst, res);
+
+ NEXT (2);
+ }
+
VM_DEFINE_OP (93, unused_93, NULL, NOP)
VM_DEFINE_OP (94, unused_94, NULL, NOP)
VM_DEFINE_OP (95, unused_95, NULL, NOP)