Ignore:
Timestamp:
08/20/11 21:55:30 (10 years ago)
Author:
ehuelsmann
Message:

Generate <clinit>() functions for the initialization of static variables.
After this change, it should be possible to run the constructor of
compiled functions more than once.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp

    r13517 r13519  
    10611061    ;; We don't normally need to see debugging output for <clinit>.
    10621062    (with-code-to-method (class method)
    1063       (setf (code-max-locals *current-code-attribute*) 0)
    1064       (emit 'return)
    10651063      method)))
    10661064
     
    10741072extend the class any further."
    10751073  (with-code-to-method (class (abcl-class-file-constructor class))
     1074    (emit 'return))
     1075  (with-code-to-method (class (abcl-class-file-static-initializer class))
    10761076    (emit 'return))
    10771077  (finalize-class-file class)
     
    13081308        ((not *file-compilation*)
    13091309         (with-code-to-method
    1310              (*class-file* (abcl-class-file-constructor *class-file*))
     1310             (*class-file* (abcl-class-file-static-initializer *class-file*))
    13111311           (remember field-name object)
    13121312           (emit 'ldc (pool-string field-name))
     
    13211321        (t
    13221322         (with-code-to-method
    1323              (*class-file* (abcl-class-file-constructor *class-file*))
     1323             (*class-file* (abcl-class-file-static-initializer *class-file*))
    13241324           (funcall dispatch-fn object)
    13251325           (emit-putstatic *this-class* field-name field-type))))
     
    70777077      (setf (abcl-class-file-constructor class-file) constructor)
    70787078      (class-add-method class-file constructor))
    7079     #+enable-when-generating-clinit
    70807079    (let ((clinit (make-static-initializer class-file)))
    70817080      (setf (abcl-class-file-static-initializer class-file) clinit)
Note: See TracChangeset for help on using the changeset viewer.