mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-15 08:10:17 +02:00
add `nil?' primitive
* libguile/boolean.c (scm_nil_p): New function. * libguile/vm-i-scheme.c (nilp, not_nilp): * libguile/vm-i-system.c (br_if_nil, br_if_not_nil): New instructions. Renumber other ops. * libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Increment. * module/language/assembly/compile-bytecode.scm (compile-bytecode): Add support for writing `br-if-nil' and `br-if-not-nil' instructions. * module/language/assembly/disassemble.scm (code-annotation): Add `br-if-nil' and `br-if-not-nil' to the list of branch instructions. * module/language/tree-il/compile-glil.scm: Add `nil?' to `*primcall-ops*'. (flatten): Use the new branch instructions for `nil?' conditionals. * module/language/tree-il/primitives.scm: Add `nil?' to `*interesting-primitive-names*', `*effect-free-primitives', and `*effect+exception-free-primitives*'.
This commit is contained in:
parent
6937c7aa8b
commit
9348168ed5
8 changed files with 180 additions and 132 deletions
|
@ -133,6 +133,8 @@
|
|||
((br-if-not-eq ,l) (write-break l))
|
||||
((br-if-null ,l) (write-break l))
|
||||
((br-if-not-null ,l) (write-break l))
|
||||
((br-if-nil ,l) (write-break l))
|
||||
((br-if-not-nil ,l) (write-break l))
|
||||
((br-if-nargs-ne ,hi ,lo ,l) (write-byte hi) (write-byte lo) (write-break l))
|
||||
((br-if-nargs-lt ,hi ,lo ,l) (write-byte hi) (write-byte lo) (write-break l))
|
||||
((br-if-nargs-gt ,hi ,lo ,l) (write-byte hi) (write-byte lo) (write-break l))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue