From 97f1153a86b219699605bd08548f9950f1198ca2 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 2 Sep 2008 00:15:26 -0700 Subject: [PATCH] superstition with no important effect * module/system/vm/assemble.scm (dump-object!): Some superstition, use bit arithmetic instead of int arithmetic. Makes me happier. --- module/system/vm/assemble.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module/system/vm/assemble.scm b/module/system/vm/assemble.scm index 6827de606..b7f573eb1 100644 --- a/module/system/vm/assemble.scm +++ b/module/system/vm/assemble.scm @@ -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))