Update of /project/movitz/cvsroot/movitz/losp/muerte In directory common-lisp.net:/tmp/cvs-serv19808
Modified Files: scavenge.lisp Log Message: The layout of heap objects has been changed such that the type-code is now the "first" byte in the object.
Date: Fri May 21 05:40:20 2004 Author: ffjeld
Index: movitz/losp/muerte/scavenge.lisp diff -u movitz/losp/muerte/scavenge.lisp:1.6 movitz/losp/muerte/scavenge.lisp:1.7 --- movitz/losp/muerte/scavenge.lisp:1.6 Tue Apr 6 20:34:52 2004 +++ movitz/losp/muerte/scavenge.lisp Fri May 21 05:40:19 2004 @@ -10,7 +10,7 @@ ;;;; Author: Frode Vatvedt Fjeld frodef@acm.org ;;;; Created at: Mon Mar 29 14:54:08 2004 ;;;; -;;;; $Id: scavenge.lisp,v 1.6 2004/04/07 00:34:52 ffjeld Exp $ +;;;; $Id: scavenge.lisp,v 1.7 2004/05/21 09:40:19 ffjeld Exp $ ;;;; ;;;;------------------------------------------------------------------
@@ -54,10 +54,11 @@ (error "Illegal word ~Z at ~S." x scan)) ((scavenge-typep x :funobj) ;; Process code-vector pointer specially.. - (let ((code-vector (%word-offset (memref scan 0 -1 :lisp) -2)) - (num-jumpers (ldb (byte 14 0) (memref scan 0 6 :lisp)))) + (let* ((funobj (%word-offset scan #.(movitz:tag :other))) + (code-vector (funobj-code-vector funobj)) + (num-jumpers (funobj-num-jumpers funobj))) (check-type code-vector vector-u8) - (map-heap-words function (+ scan 4) (+ scan 6)) ; scan funobj's lambda-list and name fields + (map-heap-words function (+ scan 5) (+ scan 7)) ; scan funobj's lambda-list and name (let ((new-code-vector (funcall function code-vector scan))) (check-type new-code-vector vector-u8) (unless (eq code-vector new-code-vector) @@ -65,21 +66,21 @@ (setf (memref scan 0 -1 :lisp) (%word-offset new-code-vector 2)) ;; Do more stuff here to update code-vectors and jumpers )) - (incf scan (+ 6 num-jumpers)))) ; Don't scan the jumpers. + (incf scan (+ 7 num-jumpers)))) ; Don't scan the jumpers. ((scavenge-typep x :infant-object) (error "Scanning an infant object ~Z at ~S." x scan)) ((or (scavenge-wide-typep x :vector #.(bt:enum-value 'movitz:movitz-vector-element-type :u8)) (scavenge-wide-typep x :vector #.(bt:enum-value 'movitz:movitz-vector-element-type :character))) - (let ((len (memref scan -2 0 :unsigned-byte16))) - (incf scan (* 2 (truncate (+ 7 len) 8))))) + (let ((len (memref scan 2 0 :unsigned-byte16))) + (incf scan (1+ (* 2 (truncate (+ 7 len) 8)))))) ((scavenge-wide-typep x :vector #.(bt:enum-value 'movitz:movitz-vector-element-type :u16)) - (let ((len (memref scan -2 0 :unsigned-byte16))) - (incf scan (* 2 (truncate (+ 3 len) 4))))) + (let ((len (memref scan 2 0 :unsigned-byte16))) + (incf scan (1+ (* 2 (truncate (+ 3 len) 4)))))) ((scavenge-wide-typep x :vector #.(bt:enum-value 'movitz:movitz-vector-element-type :u32)) - (let ((len (memref scan -2 0 :unsigned-byte16))) - (incf scan (* 2 (truncate (+ 1 len) 2))))) + (let ((len (memref scan 2 0 :unsigned-byte16))) + (incf scan (1+ (* 2 (truncate (+ 1 len) 2)))))) ((eq x (fixnum-word 3)) (incf scan) (incf scan (memref scan 0 0 :lisp)))