[armedbear-cvs] r12883 - branches/generic-class-file/abcl/src/org/armedbear/lisp
Erik Huelsmann
ehuelsmann at common-lisp.net
Mon Aug 9 12:50:33 UTC 2010
Author: ehuelsmann
Date: Mon Aug 9 08:50:32 2010
New Revision: 12883
Log:
Switch fields to the new generator.
Modified:
branches/generic-class-file/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
Modified: branches/generic-class-file/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
==============================================================================
--- branches/generic-class-file/abcl/src/org/armedbear/lisp/compiler-pass2.lisp (original)
+++ branches/generic-class-file/abcl/src/org/armedbear/lisp/compiler-pass2.lisp Mon Aug 9 08:50:32 2010
@@ -1146,19 +1146,9 @@
(defknown declare-field (t t t) t)
(defun declare-field (name descriptor)
- (if nil ;; *current-code-attribute*
- (let ((field (!make-field name descriptor
- :flags '(:final :static :private))))
- (class-add-field *class-file* field))
- (let ((field (make-field name (internal-field-ref descriptor))))
- ;; final static <access-flags>
- (setf (field-access-flags field)
- (logior +field-flag-final+ +field-flag-static+
- +field-access-private+))
- (setf (field-name-index field) (pool-name (field-name field)))
- (setf (field-descriptor-index field)
- (pool-name (field-descriptor field)))
- (push field *fields*))))
+ (let ((field (!make-field name descriptor
+ :flags '(:final :static :private))))
+ (class-add-field *class-file* field)))
(defknown sanitize (symbol) string)
(defun sanitize (symbol)
@@ -7067,7 +7057,9 @@
(when (and (boundp '*source-line-number*)
(fixnump *source-line-number*))
(pool-name "LineNumberTable")) ; Must be in pool!
-
+ (dolist (field (class-file-fields class-file))
+ (finalize-field field class-file))
+
(write-u4 #xCAFEBABE stream)
(write-u2 3 stream)
(write-u2 45 stream)
@@ -7079,10 +7071,10 @@
;; interfaces count
(write-u2 0 stream)
;; fields count
- (write-u2 (length *fields*) stream)
+ (write-u2 (length (class-file-fields class-file)) stream)
;; fields
- (dolist (field *fields*)
- (write-field field stream))
+ (dolist (field (class-file-fields class-file))
+ (!write-field field stream))
;; methods count
(write-u2 (1+ (length (abcl-class-file-methods class-file))) stream)
;; methods
More information about the armedbear-cvs
mailing list