Flush spurious assignments.
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Tue, 11 Aug 1992 02:37:45 +0000 (02:37 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Tue, 11 Aug 1992 02:37:45 +0000 (02:37 +0000)
v7/src/compiler/machines/spectrum/dassm2.scm

index d39da4a1b72985b15159194f0dfbe4f805ffbd35..dbe55e845bd2727bb795b205e6de9bf92ab230a3 100644 (file)
@@ -1,9 +1,9 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/dassm2.scm,v 4.17 1990/07/22 18:51:48 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/machines/spectrum/dassm2.scm,v 4.18 1992/08/11 02:37:45 jinx Exp $
 $MC68020-Header: dassm2.scm,v 4.17 90/05/03 15:17:04 GMT jinx Exp $
 
-Copyright (c) 1988, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1988-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -38,47 +38,40 @@ MIT in each case. |#
 
 (declare (usual-integrations))
 \f
-(set! compiled-code-block/bytes-per-object 4)
-(set! compiled-code-block/objects-per-procedure-cache 3)
-(set! compiled-code-block/objects-per-variable-cache 1)
+(define (disassembler/read-variable-cache block index)
+  (let-syntax ((ucode-type
+               (macro (name) (microcode-type name)))
+              (ucode-primitive
+               (macro (name arity)
+                 (make-primitive-procedure name arity))))
+    ((ucode-primitive primitive-object-set-type 2)
+     (ucode-type quad)
+     (system-vector-ref block index))))
 
-(set! disassembler/read-variable-cache
-      (lambda (block index)
-       (let-syntax ((ucode-type
-                     (macro (name) (microcode-type name)))
-                    (ucode-primitive
-                     (macro (name arity)
-                       (make-primitive-procedure name arity))))
-         ((ucode-primitive primitive-object-set-type 2)
-          (ucode-type quad)
-          (system-vector-ref block index)))))
+(define (disassembler/read-procedure-cache block index)
+  (fluid-let ((*block block))
+    (let* ((offset (compiled-code-block/index->offset index)))
+      ;; For now
+      (error "disassembler/read-procedure-cache: Not written"))))
 
-(set! disassembler/read-procedure-cache
-      (lambda (block index)
-       (fluid-let ((*block block))
-         (let* ((offset (compiled-code-block/index->offset index)))
-           ;; For now
-           (error "disassembler/read-procedure-cache: Not written")))))
-\f
-(set! disassembler/instructions
-  (lambda (block start-offset end-offset symbol-table)
-    (let loop ((offset start-offset) (state (disassembler/initial-state)))
-      (if (and end-offset (< offset end-offset))
-         (disassemble-one-instruction block offset symbol-table state
-           (lambda (offset* instruction state)
-             (make-instruction offset
-                               instruction
-                               (lambda () (loop offset* state)))))
-         '()))))
+(define (disassembler/instructions block start-offset end-offset symbol-table)
+  (let loop ((offset start-offset) (state (disassembler/initial-state)))
+    (if (and end-offset (< offset end-offset))
+       (disassemble-one-instruction
+        block offset symbol-table state
+        (lambda (offset* instruction state)
+          (make-instruction offset
+                            instruction
+                            (lambda () (loop offset* state)))))
+       '())))
 
-(set! disassembler/instructions/null?
-  null?)
+(define (disassembler/instructions/null? obj)
+  (null? obj))
 
-(set! disassembler/instructions/read
-  (lambda (instruction-stream receiver)
-    (receiver (instruction-offset instruction-stream)
-             (instruction-instruction instruction-stream)
-             (instruction-next instruction-stream))))
+(define (disassembler/instructions/read instruction-stream receiver)
+  (receiver (instruction-offset instruction-stream)
+           (instruction-instruction instruction-stream)
+           (instruction-next instruction-stream)))
 
 (define-structure (instruction (type vector))
   (offset false read-only true)
@@ -176,12 +169,11 @@ MIT in each case. |#
        (else
         'INSTRUCTION)))
 \f
-(set! disassembler/lookup-symbol
-  (lambda (symbol-table offset)
-    (and symbol-table
-        (let ((label (dbg-labels/find-offset symbol-table offset)))
-          (and label 
-               (dbg-label/name label))))))
+(define (disassembler/lookup-symbol symbol-table offset)
+  (and symbol-table
+       (let ((label (dbg-labels/find-offset symbol-table offset)))
+        (and label 
+             (dbg-label/name label)))))
 
 (define (external-label-marker? symbol-table offset state)
   (if symbol-table
@@ -254,4 +246,12 @@ MIT in each case. |#
             (label (disassembler/lookup-symbol *symbol-table absolute)))
        (if label
            `(@PCR ,label)
-           `(@PCO ,pco)))))
\ No newline at end of file
+           `(@PCO ,pco)))))
+
+(define compiled-code-block/procedure-cache-offset 0)
+(define compiled-code-block/objects-per-procedure-cache 3)
+(define compiled-code-block/objects-per-variable-cache 1)
+
+;; global variable used by runtime/udata.scm -- Moby yuck!
+
+(set! compiled-code-block/bytes-per-object 4)
\ No newline at end of file