Changeset 10282


Ignore:
Timestamp:
Aug 4, 2008, 3:33:13 AM (11 years ago)
Author:
gb
Message:

Early changes to support "istruct cells", which can speed up type/class
operations on istructs.

Some of this is hard to bootstrap, and bootstrapping may involve slowing
things down (e.g., not inlining things) while representations change.

Binaries coming soon.

Location:
trunk/source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-pred.lisp

    r10247 r10282  
    10101010(defun istruct-typep (thing type)
    10111011  (if (= (the fixnum (typecode thing)) target::subtag-istruct)
     1012    (let* ((cell (%svref thing 0)))
     1013      (eq (if (atom cell) cell (car cell))
     1014          (if (atom type) type (car type))))
     1015    #+istruct-bootstrap
    10121016    (eq (%svref thing 0) type)))
     1017
     1018(defun istruct-type-name (thing)
     1019  (if (= (the fixnum (typecode thing)) target::subtag-istruct)
     1020    (istruct-cell-name (%svref thing 0))))
     1021
     1022
     1023;;; This is actually set to an alist in the xloader.
     1024(defparameter *istruct-cells* nil)
     1025
     1026;;; This should only ever push anything on the list in the cold
     1027;;; load (e.g., when running single-threaded.)
     1028(defun register-istruct-cell (name)
     1029  (or (assq name *istruct-cells*)
     1030      (let* ((pair (cons name nil)))
     1031        (push pair *istruct-cells*)
     1032        pair)))
     1033
     1034(defun set-istruct-cell-info (cell info)
     1035  (etypecase cell
     1036    (cons (%rplacd cell info)))
     1037  info)
     1038
    10131039
    10141040(defun symbolp (thing)
  • trunk/source/level-0/nfasload.lisp

    r10154 r10282  
    687687  (provide (%fasl-expr s)))   
    688688
     689(deffaslop $fasl-istruct-cell (s)
     690  (%epushval s (register-istruct-cell (%fasl-expr-preserve-epush s))))
    689691
    690692;;; The loader itself
  • trunk/source/lib/nfcomp.lisp

    r10119 r10282  
    10871087       (null (%cddr form))))
    10881088
     1089;;; We currently represent istruct-cells as conses.  That's not
     1090;;; incredibly efficient (among other things, we have to do this
     1091;;; check when scanning/dumping any list, but it's probably not
     1092;;; worth burning a tag on them.  There are currently about 50
     1093;;; entries on the *istruct-cells* list.
     1094(defun istruct-cell-p (x)
     1095  #-bootstrap-istruct (declare (ignore x))
     1096  #+bootstrap-istruct
     1097  (and (consp x)
     1098       (typep (%car x) 'symbol)
     1099       (atom (%cdr x))
     1100       (not (null (memq x *istruct-cells*)))))
     1101
    10891102(defun fasl-scan-list (list)
    10901103  (cond ((eq (%car list) cfasl-load-time-eval-sym)
     
    10931106                             (%cadr form)
    10941107                             form))))
     1108        ((istruct-cell-p list)
     1109         (fasl-scan-form (%car list)))       
    10951110        (t (when list
    10961111             (fasl-scan-ref list)
     
    15651580               (fasl-out-byte opcode)
    15661581               (fasl-dump-form form)))))
     1582        ((istruct-cell-p list)
     1583         (fasl-out-opcode $fasl-istruct-cell (car list))
     1584         (fasl-dump-symbol (car list)))       
    15671585        (t (fasl-dump-cons list))))
    15681586
  • trunk/source/xdump/faslenv.lisp

    r9917 r10282  
    122122(defconstant $fasl-nvmksym 68)          ;<nvstring> Make a string
    123123(defconstant $fasl-nvstr 69)            ;<nvstring> Make an uninterned symbol
     124(defconstant $fasl-toplevel-location 70);<expr> - Set *loading-toplevel-location* to <expr>
     125(defconstant $fasl-istruct-cell 71)     ;<expr> register istruct cell for expr
    124126
    125127
Note: See TracChangeset for help on using the changeset viewer.