1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 16:50:21 +02:00

Add new lookup, lookup-bound intrinsics

* libguile/intrinsics.h (SCM_FOR_ALL_VM_INTRINSICS):
* libguile/intrinsics.c (lookup, lookup_bound):
* libguile/intrinsics.c (scm_bootstrap_intrinsics): New intrinsics.
* module/language/cps/reify-primitives.scm (reify-primitives):
* module/language/cps/effects-analysis.scm (current-module):
* module/language/cps/compile-bytecode.scm (compile-function):
* module/system/vm/assembler.scm: Add compiler support.
This commit is contained in:
Andy Wingo 2020-05-11 10:00:30 +02:00
parent d6b6392cfb
commit 4274d615cc
6 changed files with 42 additions and 1 deletions

View file

@ -189,6 +189,12 @@
(($ $primcall 'module-variable #f (mod name))
(emit-module-variable asm (from-sp dst) (from-sp (slot mod))
(from-sp (slot name))))
(($ $primcall 'lookup #f (mod name))
(emit-lookup asm (from-sp dst) (from-sp (slot mod))
(from-sp (slot name))))
(($ $primcall 'lookup-bound #f (mod name))
(emit-lookup-bound 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))