12 #if (alpha || IRIX6 || x86_64 || aarch64) 27 #define wordsizeof(type) (sizeof(type)>>WORDSHIFT) 29 #if GCC || Solaris2 || IRIX || Linux || IRIX6 44 #if defined(Darwin) || defined(Linux) || defined(Linux64) 63 #define errno errnoGet() 67 #define min(x,y) ((x<y)?x:y) 68 #define max(x,y) ((x<y)?y:x) 74 #define eussetjmp(buf) (_setjmp(buf)?setjmp_val:(eusinteger_t)0) 75 #define euslongjmp(buf,val) (setjmp_val=(eusinteger_t)(val),_longjmp(buf,1)) 77 #if (Solaris2 || vxworks) 78 #define eussetjmp(buf) (eusinteger_t)setjmp(buf) 79 #define euslongjmp(buf,val) longjmp(buf,(int)(val)) 82 #define eussetjmp(buf) (eusinteger_t)_setjmp(buf) 83 #define euslongjmp(buf,val) _longjmp(buf,(int)(val)) 91 #define STOPPER ((pointer)0L) 92 #define UNBOUND ((pointer)0L) 95 #define V_CONSTANT ((pointer)((0<<2)+2)) // makeint(0) 96 #define V_VARIABLE ((pointer)((1<<2)+2)) // makeint(1) 97 #define V_GLOBAL ((pointer)((2<<2)+2)) // makeint(2) 98 #define V_SPECIAL ((pointer)((3<<2)+2)) // makeint(3) 101 #define SUBR_FUNCTION ((pointer)((0<<2)+2)) // makeint(0) 102 #define SUBR_MACRO ((pointer)((1<<2)+2)) // makeint(1) 103 #define SUBR_SPECIAL ((pointer)((2<<2)+2)) // makeint(2) 104 #define SUBR_ENTRY ((pointer)((3<<2)+2)) // makeint(3) 107 #define BLOCKFRAME ((pointer)((0<<2)+2)) // makeint(0) 108 #define TAGBODYFRAME ((pointer)((1<<2)+2)) // makeint(1) 117 #define ELM_FOREIGN 6 118 #define ELM_POINTER 7 123 #if (WORD_SIZE == 64) 124 #define MASK 0x7fffffffffffffff 125 #define MSB 0x8000000000000000 127 #define MASK 0x7fffffff 128 #define MSB 0x80000000 135 #define DEFAULTCHUNKINDEX 16 141 #define MAXTHRBUDDY 6 142 #define MAXSTACK 8388608 143 #define SYMBOLHASH 60 144 #define MAXCLASS 4096 145 #define KEYWORDPARAMETERLIMIT 128 146 #define ARRAYRANKLIMIT 7 148 #define MAX_SPECIALS 512 149 #if (WORD_SIZE == 64) 150 #define MAXPOSFIXNUM (0x1fffffffffffffff) 151 #define MINNEGFIXNUM (0xe000000000000000) 153 #define MAXPOSFIXNUM (0x1fffffff) 154 #define MINNEGFIXNUM (0xe0000000) 171 #define GC_REGION(cmp_statement) cmp_statement 315 dim[ARRAYRANKLIMIT];};
381 #if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 || ARM 431 struct {
short low,high;} sval;
514 #define MAXMETHCACHE 256 523 pointer *stack, *
vsp,*stacklimit;
545 #ifdef __RETURN_BARRIER 550 #ifdef __GC_ALLOC_DRIVEN 653 extern pointer
QSELF;
657 extern pointer
CLASS;
714 #define carof(p,err) (islist(p)?(p)->c.cons.car:(pointer)error(E_DUMMY5,(pointer)(err))) 715 #define cdrof(p,err) (islist(p)?(p)->c.cons.cdr:(pointer)error(E_DUMMY5,(pointer)(err))) 716 #define alloc rgc_alloc 718 #define carof(p,err) (islist(p)?(p)->c.cons.car:(pointer)error(E_DUMMY3,(pointer)(err))) 719 #define cdrof(p,err) (islist(p)?(p)->c.cons.cdr:(pointer)error(E_DUMMY3,(pointer)(err))) 720 #define alloc gc_alloc 722 #define ccar(p) ((p)->c.cons.car) 723 #define ccdr(p) ((p)->c.cons.cdr) 724 #define cixof(p) ((p)->cix) 725 #define classof(p) (ispointer(p)?classtab[(p)->cix].def:(pointer)error(E_NOOBJECT)) 726 #define subcixof(p) (classtab[(p)->cix].subcix) 727 #define speval(p) ((p)->c.sym.speval) 728 #define spevalof(p,x) (ctx->specials->c.vec.v[x]) 729 #define Spevalof(p) (ctx->specials->c.vec.v[intval((p)->c.sym.vtype)]) 730 #define SPEVALOF(p) (((p)->c.sym.vtype>=V_SPECIAL)? \ 731 ctx->specials->c.vec.v[intval((p)->c.sym.vtype)]: \ 733 #define superof(p) ((p)->c.cls.super) 735 #if sun3 || apollo || (system5 && !alpha && !mips) || sanyo || vxworks || NEXT 736 #define makepointer(bp) ((pointer)((eusinteger_t)(bp) | 2)) 737 #define isint(p) (!((eusinteger_t)(p) & 3)) 738 #define isflt(p) (((eusinteger_t)(p) & 3)==1) 739 #define isnum(p) (((eusinteger_t)(p) & 2)==0) 740 #define ispointer(p) ((eusinteger_t)(p) & 2) 741 #define makeint(v) ((pointer)(((eusinteger_t)v)<<2)) 742 #define bpointerof(p) ((bpointer)((eusinteger_t)(p)-2)) 745 #if vax || sun4 || news || mips || i386 || i486 || i586 || alpha || x86_64 || ARM 747 #define makepointer(bp) ((pointer)((eusinteger_t)(bp))) 749 #define isint(p) ( (((eusinteger_t)(p)&3)==2) || (((eusinteger_t)(p)&0x3)==0x3) ) 750 #define isflt(p) (((eusinteger_t)(p) & 3)==1) 751 #define isnum(p) (((eusinteger_t)(p) & 3)) 752 #define ispointer(p) (!((eusinteger_t)(p) & 3)) 762 #define bpointerof(p) ((bpointer)((eusinteger_t)(p))) 764 #define nextbuddy(p) ((bpointer)((eusinteger_t)(p)+(buddysize[(p->h.bix)&TAGMASK]*sizeof(pointer)))) 766 #define nextbuddy(p) ((bpointer)((eusinteger_t)(p)+(buddysize[p->h.bix]*sizeof(pointer)))) 768 #ifndef __USE_MARK_BITMAP 769 #define marked(p) (p->h.mark) 770 #define markon(p) p->h.mark=1 771 #define markoff(p) p->h.mark=0 783 #define ckintval(p) ((isint(p)|| \ 785 ((vecsize((p)->c.bgnm.bv)==1)|| \ 786 ((vecsize((p)->c.bgnm.bv)==2)&&((p)->c.bgnm.bv->c.ivec.iv[1]<2))))) \ 787 ?intval(p):(eusinteger_t)error(E_NOINT)) 788 #define bigintval(x) (isint(x)?intval(x):\ 790 ((vecsize((x)->c.bgnm.bv)>=2)?\ 791 (((x)->c.bgnm.bv->c.ivec.iv[1]<<(WORD_SIZE-1)) | ((x)->c.bgnm.bv->c.ivec.iv[0])): \ 792 ((x)->c.bgnm.bv->c.ivec.iv[0])):\ 793 (eusinteger_t)error(E_NOINT)) ) 794 #define mkbigint(y) \ 795 (pointer)((((y)^((y)>>1))&(eusinteger_t)3<<(WORD_SIZE-3))?makebig1(y):makeint(y)) 797 #define elmtypeof(p) (bpointerof(p)->h.elmtype) 799 #define bixof(p) (bpointerof(p)->h.bix & TAGMASK) 801 #define bixof(p) (bpointerof(p)->h.bix) 804 #if sun3 || sun4 || system5 || apollo || news || sanyo || vxworks || mips || NEXT || i386 || i486 || i586 || x86_64 || ARM 805 #if (WORD_SIZE == 64) 806 #define fltval(p) (nu.ival=((eusinteger_t)(p) & ~3L), nu.fval) 807 #define makeflt(f) (nu.fval=(eusfloat_t)(f), (pointer)((nu.ival & ~3L) | 1L)) 809 #define fltval(p) (nu.ival=((eusinteger_t)(p) & ~3), nu.fval) 810 #define makeflt(f) (nu.fval=(eusfloat_t)(f), (pointer)((nu.ival & ~3) | 1)) 818 #define ckfltval(p) (isflt(p)?fltval(p):\ 819 (isint(p)?intval(p):\ 820 (pisbignum(p)?big_to_float(p):\ 821 (pisratio(p)?ratio2flt(p):\ 822 (eusinteger_t)error(E_NONUMBER))))) 826 #define pislist(p) (p->cix<=conscp.sub) 827 #define piscons(p) (p->cix<=conscp.sub) 828 #define pispropobj(p) (propobjcp.cix<=(p)->cix && (p)->cix<=propobjcp.sub) 829 #define ispropobj(p) (ispointer(p) && pispropobj(p)) 830 #define pissymbol(p) (symbolcp.cix<=(p)->cix && (p)->cix<=symbolcp.sub) 831 #define issymbol(p) (ispointer(p) && pissymbol(p)) 832 #define pisstring(p) (stringcp.cix<=(p)->cix && (p)->cix<=stringcp.sub) 833 #define isstring(p) (ispointer(p) && pisstring(p)) 834 #define islist(p) (ispointer(p) && pislist(p)) 835 #define iscons(p) (ispointer(p) && piscons(p)) 836 #define piscode(p) (codecp.cix<=(p)->cix && (p)->cix<=codecp.sub) 837 #define iscode(p) (ispointer(p) && piscode(p)) 838 #define pisfcode(p) (fcodecp.cix<=(p)->cix && (p)->cix<=fcodecp.sub) 839 #define isfcode(p) (ispointer(p) && pisfcode(p)) 840 #define pisldmod(p) (ldmodulecp.cix<=(p)->cix && (p)->cix<=ldmodulecp.sub) 841 #define isldmod(p) (ispointer(p) && pisldmod(p)) 842 #define pisstream(p) (streamcp.cix<=(p)->cix && (p)->cix<=streamcp.sub) 843 #define isstream(p) (ispointer(p) && pisstream(p)) 844 #define pisfilestream(p) (filestreamcp.cix<=(p)->cix && (p)->cix<=filestreamcp.sub) 845 #define isfilestream(p) (ispointer(p) && pisfilestream(p)) 846 #define pisiostream(p) (iostreamcp.cix<=(p)->cix && (p)->cix<=iostreamcp.sub) 847 #define isiostream(p) (ispointer(p) && pisiostream(p)) 848 #define pisreadtable(p) (readtablecp.cix<=((p)->cix) && ((p)->cix)<=readtablecp.sub) 849 #define isreadtable(p) (ispointer(p) && pisreadtable(p)) 850 #define pisarray(p) (arraycp.cix<=((p)->cix) && ((p)->cix)<=arraycp.sub) 851 #define isarray(p) (ispointer(p) && pisarray(p)) 852 #define pisvector(p) (elmtypeof(p)) 853 #define isvector(p) (ispointer(p) && pisvector(p)) 854 #define isfltvector(p) (ispointer(p) && (elmtypeof(p)==ELM_FLOAT)) 855 #define isptrvector(p) (ispointer(p) && (elmtypeof(p)==ELM_POINTER)) 856 #define isintvector(p) (ispointer(p) && (elmtypeof(p)==ELM_INT)) 857 #define pisclass(p) (metaclasscp.cix<=(p)->cix && (p)->cix<=metaclasscp.sub) 858 #define isclass(p) (ispointer(p) && pisclass(p)) 859 #define pisvecclass(p) (vecclasscp.cix<=(p)->cix && (p)->cix<=vecclasscp.sub) 860 #define isvecclass(p) (ispointer(p) && pisvecclass(p)) 861 #define pispackage(p) (packagecp.cix<=(p)->cix && (p)->cix<=packagecp.sub) 862 #define ispackage(p) (ispointer(p) && pispackage(p)) 863 #define pisclosure(p) (closurecp.cix<=(p)->cix && (p)->cix<=closurecp.sub) 864 #define isclosure(p) (ispointer(p) && pisclosure(p)) 865 #define pislabref(p) (labrefcp.cix<=(p)->cix && (p)->cix<=labrefcp.sub) 866 #define islabref(p) (ispointer(p) && pislabref(p)) 868 #define pisextnum(p) (extnumcp.cix<=(p)->cix && (p)->cix<=extnumcp.sub) 869 #define isextnum(p) (ispointer(p) && pisextnum(p)) 870 #define pisratio(p) (ratiocp.cix<=(p)->cix && (p)->cix<=ratiocp.sub) 871 #define isratio(p) (ispointer(p) && pisratio(p)) 872 #define piscomplex(p) (complexcp.cix<=(p)->cix && (p)->cix<=complexcp.sub) 873 #define iscomplex(p) (ispointer(p) && piscomplex(p)) 874 #define pisbignum(p) (bignumcp.cix<=(p)->cix && (p)->cix<=bignumcp.sub) 875 #define isbignum(p) (ispointer(p) && pisbignum(p)) 877 #define strlength(p) ((int)intval((p)->c.str.length)) 878 #define vecsize(p) ((int)intval((p)->c.vec.size)) 879 #define objsize(p) ((int)vecsize(classof(p)->c.cls.vars)) 882 #define bigsize(x) vecsize((x)->c.bgnm.bv) 883 #define bigvec(x) (x)->c.bgnm.bv->c.ivec.iv 886 #define current_ctx (euscontexts[thr_self()]) 888 #define vpush(v) (*ctx->vsp++=p_print((pointer)(v),ctx)) 889 #define vpop() (printf("vpop:[0x%lx]=0x%lx\n",ctx->vsp-1,(ctx->vsp)[-1]),*(--(ctx->vsp))) 891 #define vpush(v) (*ctx->vsp++=((pointer)v)) 892 #define vpop() (*(--(ctx->vsp))) 894 #define ckpush(v) (ctx->vsp<ctx->stacklimit?vpush(v):(pointer)error(E_STACKOVER)) 896 #define ckarg(req) if (n!=(req)) error(E_MISMATCHARG) 897 #define ckarg2(req1,req2) if ((n<(req1))||((req2)<n)) error(E_MISMATCHARG) 899 #define breakck if (ctx->intsig>0) sigbreak() 900 #define stackck if (ctx->vsp>ctx->stacklimit) error(E_STACKOVER) 901 #define debug (speval(QDEBUG)!=NIL) 904 #define pointer_update(l,r) { (l)=(r); } 1014 #if alpha || IRIX6 || Solaris2 || Linux || Cygwin 1041 extern pointer
memq();
1044 extern pointer
alloc(
int,
int,
int,
int);
1047 extern pointer
makeclass(
context *, pointer, pointer, pointer,pointer, pointer,
1055 extern pointer
findsymbol(
unsigned char *,
int, pointer,
int *);
1071 pointer, pointer, pointer);
1093 #if !alpha && !IRIX6 1099 extern pointer
makeclosure(pointer,pointer,
pointer(*)(),pointer, pointer*, pointer*);
1100 extern pointer
fcall();
1101 extern pointer
xcar(pointer),
xcdr(pointer),
xcadr(pointer);
1102 extern pointer *
ovafptr(pointer,pointer);
1106 #if Solaris2 || SunOS4_1
pointer prinx(context *, pointer, pointer)
eusinteger_t hide_ptr(pointer p)
pointer makesymbol(context *, char *, int, pointer)
pointer defconst(context *, char *, pointer, pointer)
pointer rawcons(context *, pointer, pointer)
pointer intern(context *, char *, int, pointer)
struct fletframe * dynlink
struct protectframe * protfp
eusinteger_t intval(pointer p)
pointer cons(context *, pointer, pointer)
pointer makecode(pointer, pointer(*)(), pointer)
pointer mkfilestream(context *, pointer, pointer, int, pointer)
long buddysize[MAXBUDDY+1]
pointer makeclosure(pointer, pointer, pointer(*)(), pointer, pointer *, pointer *)
eusfloat_t big_to_float(pointer)
void addcmethod(context *, pointer, pointer(*)(), pointer, pointer, pointer)
pointer makethreadport(context *)
struct specialbindframe * sbindfp
void bindspecial(context *, pointer, pointer)
pointer makepkg(context *, pointer, pointer, pointer)
struct bindframe * declare(context *, pointer, struct bindframe *)
struct blockframe * blkfp
pointer defunpkg(context *, char *, pointer, pointer(*)(), pointer)
pointer defkeyword(context *, char *)
context * euscontexts[MAXTHREAD]
pointer csend(context *,...)
struct fletframe * newfletfp
struct protectframe * protlink
struct blockframe * lexklink
pointer ufuncall(context *, pointer, pointer, pointer, struct bindframe *, int)
pointer progn(context *, pointer)
long alloccount[MAXBUDDY]
struct blockframe * dynklink
pointer makevector(pointer, int)
pointer makemodule(context *, int)
struct bindframe * fastbind(context *, pointer, pointer, struct bindframe *)
pointer mkstream(context *, pointer, pointer)
void unbindspecial(context *, struct specialbindframe *)
pointer deflocal(context *, char *, pointer, pointer)
pointer * ovafptr(pointer, pointer)
pointer setval(context *, pointer, pointer)
pointer mkiostream(context *, pointer, pointer)
struct bindframe * bindkeyparams(context *, pointer, pointer *, int, struct bindframe *, struct bindframe *)
pointer defvar(context *, char *, pointer, pointer)
struct built_in_cid builtinclass[64]
pointer alloc(int, int, int, int)
struct callframe * callfp
pointer getfunc(context *, pointer)
struct bindframe * lexblink
pointer eusfloat_to_big(float)
struct bindframe * vbind(context *, pointer, pointer, struct bindframe *, struct bindframe *)
struct methdef * methcache
struct bindframe * dynblink
struct fletframe * lexlink
pointer funcode(context *, pointer, pointer, int)
struct catchframe * nextcatch
pointer makeint(eusinteger_t v)
struct class_desc classtab[MAXCLASS]
pointer defun(context *, char *, pointer, pointer(*)(), char *)
pointer makematrix(context *, int, int)
pointer stacknlist(context *, int)
struct catchframe * catchfp
pointer findsymbol(unsigned char *, int, pointer, int *)
pointer funlambda(context *, pointer, pointer, pointer, pointer *, struct bindframe *, int)
pointer makestring(char *, int)
struct specialbindframe * sblink
struct buddyfree * thr_buddy
pointer makeclass(context *, pointer, pointer, pointer, pointer, pointer, int, pointer)
pointer makeobject(pointer)
struct bindframe * bindfp
pointer eval(context *, pointer)
struct buddyfree buddy[MAXBUDDY+1]
pointer reader(context *, pointer, pointer)
pointer defmacro(context *, char *, pointer, pointer(*)())
pointer eval2(context *, pointer, pointer)
pointer getval(context *, pointer)
pointer defspecial(context *, char *, pointer, pointer(*)())