Changeset 11792
- Timestamp:
- 04/28/09 19:38:42 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
r11783 r11792 135 135 (pool-get (list 4 (%float-bits n)))) 136 136 137 (defknown pool-long (integer) (integer 1 65535)) 138 (defun pool-long (n) 139 (declare (optimize speed)) 140 (declare (type java-long n)) 141 (let* ((entry (list 5 142 (logand (ash n -32) #xffffffff) 143 (logand n #xffffffff))) 144 (ht *pool-entries*) 137 (defun pool-long/double (n entry) 138 (let* ((ht *pool-entries*) 145 139 (index (gethash1 entry ht))) 146 140 (declare (type hash-table ht)) … … 158 152 index)) 159 153 154 (defknown pool-long (integer) (integer 1 65535)) 155 (defun pool-long (n) 156 (declare (optimize speed)) 157 (declare (type java-long n)) 158 (let* ((entry (list 5 159 (logand (ash n -32) #xffffffff) 160 (logand n #xffffffff)))) 161 (pool-long/double n entry))) 162 160 163 (defknown pool-double (double-float) (integer 1 65535)) 161 164 (defun pool-double (n) … … 164 167 (entry (list 6 165 168 (logand (ash n -32) #xffffffff) 166 (logand n #xffffffff))) 167 (ht *pool-entries*) 168 (index (gethash1 entry ht))) 169 (declare (type hash-table ht)) 170 (unless index 171 (setf index *pool-count*) 172 (push entry *pool*) 173 (setf (gethash entry ht) index) 174 ;; The Java Virtual Machine Specification, Section 4.4.5: "All 8-byte 175 ;; constants take up two entries in the constant_pool table of the class 176 ;; file. If a CONSTANT_Long_info or CONSTANT_Double_info structure is the 177 ;; item in the constant_pool table at index n, then the next usable item in 178 ;; the pool is located at index n+2. The constant_pool index n+1 must be 179 ;; valid but is considered unusable." So: 180 (setf *pool-count* (+ index 2))) 181 index)) 169 (logand n #xffffffff)))) 170 (pool-long/double n entry))) 182 171 183 172 (defknown u2 (fixnum) cons)
Note: See TracChangeset
for help on using the changeset viewer.