Changeset 12357


Ignore:
Timestamp:
Jul 2, 2009, 11:50:20 PM (10 years ago)
Author:
rme
Message:

With these changes, the lisp compiles itself using the new scheme
for encoding the number of code words in a function.

It dies during the cold load loading l1-clos-boot, at the first use
of defmethod.

Location:
branches/x8632-functions
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/x8632-functions/compiler/X86/x86-asm.lisp

    r12349 r12357  
    33773377   (def-x86-opcode uuo-error-reg-not-fixnum ((:reg :insert-opcode-reg4))
    33783378     #xcdf0 nil 0)
    3379 
    33803379   ))
    33813380
    3382 (defun init-opcode-ordinals ()
    3383   (dotimes (i (length *x86-opcode-templates*))
    3384     (setf (x86-opcode-template-ordinal (svref *x86-opcode-templates* i)) i)))
    3385 
    3386 (init-opcode-ordinals)
    3387  
    3388 (format *trace-output* "past opcode ordinals")
     3381(dotimes (i (length *x86-opcode-templates*))
     3382  (setf (x86-opcode-template-ordinal (svref *x86-opcode-templates* i)) i))
    33893383
    33903384(defparameter *x86-opcode-template-lists*
    33913385  (make-hash-table :test #'equalp))
    3392 
    3393 (format *trace-output* "past creating opcode template lists")
    33943386
    33953387(defun initialize-x86-opcode-templates ()
  • branches/x8632-functions/compiler/X86/x86-lap.lisp

    r12349 r12357  
    14611461                         (incf nbytes (frag-length frag)))))
    14621462         (code-words (ash code-bytes (- target::word-shift)))
    1463          (function-vector (allocate-typed-vector :function code-words)))
     1463         (function-vector (allocate-typed-vector :function code-words))
     1464         (nconstants (length constants)))
    14641465    (declare (fixnum code-bytes code-words))
     1466    (when name (incf nconstants))
     1467    (when debug-info (incf nconstants))
     1468    (incf nconstants)                   ;bits
     1469
    14651470    (let* ((target-offset 0))
    14661471      (declare (fixnum target-offset))
    14671472      (do-dll-nodes (frag frag-list)
    14681473        (incf target-offset (frag-output-bytes frag function-vector target-offset))))
     1474    (let* ((word (uvref function-vector 0)))
     1475      (setq word (logand #xffff0000 word))
     1476      (setq word (logior word #x8000 nconstants))
     1477      (setf (uvref function-vector 0) word))
     1478
    14691479    (let* ((last (1- (uvsize function-vector))))
    14701480      (declare (fixnum last))
     
    14761486      (dolist (c constants)
    14771487        (setf (uvref function-vector (decf last)) (car c)))
    1478       #+nil
    1479       (format t "~& ~d constants, ~d other junk" (length constants)
    1480               (- (uvsize function-vector) last))
    1481       (setf (ldb (byte 16 0) (uvref function-vector 0))
    1482             (logior #x8000 (- (uvsize function-vector) last)))
    14831488      #+x8632-target
    14841489      (if (> last #xffff)
  • branches/x8632-functions/level-1/l1-clos-boot.lisp

    r12219 r12357  
    25652565                         :lambda-list '(instance &rest initargs &key &allow-other-keys))
    25662566
     2567(pdbg "*** before first defmethod")
     2568
    25672569(defmethod find-method ((generic-function standard-generic-function)
    25682570                        method-qualifiers specializers &optional (errorp t))
     
    25882590            (unless (eq s spec)
    25892591              (return))))))))
     2592
     2593(pdbg "*** after first defmethod")
    25902594
    25912595(defmethod create-reader-method-function ((class slots-class)
  • branches/x8632-functions/lisp-kernel/x86-spentry32.s

    r12349 r12357  
    784784        __(jnc 0f)
    785785        __(movl $0xffffff00,%temp1)
    786         __(andl misc_header_offset(%arg_y),%temp1)
     786        __(andl misc_header_offset(%temp0),%temp1)
    787787        __(shr $num_subtag_bits-fixnumshift,%temp1)
    788788        __(shl $fixnumshift,%imm0)
  • branches/x8632-functions/prepare.lisp

    r12349 r12357  
    6060                         (incf nbytes (frag-length frag)))))
    6161         (code-words (ash code-bytes (- target::word-shift)))
    62          (function-vector (allocate-typed-vector :function code-words)))
     62         (function-vector (allocate-typed-vector :function code-words))
     63         (nconstants (length constants)))
    6364    (declare (fixnum code-bytes code-words))
     65    (when name (incf nconstants))
     66    (when debug-info (incf nconstants))
     67    (incf nconstants)
     68
    6469    (let* ((target-offset 0))
    6570      (declare (fixnum target-offset))
    6671      (do-dll-nodes (frag frag-list)
    6772        (incf target-offset (frag-output-bytes frag function-vector target-offset))))
     73    ;;(format t "~& nconstants = ~d" nconstants)
     74    ;;(format t "~& word 0 before high bit set: ~x" (uvref function-vector 0))
     75    (let* ((word (uvref function-vector 0)))
     76      (setq word (logand #xffff0000 word))
     77      (setq word (logior word #x8000 nconstants))
     78      (setf (uvref function-vector 0) word))
     79    ;;(format t "~& word 0 after: ~x" (uvref function-vector 0))
     80    ;;(force-output t)
     81
    6882    (let* ((last (1- (uvsize function-vector))))
    6983      (declare (fixnum last))
     
    7589      (dolist (c constants)
    7690        (setf (uvref function-vector (decf last)) (car c)))
    77       #+nil
    78       (format t "~& ~d constants, ~d other junk" (length constants)
    79               (- (uvsize function-vector) last))
    80       (setf (ldb (byte 16 0) (uvref function-vector 0))
    81             (logior #x8000 (- (uvsize function-vector) last)))
    8291      #+x8632-target
    8392      (if (> last #xffff)
  • branches/x8632-functions/xdump/xfasload.lisp

    r12210 r12357  
    17421742  (let* ((imm-word-count (xload-u16-at-address
    17431743                          (+ addr *xload-target-misc-data-offset*))))
     1744    ;; XXX bootstrapping
     1745    (when (logbitp 15 imm-word-count)
     1746      (multiple-value-bind (v o) (xload-lookup-address addr)
     1747        (let* ((header (natural-ref v (+ o *xload-target-misc-header-offset*)))
     1748               (nelements (ash header (- target::num-subtag-bits))))
     1749          (setq imm-word-count (- nelements (logand #x7fff imm-word-count))))))
    17441750    (do* ((i (- imm-word-count 2) (1- i))
    17451751          (offset (xload-%fullword-ref addr i) (xload-%fullword-ref addr i)))
Note: See TracChangeset for help on using the changeset viewer.