summaryrefslogtreecommitdiff
path: root/module/language/cps/compile-bytecode.scm
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2018-05-13 10:23:28 +0200
committerAndy Wingo <wingo@pobox.com>2018-05-14 14:04:54 +0200
commitfb344a25d5fab1714eb1d5ca66bad96fb4834855 (patch)
tree496697ce8faf53d003e94b52fd45339eac66b810 /module/language/cps/compile-bytecode.scm
parent16a996f052f381d915288bc4f39dfc4c21930295 (diff)
downloadguile-fb344a25d5fab1714eb1d5ca66bad96fb4834855.tar.gz
Add intrinsics for module operations
* libguile/intrinsics.c (scm_bootstrap_intrinsics): * libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS): * module/system/vm/assembler.scm (resolve-module, lookup): New intrinsics. * module/language/cps/compile-bytecode: Add cases for primcalls corresponding to new intrinsics.
Diffstat (limited to 'module/language/cps/compile-bytecode.scm')
-rw-r--r--module/language/cps/compile-bytecode.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/module/language/cps/compile-bytecode.scm b/module/language/cps/compile-bytecode.scm
index 88da19421..426942c21 100644
--- a/module/language/cps/compile-bytecode.scm
+++ b/module/language/cps/compile-bytecode.scm
@@ -175,6 +175,10 @@
(($ $primcall 'tail-pointer-ref/immediate (annotation . idx) (obj))
(emit-tail-pointer-ref/immediate asm (from-sp dst) (from-sp (slot obj))
idx))
+ (($ $primcall 'resolve-module public? (name))
+ (emit-resolve-module asm (from-sp dst) (from-sp (slot name)) public?))
+ (($ $primcall 'lookup #f (mod name))
+ (emit-lookup asm (from-sp dst) (from-sp (slot mod)) (from-sp (slot name))))
(($ $primcall 'add/immediate y (x))
(emit-add/immediate asm (from-sp dst) (from-sp (slot x)) y))
(($ $primcall 'sub/immediate y (x))