source: trunk/abcl/src/org/armedbear/lisp/boot.lisp @ 14031

Last change on this file since 14031 was 14031, checked in by ehuelsmann, 9 years ago

The precompiler has significant performance benefit in
interpreted code. Load as early as possible and don't
leave to the autoloader to do it.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.5 KB
Line 
1;;; boot.lisp
2;;;
3;;; Copyright (C) 2003-2007 Peter Graves <peter@armedbear.org>
4;;; $Id: boot.lisp 14031 2012-07-31 18:04:52Z ehuelsmann $
5;;;
6;;; This program is free software; you can redistribute it and/or
7;;; modify it under the terms of the GNU General Public License
8;;; as published by the Free Software Foundation; either version 2
9;;; of the License, or (at your option) any later version.
10;;;
11;;; This program is distributed in the hope that it will be useful,
12;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with this program; if not, write to the Free Software
18;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19;;;
20;;; As a special exception, the copyright holders of this library give you
21;;; permission to link this library with independent modules to produce an
22;;; executable, regardless of the license terms of these independent
23;;; modules, and to copy and distribute the resulting executable under
24;;; terms of your choice, provided that you also meet, for each linked
25;;; independent module, the terms and conditions of the license of that
26;;; module.  An independent module is a module which is not derived from
27;;; or based on this library.  If you modify this library, you may extend
28;;; this exception to your version of the library, but you are not
29;;; obligated to do so.  If you do not wish to do so, delete this
30;;; exception statement from your version.
31
32(sys:%in-package "SYSTEM")
33
34(setq *load-verbose*     nil)
35(setq *autoload-verbose* nil)
36
37;; Redefined in macros.lisp.
38(defmacro in-package (name)
39  (list '%in-package (string name)))
40
41(defmacro lambda (lambda-list &rest body)
42  (list 'function (list* 'lambda lambda-list body)))
43
44(defmacro named-lambda (name lambda-list &rest body)
45  (list 'function (list* 'named-lambda name lambda-list body)))
46
47;; Redefined in macros.lisp.
48(defmacro return (&optional result)
49  (list 'return-from nil result))
50
51;; Redefined in precompiler.lisp.
52(defmacro defun (name lambda-list &rest body)
53  (let ((block-name (fdefinition-block-name name)))
54    (list '%defun
55          (list 'quote name)
56          (list 'lambda lambda-list (list* 'block block-name body)))))
57
58;; Redefined in macros.lisp.
59(defmacro defconstant (name initial-value &optional docstring)
60  (list '%defconstant (list 'quote name) initial-value docstring))
61
62;; Redefined in macros.lisp.
63(defmacro defparameter (name initial-value &optional docstring)
64  (list '%defparameter (list 'quote name) initial-value docstring))
65
66(defmacro declare (&rest ignored) nil)
67
68(in-package #:extensions)
69
70(export '(%car %cdr %cadr %caddr))
71
72(defmacro %car (x)
73  (list 'car (list 'truly-the 'cons x)))
74
75(defmacro %cdr (x)
76  (list 'cdr (list 'truly-the 'cons x)))
77
78(defmacro %cadr (x)
79  (list '%car (list '%cdr x)))
80
81(defmacro %caddr (x)
82  (list '%car (list '%cdr (list '%cdr x))))
83
84(in-package #:system)
85
86;; Redefined in precompiler.lisp.
87(defun eval (form)
88  (%eval form))
89
90;; Redefined in pprint.lisp.
91(defun terpri (&optional output-stream)
92  (%terpri output-stream))
93
94;; Redefined in pprint.lisp.
95(defun fresh-line (&optional output-stream)
96  (%fresh-line output-stream))
97
98;; Redefined in pprint.lisp.
99(defun write-char (character &optional output-stream)
100  (%write-char character output-stream))
101
102(in-package #:extensions)
103
104;; Redefined in pprint.lisp.
105(defun charpos (stream)
106  (sys::stream-charpos stream))
107
108;; Redefined in pprint.lisp.
109(defun (setf charpos) (new-value stream)
110  (sys::stream-%set-charpos stream new-value))
111
112(export 'charpos '#:extensions)
113
114;; Redefined in precompiler.lisp.
115(defun precompile (name &optional definition)
116  (declare (ignore name definition))
117  nil)
118
119(export 'precompile '#:extensions)
120
121(in-package #:system)
122
123(defun simple-format (destination control-string &rest args)
124  (apply #'format destination control-string args))
125
126(export 'simple-format '#:system)
127
128;; INVOKE-DEBUGGER is redefined in debug.lisp.
129(defun invoke-debugger (condition)
130  (sys::%format t "~A~%" condition)
131  (ext:quit))
132
133;;Redefined in extensible-sequences.lisp
134(defun length (sequence)
135  (%length sequence))
136
137(defun elt (sequence index)
138  (%elt sequence index))
139
140(defun subseq (sequence start &optional end)
141  (sys::%subseq sequence start end))
142
143(defun reverse (sequence)
144  (sys::%reverse sequence))
145
146(defun nreverse (sequence)
147  (sys::%nreverse sequence))
148
149(load-system-file "autoloads")
150(load-system-file "early-defuns")
151(load-system-file "backquote")
152(load-system-file "destructuring-bind")
153(load-system-file "defmacro")
154(load-system-file "setf")
155(load-system-file "fdefinition")
156(load-system-file "featurep")
157(load-system-file "read-conditional")
158(load-system-file "macros")
159
160;; Redefined in package.lisp
161(defun make-package (package-name &key nicknames use)
162  (%make-package package-name nicknames use))
163
164(load-system-file "read-circle")
165
166(copy-readtable +standard-readtable+ *readtable*)
167
168;; SYS::%COMPILE is redefined in precompiler.lisp.
169(defun sys::%compile (name definition)
170  (values (if name name definition) nil nil))
171
172(load-system-file "inline")
173(load-system-file "proclaim")
174(load-system-file "arrays")
175(load-system-file "compiler-macro")
176(load-system-file "subtypep")
177(load-system-file "typep")
178(load-system-file "signal")
179(load-system-file "list")
180(load-system-file "require")
181;; precompiler has a large performance benefit on interpreted code
182;; load as early as possible
183(load-system-file "precompiler")
184(load-system-file "extensible-sequences-base")
185(load-system-file "sequences")
186(load-system-file "error")
187(load-system-file "defpackage")
188(load-system-file "define-modify-macro")
189(load-system-file "defstruct")
190
191;; The actual stream and system-stream classes
192;; are created in BuiltInClass.java, however, that code does not
193;; set up the structure internals correctly: we wouldn't be able
194;; to :include the structure classes. Fix that here.
195(defstruct (stream (:constructor nil)
196                   (:copier nil)
197                   (:predicate nil)))  ;; Predicate STREAMP defined elsewhere
198(defstruct (system-stream (:include stream)
199                          (:constructor nil)
200                          (:copier nil)))
201
202(load-system-file "restart")
203(load-system-file "late-setf")
204(load-system-file "debug")
205(load-system-file "print")
206(load-system-file "pprint-dispatch")
207(load-system-file "defsetf")
208(load-system-file "package")
209
210(unless (featurep :j)
211  (unless *noinform*
212    (%format t "Startup completed in ~A seconds.~%"
213             (float (/ (ext:uptime) 1000)))))
214
215
Note: See TracBrowser for help on using the repository browser.