Changeset 8018
- Timestamp:
- Jan 8, 2008, 12:38:08 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/compiler/X86/x86-lapmacros.lisp
r6469 r8018 31 31 `(movw ($ ',n) (% nargs)))) 32 32 33 (defx86lapmacro anchored-uuo (form) 34 `(progn 35 ,form 36 (:byte 0))) 37 33 38 (defx86lapmacro check-nargs (min &optional (max min)) 34 (let* ((ok (gensym))) 39 (let* ((anchor (gensym)) 40 (bad (gensym))) 35 41 (if (and max (= max min)) 36 42 `(progn 37 (rcmp (% nargs) ($ ',min)) 38 (je.pt ,ok) 39 (uuo-error-wrong-number-of-args) 40 ,ok) 43 ,anchor 44 ,(if (eql min 0) 45 `(testw (% nargs) (% nargs)) 46 `(rcmp (% nargs) ($ ',min))) 47 (jne ,bad) 48 (:anchored-uuo-section ,anchor) 49 ,bad 50 (anchored-uuo (uuo-error-wrong-number-of-args)) 51 (:main-section nil)) 41 52 (if (null max) 42 53 (unless (zerop min) 43 54 `(progn 55 ,anchor 44 56 (rcmp (% nargs) ($ ',min)) 45 (jae.pt ,ok) 46 (uuo-error-too-few-args) 47 ,ok)) 57 (jb ,bad) 58 (:anchored-uuo-section ,anchor) 59 ,bad 60 (anchored-uuo (uuo-error-too-few-args)) 61 (:main-section nil))) 48 62 (if (zerop min) 49 63 `(progn 64 ,anchor 50 65 (rcmp (% nargs) ($ ',max)) 51 (jb.pt ,ok) 52 (uuo-error-too-many-args) 53 ,ok) 54 (let* ((sofar (gensym))) 66 (ja ,bad) 67 (:anchored-uuo-section ,anchor) 68 ,bad 69 (anchored-uuo (uuo-error-too-many-args)) 70 (:main-section nil)) 71 (let* ((toofew (gensym)) 72 (toomany (gensym))) 55 73 `(progn 74 ,anchor 56 75 (rcmp (% nargs) ($ ',min)) 57 (jae.pt ,sofar) 58 (uuo-error-too-few-args) 59 ,sofar 76 (jb ,toofew) 60 77 (rcmp (% nargs) ($ ',max)) 61 (jbe.pt ,ok) 62 (uuo-error-too-many-args) 63 ,ok))))))) 78 (ja ,toomany) 79 (:anchored-uuo-section ,anchor) 80 ,toofew 81 (anchored-uuo (uuo-error-too-few-args)) 82 (:anchored-uuo-section ,anchor) 83 ,toomany 84 (anchored-uuo (uuo-error-too-many-args))))))))) 64 85 65 86
Note:
See TracChangeset
for help on using the changeset viewer.
