Changeset 12779
- Timestamp:
- 07/03/10 22:15:26 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/generic-class-file/abcl/src/org/armedbear/lisp/jvm-class-file.lisp
r12778 r12779 561 561 descriptor 562 562 attributes 563 arg-count ;; not in the class file,564 ;; but required for setting up CODE attribute565 563 ) 566 564 … … 577 575 (%make-method :descriptor (cons return args) 578 576 :access-flags flags 579 :name name 580 :arg-count (if (member :static flags) 581 (length args) 582 (1+ (length args))))) ;; implicit 'this' 577 :name name)) 583 578 584 579 (defun method-add-attribute (method attribute) 585 580 (push attribute (method-attributes method))) 581 582 (defun method-add-code (method) 583 "Creates an (empty) 'Code' attribute for the method." 584 (method-add-attribute 585 (make-code-attribute (+ (length args) 586 (if (member :static (method-access-flags method)) 587 0 1))))) ;; 1 == implicit 'this' 586 588 587 589 (defun method-attribute (method name) … … 677 679 (write-attributes (code-attributes code) stream)) 678 680 679 (defun make-code-attribute (method) 680 (%make-code-attribute :max-locals (method-arg-count method))) 681 (defun make-code-attribute (arg-count) 682 "Creates an empty 'Code' attribute for a method which takes 683 `arg-count` parameters, including the implicit `this` parameter." 684 (%make-code-attribute :max-locals arg-count)) 681 685 682 686 (defun code-add-attribute (code attribute)
Note: See TracChangeset
for help on using the changeset viewer.