Redesign interface to built-in object files, so that (1) they include
authorChris Hanson <org/chris-hanson/cph>
Sat, 14 Apr 2007 03:53:04 +0000 (03:53 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sat, 14 Apr 2007 03:53:04 +0000 (03:53 +0000)
the pathname type of the file, and (2) the mapping from pathnames to
handles is specified in fewer places.

v7/src/compiler/base/toplev.scm
v7/src/compiler/machines/C/compiler.pkg
v7/src/compiler/machines/C/cout.scm
v7/src/compiler/machines/C/ctop.scm
v7/src/edwin/autold.scm
v7/src/runtime/load.scm
v7/src/runtime/make.scm
v7/src/runtime/option.scm
v7/src/runtime/packag.scm
v7/src/runtime/runtime.pkg
v7/src/runtime/utabs.scm

index 6a80995e85047b9c4073ddaa55a4dc1808620087..0de85a1970b2bbefe4cf420d52c1dd94ab288dd0 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: toplev.scm,v 4.70 2007/01/05 21:19:20 cph Exp $
+$Id: toplev.scm,v 4.71 2007/04/14 03:52:22 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -139,28 +139,30 @@ USA.
         (and (not (default-object? output-string)) output-string)
         (make-pathname #f #f #f #f "bin" 'NEWEST)
         (lambda (input-pathname output-pathname)
-          (let ((scode (compiler-fasload input-pathname)))
-            (if (and (scode/constant? scode)
-                     (not compiler:compile-data-files-as-expressions?))
-                (compile-data-from-file scode output-pathname)
-                (maybe-open-file
-                 compiler:generate-rtl-files?
-                 (pathname-new-type output-pathname "rtl")
-                 (lambda (rtl-output-port)
-                   (maybe-open-file
-                    compiler:generate-lap-files?
-                    (pathname-new-type output-pathname "lap")
-                    (lambda (lap-output-port)
-                      (fluid-let ((*debugging-key*
-                                   (random-byte-vector 32)))
-                        (compile-scode/internal
-                         scode
-                         (pathname-new-type output-pathname "inf")
-                         rtl-output-port
-                         lap-output-port))))))))))
+          (fluid-let ((*compiler-input-pathname* input-pathname))
+            (let ((scode (compiler-fasload input-pathname)))
+              (if (and (scode/constant? scode)
+                       (not compiler:compile-data-files-as-expressions?))
+                  (compile-data-from-file scode output-pathname)
+                  (maybe-open-file
+                   compiler:generate-rtl-files?
+                   (pathname-new-type output-pathname "rtl")
+                   (lambda (rtl-output-port)
+                     (maybe-open-file
+                      compiler:generate-lap-files?
+                      (pathname-new-type output-pathname "lap")
+                      (lambda (lap-output-port)
+                        (fluid-let ((*debugging-key*
+                                     (random-byte-vector 32)))
+                          (compile-scode/internal
+                           scode
+                           (pathname-new-type output-pathname "inf")
+                           rtl-output-port
+                           lap-output-port)))))))))))
        unspecific)))
 
 (define *debugging-key*)
+(define *compiler-input-pathname*)
 
 (define (maybe-open-file open? pathname receiver)
   (if open?
index f22093a33e1cef57709d56d96869639197a973a9..698a9948b803aec62dd2859ef387b5dc49d8c767 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: compiler.pkg,v 1.21 2007/01/05 21:19:20 cph Exp $
+$Id: compiler.pkg,v 1.22 2007/04/14 03:52:27 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -256,6 +256,7 @@ USA.
          ;; lap->code
          )
   (export (compiler)
+         *compiler-input-pathname*
          canonicalize-label-name)
   (export (compiler fg-generator)
          compile-recursively)
index f5947ac6cf4549b2fa97416b796b55889f90877e..0617817ca68a2e882aed95e67d86f3a7fc79b7f7 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: cout.scm,v 1.34 2007/01/21 22:19:06 riastradh Exp $
+$Id: cout.scm,v 1.35 2007/04/14 03:52:31 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -45,9 +45,8 @@ USA.
               (else
                (let ((values-names (caar bindings))
                      (values-form (cadar bindings)))
-                 `(WITH-VALUES (LAMBDA () ,values-form)
-                    (LAMBDA ,values-names
-                      ,(recur (cdr bindings))))))))))))
+                 `(RECEIVE ,values-names ,values-form
+                    ,(recur (cdr bindings)))))))))))
 \f
 (define *use-stackify?* #t)
 (define *disable-nonces?* #f)
@@ -62,15 +61,7 @@ USA.
 
 (define (stringify-data/stackify object output-pathname)
   (let* ((str (stackify 0 object))
-        (handle (or (and output-pathname
-                         (let ((dir (pathname-directory output-pathname)))
-                           (string-append
-                            (if (or (not dir) (null? dir))
-                                ""
-                                (car (last-pair dir)))
-                            "_"
-                            (pathname-name output-pathname))))
-                    "handle"))
+        (handle (default-file-handle))
         (data-name
          (canonicalize-label-name
           (string-append handle "_data_" (make-nonce)))))
@@ -89,15 +80,7 @@ USA.
 
 (define (stringify-data/traditional object output-pathname)
   (let*/mv (((vars prefix suffix) (handle-top-level-data/traditional object))
-           (handle (or (and output-pathname
-                            (let ((dir (pathname-directory output-pathname)))
-                              (string-append
-                               (if (or (not dir) (null? dir))
-                                   ""
-                                   (car (last-pair dir)))
-                               "_"
-                               (pathname-name output-pathname))))
-                       "handle"))
+           (handle (default-file-handle))
            (data-name
             (canonicalize-label-name
              (string-append handle "_data_" (make-nonce)))))
@@ -118,6 +101,10 @@ USA.
   (c:group (c:data-section (declare-object handle proc))
           (c:line)
           (declare-dynamic-object-initialization handle)))
+
+(define (default-file-handle)
+  (or (liarc-object-pathname->handle *compiler-input-pathname*)
+      "handle"))
 \f
 (define (stringify suffix initial-label lap-code info-output-pathname)
   ;; returns <code-name data-name ntags symbol-table code proxy>
@@ -138,37 +125,25 @@ USA.
       (choose-name #f "" "" nonce))
 
     (define (choose-name full? default midfix nonce)
-      (let ((path (and info-output-pathname
-                      (merge-pathnames
-                       (if (pair? info-output-pathname)
-                           (car info-output-pathname)
-                           info-output-pathname)))))
-
-       (cond ((not *C-procedure-name*)
-              (string-append default suffix "_" nonce))
-             ((not (eq? *C-procedure-name* 'DEFAULT))
-              (string-append *C-procedure-name*
-                             midfix
-                             suffix))
-             ((not path)
-              (string-append default suffix "_" nonce))
-             ((or top-level? *disable-nonces?*)
-              (let ((dir (pathname-directory path)))
-                (string-append
-                 (if (or (not dir) (null? dir))
-                     default
-                     (canonicalize-name (car (last-pair dir)) full?))
-                 "_"
-                 (canonicalize-name (pathname-name path) full?)
-                 midfix
-                 suffix)))
-             (else
-              (string-append (canonicalize-name (pathname-name path) full?)
-                             "_"
-                             default
-                             suffix
-                             "_"
-                             nonce)))))
+      (cond ((not *C-procedure-name*)
+            (string-append default suffix "_" nonce))
+           ((not (eq? *C-procedure-name* 'DEFAULT))
+            (string-append *C-procedure-name*
+                           midfix
+                           suffix))
+           ((not info-output-pathname)
+            (string-append default suffix "_" nonce))
+           ((or top-level? *disable-nonces?*)
+            (string-append (canonicalize-name (default-file-handle) full?)
+                           midfix
+                           suffix))
+           (else
+            (string-append (canonicalize-name (default-file-handle) full?)
+                           "_"
+                           default
+                           suffix
+                           "_"
+                           nonce))))
 
     (define (subroutine-information)
       (let*/mv (((decls-1 code-1) (subroutine-information-1))
index 3c007b0eead6d3871f92201da854180685036954..25a3f964d6e3065f9af938fe0c5f0be8f5936441 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: ctop.scm,v 1.23 2007/01/28 23:03:06 riastradh Exp $
+$Id: ctop.scm,v 1.24 2007/04/14 03:52:35 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -60,21 +60,7 @@ USA.
      (load shared-library-pathname environment))))
 
 (define (compiler-output->compiled-expression compiler-output)
-  (finish-c-compilation
-   compiler-output
-   (lambda (pathname)
-     (let* ((handle ((ucode-primitive load-object-file 1)
-                    (->namestring pathname)))
-           (cth ((ucode-primitive object-lookup-symbol 3)
-                 handle "dload_initialize_file" 0)))
-       (if (not cth)
-          (error "compiler-output->compiled-expression:"
-                 "Cannot find init procedure"
-                 pathname))
-       ((ucode-primitive initialize-c-compiled-block 1)
-       ((ucode-primitive address-to-string 1)
-        ((ucode-primitive invoke-c-thunk 1)
-         cth)))))))
+  (finish-c-compilation compiler-output fasload-liarc-object-file))
 
 (define (compile-scode/internal/hook action)
   (if (not (eq? *info-output-filename* 'KEEP))
index 5744ccea402575078dc193881f144dd8091e351a..27d9320d885ed3f17b19037485acc864f279b850 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: autold.scm,v 1.69 2007/04/04 05:08:19 riastradh Exp $
+$Id: autold.scm,v 1.70 2007/04/14 03:52:39 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -156,15 +156,9 @@ USA.
   (for-each (lambda (entry)
              (let ((file (car entry))
                    (environment (->environment (cadr entry)))
-                   (purify? (or (null? (cddr entry)) (caddr entry))))
-               (cond (((let-syntax ((ucode-primitive
-                                     (sc-macro-transformer
-                                      (lambda (form environment)
-                                        environment
-                                        (apply make-primitive-procedure
-                                               (cdr form))))))
-                         (ucode-primitive initialize-c-compiled-block 1))
-                       (string-append "edwin_" file))
+                   (purify? (if (pair? (cddr entry)) (caddr entry) #t)))
+               (cond ((built-in-object-file
+                       (merge-pathnames file (pathname-as-directory "edwin")))
                       => (lambda (obj)
                            (if purify? (purify obj))
                            (scode-eval obj environment)))
index d09c73847dafec84e562952ad87d77f04b86862e..3b62b5417f432941e01c0f3e8a5c9cc328ffe01f 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: load.scm,v 14.87 2007/04/09 16:41:56 cph Exp $
+$Id: load.scm,v 14.88 2007/04/14 03:52:43 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -166,6 +166,11 @@ USA.
 
 (define (find-pathname filename default-types)
   (let ((pathname (merge-pathnames filename))
+       (find-loader
+        (lambda (extension)
+          (let ((place (assoc extension default-types)))
+            (and place
+                 (cadr place)))))
        (fail
         (lambda ()
           (find-pathname (error:file-operation filename
@@ -175,17 +180,17 @@ USA.
                                                find-pathname
                                                (list filename default-types))
                          default-types))))
-    (cond ((file-regular? pathname)
+    (cond ((built-in-object-file pathname)
+          => (lambda (value)
+               (values pathname
+                       ((find-loader #f) value))))
+         ((file-regular? pathname)
           (values pathname
-                  (let ((find-loader
-                         (lambda (extension)
-                           (let ((place (assoc extension default-types)))
-                             (and place
-                                  (cadr place))))))
-                    (or (and (pathname-type pathname)
-                             (find-loader (pathname-type pathname)))
-                        (find-loader "scm")
-                        (find-loader "bin")))))
+                  (or (and (pathname-type pathname)
+                           (find-loader (pathname-type pathname)))
+                      (and (fasl-file? pathname)
+                           (find-loader "bin"))
+                      (find-loader "scm"))))
          ((pathname-type pathname)
           (fail))
          (else
@@ -200,7 +205,7 @@ USA.
     (cond ((not (pair? types))
           (values #f #f))
          ((not (caar types))
-          (let ((value (try-built-in pathname)))
+          (let ((value (built-in-object-file pathname)))
             (if value
                 (values pathname ((cadar types) value))
                 (loop (cdr types)))))
@@ -220,7 +225,7 @@ USA.
     (cond ((not (pair? types))
           (values latest-pathname latest-loader))
          ((not (caar types))
-          (let ((value (try-built-in pathname)))
+          (let ((value (built-in-object-file pathname)))
             (if value
                 (values pathname ((cadar types) value))
                 (loop (cdr types)
@@ -236,39 +241,26 @@ USA.
                         latest-pathname
                         latest-loader
                         latest-time))))))))
-
-(define (try-built-in pathname)
-  (let ((d (pathname-directory pathname)))
-    (and (pair? d)
-        (let ((tail (last d)))
-          (and (string? tail)          ;Doesn't handle UP ("..").
-               ((ucode-primitive initialize-c-compiled-block 1)
-                (string-append tail
-                               "_"
-                               (pathname-name pathname))))))))
 \f
 (define (load/internal pathname environment purify? load-noisily?)
-  (let* ((port (open-input-file pathname))
-        (fasl-marker (peek-char port)))
-    (if (and (not (eof-object? fasl-marker))
-            (= 250 (char->ascii fasl-marker)))
-       (begin
-         (close-input-port port)
-         (load-scode-end (fasload/internal pathname
-                                           load/suppress-loading-message?)
-                         environment
-                         purify?))
-       (let ((value-stream
-              (lambda ()
-                (eval-stream (read-stream port environment) environment))))
-         (if load-noisily?
-             (write-stream (value-stream)
-                           (lambda (exp&value)
-                             (repl-write (cdr exp&value) (car exp&value))))
-             (with-loading-message pathname
-               (lambda ()
-                 (write-stream (value-stream)
-                               (lambda (exp&value) exp&value #f)))))))))
+  (if (fasl-file? pathname)
+      (load-scode-end (fasload/internal pathname
+                                       load/suppress-loading-message?)
+                     environment
+                     purify?)
+      (call-with-input-file pathname
+       (lambda (port)
+         (let ((value-stream
+                (lambda ()
+                  (eval-stream (read-stream port environment) environment))))
+           (if load-noisily?
+               (write-stream (value-stream)
+                             (lambda (exp&value)
+                               (repl-write (cdr exp&value) (car exp&value))))
+               (with-loading-message pathname
+                 (lambda ()
+                   (write-stream (value-stream)
+                                 (lambda (exp&value) exp&value #f))))))))))
 
 (define (fasload/internal pathname suppress-loading-message?)
   (let ((namestring (->namestring pathname)))
@@ -287,20 +279,41 @@ USA.
 (define (fasload-object-file pathname suppress-loading-message?)
   (with-loading-message pathname
     (lambda ()
-      (let* ((handle ((ucode-primitive load-object-file 1)
-                     (->namestring pathname)))
-            (cth ((ucode-primitive object-lookup-symbol 3)
-                  handle "dload_initialize_file" 0)))
-       (if (not cth)
-           (error "load-object-file: Cannot find init procedure" pathname))
-       (let ((scode ((ucode-primitive initialize-c-compiled-block 1)
-                     ((ucode-primitive address-to-string 1)
-                      ((ucode-primitive invoke-c-thunk 1)
-                       cth)))))
-         (fasload/update-debugging-info! scode pathname)
-         scode)))
+      (let ((scode (fasload-liarc-object-file pathname)))
+       (fasload/update-debugging-info! scode pathname)
+       scode))
     suppress-loading-message?))
 
+(define (fasload-liarc-object-file pathname)
+  (let* ((handle ((ucode-primitive load-object-file 1)
+                 (->namestring pathname)))
+        (cth ((ucode-primitive object-lookup-symbol 3)
+              handle "dload_initialize_file" 0)))
+    (if (not cth)
+       (error "Cannot find init procedure:" pathname))
+    ((ucode-primitive initialize-c-compiled-block 1)
+     ((ucode-primitive address-to-string 1)
+      ((ucode-primitive invoke-c-thunk 1)
+       cth)))))
+
+(define (built-in-object-file pathname)
+  (let ((handle (liarc-object-pathname->handle pathname)))
+    (and handle
+        ((ucode-primitive initialize-c-compiled-block 1) handle))))
+
+(define (liarc-object-pathname->handle pathname)
+  (let ((pathname (merge-pathnames pathname)))
+    (let ((d (pathname-directory pathname))
+         (n (pathname-name pathname))
+         (t (pathname-type pathname)))
+      (and (pair? d)
+          (let ((tail (last d)))
+            (and (string? tail)        ;Doesn't handle UP ("..").
+                 (string-append tail "_" n
+                                (cond ((not t) ".bin")
+                                      ((string? t) (string-append "." t))
+                                      (else "")))))))))
+
 (define (wrapper/fasload/built-in value)
   (lambda (pathname suppress-loading-message?)
     (with-loading-message pathname
@@ -429,6 +442,18 @@ USA.
              (loop (stream-car stream) (stream-cdr stream)))
            (cdr exp&value)))
       unspecific))
+
+(define (fasl-file? pathname)
+  (call-with-binary-input-file pathname
+    (lambda (port)
+      (let ((n (vector-ref (gc-space-status) 0)))
+       (let ((marker (make-string n)))
+         (and (eqv? (read-string! marker port) n)
+              (let loop ((i 0))
+                (if (fix:< i n)
+                    (and (fix:= (vector-8b-ref marker i) #xFA)
+                         (loop (fix:+ i 1)))
+                    #t))))))))
 \f
 ;;;; Command Line Parser
 
index bf26872486affbac5a988d7ab2e9048d57384a30..b6866f2c57f032f21e63fdad677ad8abc26edd05 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: make.scm,v 14.108 2007/01/05 21:19:28 cph Exp $
+$Id: make.scm,v 14.109 2007/04/14 03:52:47 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -243,7 +243,7 @@ USA.
               bin-file)))))
 
 (define (file->object filename purify? optional?)
-  (let* ((block-name (string-append "runtime_" filename))
+  (let* ((block-name (string-append "runtime_" filename ".bin"))
         (value (initialize-c-compiled-block block-name)))
     (cond (value
           (tty-write-string newline-string)
@@ -263,13 +263,19 @@ USA.
     (tty-write-string " evaluated")
     value))
 
-(define (string-append x y)
-  (let ((x-length (string-length x))
-       (y-length (string-length y)))
-    (let ((result (string-allocate (+ x-length y-length))))
-      (substring-move-right! x 0 x-length result 0)
-      (substring-move-right! y 0 y-length result x-length)
-      result)))
+(define (string-append . strings)
+  (let ((result
+        (string-allocate
+         (let loop ((strings strings) (n 0))
+           (if (pair? strings)
+               (loop (cdr strings) (fix:+ (string-length (car strings)) n))
+               n)))))
+    (let loop ((strings strings) (start 0))
+      (if (pair? strings)
+         (let ((n (string-length (car strings))))
+           (substring-move-right! (car strings) 0 n result start)
+           (loop (cdr strings) (fix:+ start n)))))
+    result))
 
 (define (string-downcase string)
   (let ((size (string-length string)))
@@ -285,8 +291,7 @@ USA.
 (define (intern string)
   (string->symbol (string-downcase string)))
 
-(define fasload-purification-queue
-  '())
+(define fasload-purification-queue '())
 
 (define (implemented-primitive-procedure? primitive)
   ((ucode-primitive get-primitive-address)
@@ -297,9 +302,7 @@ USA.
   (let ((prim (ucode-primitive initialize-c-compiled-block 1)))
     (if (implemented-primitive-procedure? prim)
        prim
-       (lambda (name)
-         name                          ; ignored
-         #f))))
+       (lambda (name) name #f))))
 
 (define os-name
   (intern os-name-string))
@@ -337,12 +340,15 @@ USA.
 (package/add-child! system-global-package 'PACKAGE environment-for-package)
 
 (define packages-file
-  (let ((name (cond ((eq? os-name 'NT) "runtime-w32")
-                   ((eq? os-name 'OS/2) "runtime-os2")
-                   ((eq? os-name 'UNIX) "runtime-unx")
-                   (else "runtime-unk"))))
+  (let ((name
+        (string-append "runtime-"
+                       (cond ((eq? os-name 'NT) "w32")
+                             ((eq? os-name 'OS/2) "os2")
+                             ((eq? os-name 'UNIX) "unx")
+                             (else "unk"))
+                       ".pkd")))
     (or (initialize-c-compiled-block (string-append "runtime_" name))
-       (fasload (string-append name ".pkd") #f))))
+       (fasload name #f))))
 
 ((lexical-reference environment-for-package 'CONSTRUCT-PACKAGES-FROM-FILE)
  packages-file)
index 8894e5f561e76b2238d92ac76aad6e3c804c4e15..c1373216e3ef06b514380a991c3876987a872653 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: option.scm,v 14.52 2007/01/05 21:19:28 cph Exp $
+$Id: option.scm,v 14.53 2007/04/14 03:52:51 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -114,27 +114,26 @@ USA.
   (lambda ()
     (let ((environment (package/environment (find-package package-name)))
          (runtime (pathname-as-directory "runtime")))
-      (for-each (lambda (file)
-                 (let ((file (force* file)))
-                   (cond 
-                    (((ucode-primitive initialize-c-compiled-block 1)
-                      (string-append "runtime_" file))
-                     => (lambda (obj)
-                          (purify obj)
-                          (scode-eval obj environment)))
-                    (else
-                     (let* ((options (library-directory-pathname "options"))
-                            (pathname (merge-pathnames file options)))
-                       (with-directory-rewriting-rule options runtime
+      (for-each
+       (lambda (file)
+        (let ((file (force* file)))
+          (cond ((built-in-object-file (merge-pathnames file runtime))
+                 => (lambda (obj)
+                      (purify obj)
+                      (scode-eval obj environment)))
+                (else
+                 (let* ((options (library-directory-pathname "options"))
+                        (pathname (merge-pathnames file options)))
+                   (with-directory-rewriting-rule options runtime
+                     (lambda ()
+                       (with-working-directory-pathname
+                           (directory-pathname pathname)
                          (lambda ()
-                           (with-working-directory-pathname
-                               (directory-pathname pathname)
-                             (lambda ()
-                               (load pathname
-                                     environment
-                                     'DEFAULT
-                                     #t))))))))))
-               files)
+                           (load pathname
+                                 environment
+                                 'DEFAULT
+                                 #t))))))))))
+       files)
       (flush-purification-queue!)
       (eval init-expression environment))))
 
index c83efaec3b17a0d93a6a902ac95e10daba982ba8..3236d3628a697bcf51fe6c58dab417027a3abe79 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: packag.scm,v 14.52 2007/04/04 18:35:16 riastradh Exp $
+$Id: packag.scm,v 14.53 2007/04/14 03:52:55 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -163,28 +163,21 @@ USA.
                    package-name-tag
                    system-global-package))
 \f
-(define system-loader/enable-query? #f)
-
-(define (quasi-fasload pathname)
-  (let ((prim (ucode-primitive initialize-c-compiled-block 1))
-       (path (merge-pathnames pathname)))
-    (or (and (implemented-primitive-procedure? prim)
-            (prim (string-append (car (last-pair (pathname-directory path)))
-                                 "_"
-                                 (pathname-name path))))
-       (fasload pathname))))
-
 (define (load-package-set filename #!optional options)
-  (let ((os-type microcode-id/operating-system))
-    (let ((pathname (package-set-pathname filename os-type))
+  (let ((pathname (merge-pathnames filename))
+       (os-type microcode-id/operating-system))
+    (let ((dir (directory-pathname pathname))
+         (pkg (package-set-pathname pathname os-type))
          (options
           (cons (cons 'OS-TYPE os-type)
                 (if (default-object? options) '() options))))
-      (with-working-directory-pathname (directory-pathname pathname)
+      (with-working-directory-pathname dir
        (lambda ()
-         (let ((file (quasi-fasload pathname)))
+         (let ((file
+                (or (built-in-object-file pkg)
+                    (fasload pkg))))
            (if (not (package-file? file))
-               (error "Malformed package-description file:" pathname))
+               (error "Malformed package-description file:" pkg))
            (construct-packages-from-file file)
            (fluid-let
                ((load/default-types
@@ -196,14 +189,13 @@ USA.
              (let ((alternate-loader
                     (lookup-option 'ALTERNATE-PACKAGE-LOADER options))
                    (load-component
-                    (lambda (component environment)
-                      (let ((value
-                             (filename->compiled-object filename component)))
+                    (lambda (name environment)
+                      (let ((value (filename->compiled-object dir name)))
                         (if value
                             (begin
                               (purify (load/purification-root value))
                               (scode-eval value environment))
-                            (load component environment 'DEFAULT #t))))))
+                            (load name environment 'DEFAULT #t))))))
                (if alternate-loader
                    (alternate-loader load-component options)
                    (begin
@@ -213,41 +205,32 @@ USA.
   ;; program runs before it gets purified, some of its run-time state
   ;; can end up being purified also.
   (flush-purification-queue!))
-\f
+
+(define system-loader/enable-query? #f)
+
 (define (package-set-pathname pathname #!optional os-type)
-  (make-pathname (pathname-host pathname)
-                (pathname-device pathname)
-                (pathname-directory pathname)
-                (string-append (pathname-name pathname)
-                               (case (if (default-object? os-type)
-                                         microcode-id/operating-system
-                                         os-type)
-                                 ((NT) "-w32")
-                                 ((OS/2) "-os2")
-                                 ((UNIX) "-unx")
-                                 (else "-unk")))
-                "pkd"
-                (pathname-version pathname)))
-
-(define (filename->compiled-object system component)
-  (let ((prim (ucode-primitive initialize-c-compiled-block 1)))
-    (and (implemented-primitive-procedure? prim)
-        (let* ((name
-                (let* ((p (->pathname component))
-                       (d (pathname-directory p)))
-                  (string-append
-                   (if (pair? d) (car (last-pair d)) system)
-                   "_"
-                   (pathname-name p))))
-               (value (prim name)))
-          (if (or (not value) load/suppress-loading-message?)
-              value
-               (begin
-                 (write-notification-line
-                  (lambda (port)
-                    (write-string "Initialized " port)
-                    (write name port)))
-                 value))))))
+  (pathname-new-type
+   (pathname-new-name pathname
+                     (string-append (pathname-name pathname)
+                                    "-"
+                                    (case (if (default-object? os-type)
+                                              microcode-id/operating-system
+                                              os-type)
+                                      ((NT) "w32")
+                                      ((OS/2) "os2")
+                                      ((UNIX) "unx")
+                                      (else "unk"))))
+   "pkd"))
+
+(define (filename->compiled-object directory name)
+  (let ((pathname (merge-pathnames name directory)))
+    (let ((value (built-in-object-file pathname)))
+      (if (and value (not load/suppress-loading-message?))
+         (write-notification-line
+          (lambda (port)
+            (write-string "Initialized " port)
+            (write (enough-namestring pathname) port))))
+      value)))
 \f
 (define-integrable (make-package-file tag version descriptions loads)
   (vector tag version descriptions loads))
index 4ce3031330f570b3943b1d9092d14371e86538dc..824b69f1eec7dcf5704ee5929827cdd692e7ecbf 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.614 2007/04/01 17:33:07 riastradh Exp $
+$Id: runtime.pkg,v 14.615 2007/04/14 03:52:59 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -2407,12 +2407,16 @@ USA.
   (parent (runtime))
   (export ()
          argument-command-line-parser
+         built-in-object-file
          condition-type:not-loading
          current-eval-unit
          current-load-pathname
+         fasl-file?
          fasload
          fasload-latest
+         fasload-liarc-object-file
          fasload/default-types
+         liarc-object-pathname->handle
          load
          load-latest
          load-library-object-file
index 8979792e27cd4ab1297dd72f11ad4ccaa7db650f..7f15ea073515519f45175b2b661ad3e52a970dce 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: utabs.scm,v 14.22 2007/01/05 21:19:28 cph Exp $
+$Id: utabs.scm,v 14.23 2007/04/14 03:53:04 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -56,11 +56,8 @@ USA.
 (define (read-microcode-tables! #!optional filename)
   (set! microcode-tables-identification
        (scode-eval
-        (or (let ((prim ((ucode-primitive get-primitive-address)
-                         'initialize-c-compiled-block
-                         #f)))
-              (and prim
-                   (prim "microcode_utabmd")))
+        (or ((ucode-primitive initialize-c-compiled-block 1)
+             "microcode_utabmd.bin")
             ((ucode-primitive binary-fasload)
              (if (default-object? filename)
                  ((ucode-primitive microcode-tables-filename))