Changeset 9937


Ignore:
Timestamp:
Jul 10, 2008, 8:46:15 AM (11 years ago)
Author:
gb
Message:

FIND-SOURCE-AT-PC: decode pc-source-map as ivector.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/compiler/nx0.lisp

    r9911 r9937  
    17071707  corresponding source notes.")
    17081708
    1709 #|
     1709#||
    17101710(defun make-source-note-form-map (source-note &optional existing-map)
    17111711  "Creates a mapping from lisp forms to source-notes based on SOURCE-NOTES. This should be bound to
     
    17271727      (walk source-note))
    17281728    map))
    1729 |#
     1729||#
    17301730
    17311731(defun nx1-source-note (nx1-code)
     
    17451745    (when pc-source-map
    17461746      (let* ((best-guess nil)
    1747              (best-length nil))
    1748         (loop
    1749           for pc-map across pc-source-map
    1750           for pc-start = (pc-source-map-pc-start pc-map)
    1751           for pc-end = (pc-source-map-pc-end pc-map)
    1752           do (when (and (<= pc-start pc pc-end)
     1747             (best-length nil)
     1748             (len (length pc-source-map)))
     1749        (declare (fixnum len))
     1750        (do* ((q 0 (+ q 4))
     1751              (r 1 (+ r 4)))
     1752             ((= q len))
     1753          (declare (fixnum q r))
     1754          (let* ((pc-start (aref pc-source-map q))
     1755                 (pc-end (aref pc-source-map r)))
     1756            (declare (fixnum pc-start pc-end))
     1757            (when (and (<= pc-start pc pc-end)
    17531758                        (or (null best-guess)
    17541759                            (< (- pc-end pc-start) best-length)))
    1755                (setf best-guess pc-map
    1756                      best-length (- pc-end pc-start))))
     1760               (setf best-guess q
     1761                     best-length (- pc-end pc-start)))))
    17571762        (when best-guess
    1758           (list :pc-range (cons (pc-source-map-pc-start best-guess)
    1759                                 (pc-source-map-pc-end best-guess))
    1760                 :source-text-range (cons (pc-source-map-text-start best-guess)
    1761                                          (pc-source-map-text-end best-guess))
     1763          (list :pc-range (cons (aref pc-source-map best-guess)
     1764                                (aref pc-source-map (+ best-guess 1)))
     1765                :source-text-range (cons (aref pc-source-map (+ best-guess 2))
     1766                                         (aref pc-source-map (+ best-guess 3)))
    17621767                :file-name (getf function-source-note :file-name)
    17631768                :text (getf function-source-note :text)))))))
Note: See TracChangeset for help on using the changeset viewer.