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

superstition with no important effect

* module/system/vm/assemble.scm (dump-object!): Some superstition, use
  bit arithmetic instead of int arithmetic. Makes me happier.
This commit is contained in:
Andy Wingo 2008-09-02 00:15:26 -07:00
parent 22f4ee4882
commit 97f1153a86

View file

@ -252,8 +252,9 @@
(cond
((and (< nargs 16) (< nlocs 128) (< nexts 16))
;; 16-bit representation
(let ((x (+ (* nargs 4096) (* nrest 2048) (* nlocs 16) nexts)))
(push-code! `(make-int16 ,(quotient x 256) ,(modulo x 256)))))
(let ((x (logior
(ash nargs 12) (ash nrest 11) (ash nlocs 4) nexts)))
(push-code! `(make-int16 ,(ash x -8) ,(logand x (1- (ash 1 8)))))))
(else
;; Other cases
(push-code! (object->code nargs))