Changeset 12896


Ignore:
Timestamp:
08/13/10 21:51:26 (13 years ago)
Author:
ehuelsmann
Message:

Add source file and line number attributes according to the
new generator structure.

Location:
branches/generic-class-file/abcl/src/org/armedbear/lisp
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/generic-class-file/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r12895 r12896  
    69406940
    69416941    (class-add-method class-file method)
     6942    (when (fixnump *source-line-number*)
     6943      (let ((table (make-line-numbers-attribute)))
     6944        (method-add-attribute method table)
     6945        (line-numbers-add-line table 0 *source-line-number*)))
    69426946
    69436947    (dolist (var (compiland-arg-vars compiland))
  • branches/generic-class-file/abcl/src/org/armedbear/lisp/jvm-class-file.lisp

    r12895 r12896  
    12091209
    12101210(defstruct line-number
    1211   start-pc  ;; a label, before finalization
     1211  start-pc  ;; a label, before finalization, or 0 for "start of function"
    12121212  line)
    12131213
     
    12151215  (declare (ignorable code class))
    12161216  (dolist (line-number (line-numbers-table line-numbers))
    1217     (setf (line-number-start-pc line-number)
    1218           (code-label-offset code (line-number-start-pc line-number)))))
     1217    (unless (zerop (line-number-start-pc line-number))
     1218      (setf (line-number-start-pc line-number)
     1219            (code-label-offset code (line-number-start-pc line-number))))))
    12191220
    12201221(defun write-line-numbers (line-numbers stream)
     
    12241225    (write-u2 (line-number-line line-number) stream)))
    12251226
    1226 
     1227(defun line-numbers-add-line (line-numbers start-pc line)
     1228  (push (make-line-number :start-pc start-pc :line line)
     1229        (line-numbers-table line-numbers)))
    12271230
    12281231(defstruct (local-variables-attribute
  • branches/generic-class-file/abcl/src/org/armedbear/lisp/jvm.lisp

    r12895 r12896  
    162162                                            :lambda-name lambda-name
    163163                                            :lambda-list lambda-list)))
     164    (when *file-compilation*
     165      (let ((source-attribute
     166             (make-source-file-attribute
     167              :filename (file-namestring *compile-file-truename*))))
     168        (class-add-attribute class-file source-attribute)))
    164169    class-file))
    165170
Note: See TracChangeset for help on using the changeset viewer.