Abstract out the operation that decides how to purify compiled code,
authorChris Hanson <org/chris-hanson/cph>
Fri, 18 Aug 1989 19:10:01 +0000 (19:10 +0000)
committerChris Hanson <org/chris-hanson/cph>
Fri, 18 Aug 1989 19:10:01 +0000 (19:10 +0000)
call it `load/purification'.  This is used by the cold-loader.

v7/src/runtime/load.scm
v8/src/runtime/load.scm

index 87e3f9eee56b7345fbbe93cb82d7a53886dad986..9ecb908253340efffecea566f748319901a442d8 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/load.scm,v 14.9 1989/08/17 16:02:55 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/runtime/load.scm,v 14.10 1989/08/18 19:10:01 cph Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -169,13 +169,7 @@ MIT in each case. |#
             (let ((scode
                    (fasload/internal true-pathname
                                      load/suppress-loading-message?)))
-              (if purify?
-                  (purify
-                   (or (and (comment? scode)
-                            (let ((text (comment-text scode)))
-                              (and (dbg-info-vector? text)
-                                   (dbg-info-vector/purification-root text))))
-                       scode)))
+              (if purify? (purify (load/purification-root scode)))
               scode)
             (if (eq? environment default-object)
                 (nearest-repl/environment)
@@ -191,6 +185,14 @@ MIT in each case. |#
                  (lambda ()
                    (write-stream (value-stream)
                                  (lambda (value) value false))))))))))
+
+(define (load/purification-root scode)
+  (or (and (comment? scode)
+          (let ((text (comment-text scode)))
+            (and (dbg-info-vector? text)
+                 (dbg-info-vector/purification-root text))))
+      scode))
+
 (define (read-stream port)
   (parse-objects port
                 (current-parser-table)
index 131f83171910b5d176a24da87d096f085dea4fed..57fd4ad81e0ff89fa9c06523993f4fbe2a00158c 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/load.scm,v 14.9 1989/08/17 16:02:55 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/runtime/load.scm,v 14.10 1989/08/18 19:10:01 cph Exp $
 
 Copyright (c) 1988, 1989 Massachusetts Institute of Technology
 
@@ -169,13 +169,7 @@ MIT in each case. |#
             (let ((scode
                    (fasload/internal true-pathname
                                      load/suppress-loading-message?)))
-              (if purify?
-                  (purify
-                   (or (and (comment? scode)
-                            (let ((text (comment-text scode)))
-                              (and (dbg-info-vector? text)
-                                   (dbg-info-vector/purification-root text))))
-                       scode)))
+              (if purify? (purify (load/purification-root scode)))
               scode)
             (if (eq? environment default-object)
                 (nearest-repl/environment)
@@ -191,6 +185,14 @@ MIT in each case. |#
                  (lambda ()
                    (write-stream (value-stream)
                                  (lambda (value) value false))))))))))
+
+(define (load/purification-root scode)
+  (or (and (comment? scode)
+          (let ((text (comment-text scode)))
+            (and (dbg-info-vector? text)
+                 (dbg-info-vector/purification-root text))))
+      scode))
+
 (define (read-stream port)
   (parse-objects port
                 (current-parser-table)