Changeset 12887


Ignore:
Timestamp:
08/11/10 22:11:49 (12 years ago)
Author:
ehuelsmann
Message:

Switch MAKE-CONSTRUCTOR over to the new class writer.

File:
1 edited

Legend:

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

    r12885 r12887  
    832832  (let* ((*compiler-debug* nil)
    833833         ;; We don't normally need to see debugging output for constructors.
    834          (constructor (make-method :name "<init>"
    835                                    :descriptor "()V"))
     834         (method (!make-method :constructor :void nil
     835                               :flags '(:public)))
     836         (code (method-add-code method))
    836837         req-params-register
    837838         opt-params-register
     
    841842         more-keys-p
    842843         (*code* ())
    843          (*handlers* nil))
    844     (setf (method-max-locals constructor) 1)
     844         (*current-code-attribute* code))
     845    (setf (code-max-locals code) 3)
    845846    (unless (eq super +lisp-primitive+)
    846847      (multiple-value-bind
     
    857858                    (emit-push-constant-int (length ,params))
    858859                    (emit-anewarray +lisp-closure-parameter+)
    859                     (astore (setf ,register (method-max-locals constructor)))
    860                     (incf (method-max-locals constructor))
     860                    (astore (setf ,register (code-max-locals code)))
     861                    (incf (code-max-locals code))
    861862                    (do* ((,count-sym 0 (1+ ,count-sym))
    862863                          (,params ,params (cdr ,params))
     
    938939    (setf *code* (append *static-code* *code*))
    939940    (emit 'return)
    940     (setf *code*
    941           (finalize-code *code* (nconc (mapcar #'handler-from *handlers*)
    942                                        (mapcar #'handler-to *handlers*)
    943                                        (mapcar #'handler-code *handlers*)) nil))
    944 
    945     (setf (method-max-stack constructor)
    946           (analyze-stack *code* (mapcar #'handler-code *handlers*)))
    947     (setf (method-code constructor) (code-bytes *code*))
    948     (setf (method-handlers constructor) (nreverse *handlers*))
    949     constructor))
     941    (setf (code-code code) *code*)
     942    method))
    950943
    951944(defun write-exception-table (method stream)
     
    69316924    (dolist (field (class-file-fields class-file))
    69326925      (finalize-field field class-file))
     6926    (finalize-method constructor class-file)
    69336927
    69346928    (write-u4 #xCAFEBABE stream)
     
    69526946    (dolist (method (abcl-class-file-methods class-file))
    69536947      (write-method method stream))
    6954     (write-method constructor stream)
     6948    (!write-method constructor stream)
    69556949    ;; attributes count
    69566950    (cond (*file-compilation*
Note: See TracChangeset for help on using the changeset viewer.