Encode the length of constant lists/vectors on 2 octets instead of 1.
* module/system/vm/assemble.scm (dump-object!): New sub-procedure `too-long'. For `list' and `vector', encode the length on 2 octets instead of 1 and report an error if a list/vector is longer than 65535. * module/system/vm/disasm.scm (original-value): New sub-procedure `list-or-vector?'; when true, return the number of elements for that list/vector. * src/vm_system.c (list): Fetch the length as a two-octet integer. (vector): Likewise. * testsuite/t-basic-contructs.scm: New. * testsuite/Makefile.am (vm_test_files): Added the above file. * module/system/vm/core.scm (load-compiled): Added a bit of documentation. git-archimport-id: lcourtes@laas.fr--2005-mobile/guile-vm--mobile--0.6--patch-11
This commit is contained in:
parent
a55572bf3d
commit
23b587b0a1
6 changed files with 48 additions and 10 deletions
|
|
@ -4,6 +4,7 @@
|
|||
GUILE_VM = $(top_srcdir)/src/guile-vm
|
||||
|
||||
vm_test_files = \
|
||||
t-basic-contructs.scm \
|
||||
t-global-bindings.scm \
|
||||
t-closure.scm \
|
||||
t-closure2.scm \
|
||||
|
|
|
|||
16
testsuite/t-basic-contructs.scm
Normal file
16
testsuite/t-basic-contructs.scm
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
;;; Basic RnRS constructs.
|
||||
|
||||
(and (eq? 2 (begin (+ 2 4) 5 2))
|
||||
((lambda (x y)
|
||||
(and (eq? x 1) (eq? y 2)
|
||||
(begin
|
||||
(set! x 11) (set! y 22)
|
||||
(and (eq? x 11) (eq? y 22)))))
|
||||
1 2)
|
||||
(let ((x 1) (y 3))
|
||||
(and (eq? x 1) (eq? y 3)))
|
||||
(let loop ((x #t))
|
||||
(if (not x)
|
||||
#t
|
||||
(loop #f))))
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue