Changeset 11611
 Timestamp:
 01/31/09 20:28:09 (13 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/abcl/src/org/armedbear/lisp/compilerpass2.lisp
r11610 r11611 2367 2367 (:int 2368 2368 (cond ((fixnump form) 2369 (emitpushconstantint form) 2370 (emitmovefromstack target representation) 2371 (returnfrom compileconstant)) 2369 (emitpushconstantint form)) 2372 2370 ((integerp form) 2373 2371 (emit 'getstatic *thisclass* (declarebignum form) +lispbignum+) 2374 (emitinvokevirtual +lispobjectclass+ "intValue" nil "I") 2375 (emitmovefromstack target representation) 2376 (returnfrom compileconstant)) 2372 (emitinvokevirtual +lispobjectclass+ "intValue" nil "I")) 2377 2373 (t 2378 2374 (sys::%format t "compileconstant int representation~%") 2379 (assert nil)))) 2375 (assert nil))) 2376 (emitmovefromstack target representation) 2377 (returnfrom compileconstant)) 2380 2378 (:long 2381 (cond ((fixnump form) 2382 (case form 2383 (0 2384 (emit 'lconst_0)) 2385 (1 2386 (emit 'lconst_1)) 2387 (t 2388 (emitpushconstantint form) 2389 (emit 'i2l))) 2390 (emitmovefromstack target representation) 2391 (returnfrom compileconstant)) 2392 ((<= mostnegativejavalong form mostpositivejavalong) 2393 (emit 'ldc2_w (poollong form)) 2394 (returnfrom compileconstant)) 2379 (cond ((<= mostnegativejavalong form mostpositivejavalong) 2380 (emitpushconstantlong form)) 2395 2381 ((integerp form) 2396 2382 (emit 'getstatic *thisclass* (declarebignum form) +lispbignum+) 2397 (emitinvokevirtual +lispobjectclass+ "longValue" nil "J") 2398 (emitmovefromstack target representation) 2399 (returnfrom compileconstant)) 2383 (emitinvokevirtual +lispobjectclass+ "longValue" nil "J")) 2400 2384 (t 2401 2385 (sys::%format t "compileconstant long representation~%") 2402 (assert nil)))) 2386 (assert nil))) 2387 (emitmovefromstack target representation) 2388 (returnfrom compileconstant)) 2403 2389 (:char 2404 2390 (cond ((characterp form) … … 2414 2400 (returnfrom compileconstant)) 2415 2401 (:float 2416 (cond ((fixnump form) 2417 (compileconstant form 'stack :int) 2418 (emit 'i2f)) 2419 ((and (integerp form) 2420 (<= mostnegativejavalong form mostpositivejavalong)) 2421 (compileconstant form 'stack :long) 2422 (emit 'l2f)) 2423 ((integerp form) 2424 (emit 'getfield *thisclass* (declarebignum form) 2425 +lispbignum+) 2426 (emitinvokevirtual +lispbignumclass+ "floatValue" nil "F")) 2402 (cond ((integerp form) 2403 (emitpushconstantfloat (coerce form 'singlefloat))) 2427 2404 ((typep form 'singlefloat) 2428 2405 (emitpushconstantfloat form)) … … 2436 2413 (returnfrom compileconstant)) 2437 2414 (:double 2438 (cond ((fixnump form) 2439 (compileconstant form 'stack :int) 2440 (emit 'i2d)) 2441 ((and (integerp form) 2442 (<= mostnegativejavalong form mostpositivejavalong)) 2443 (compileconstant form 'stack :long) 2444 (emit 'l2d)) 2445 ((integerp form) 2446 (emit 'getfield *thisclass* (declarebignum form) 2447 +lispbignum+) 2448 (emitinvokevirtual +lispbignumclass+ "doubleValue" nil "D")) 2449 ((typep form 'singlefloat) 2450 (emitpushconstantfloat form) 2451 (emit 'f2d)) 2415 (cond ((or (integerp form) 2416 (typep form 'singlefloat)) 2417 (emitpushconstantdouble (coerce form 'doublefloat))) 2452 2418 ((typep form 'doublefloat) 2453 2419 (emitpushconstantdouble form)) … … 6929 6895 (t 6930 6896 (compilebinaryoperation "add" args target representation))))) 6931 ( 46897 (t 6932 6898 ;; (+ a b c) => (+ (+ a b) c) 6933 (let ((newform `(+ (+ ,(second form) ,(third form)) ,(fourth form)))) 6934 (p2plus newform target representation))) 6935 (t 6936 (compilefunctioncall form target representation)))) 6899 (let ((newform `(+ (+ ,(second form) ,(third form)) ,@(nthcdr 3 form)))) 6900 (p2plus newform target representation))))) 6937 6901 6938 6902 (defun p2minus (form target representation)
Note: See TracChangeset
for help on using the changeset viewer.