958 lines · 22.5 KB · C
RawDownload
# 1 "method.m"struct _PRIVATE { struct _PRIVATE *isa; };typedef struct _PRIVATE *id;struct _SHARED {  id isa;  id clsSuper;  char *clsName;  char *clsTypes;  short clsSizInstance;  short clsSizDict;  struct _SLT *clsDispTable;  long clsStatus;  struct modDescriptor *clsMod;  unsigned clsVersion;  id clsCats;  id *clsGlbl;};extern id  (* _imp(id,char*))();extern id  (* _impSuper(id,char*))();extern struct modDescriptor  *_OBJCBIND_method(void);static char **selTransTbl;struct _SLT {char *_cmd;id (*_imp)();};struct modDescriptor {  char *modName;  char *modVersion;  long modStatus;  char *modMinSel;  char *modMaxSel;  id *modClsLst;  short modSelRef;  char **modSelTbl;  struct methodDescriptor *modMapTbl;};extern struct modDescriptor method_modDesc; # 1 "../../util/stdarg.h"#include <stdarg.h> # 1 "../../util/stdlib.h"#include <stdlib.h> # 1 "../../util/string.h"#include <string.h> # 1 "../../util/assert.h"#include <assert.h> # 1 "../../util/stdio.h"#include <stdio.h> # 1 "../../util/stdio.h"#include <stdio.h> # 1 "../../util/stddef.h"#include <stddef.h> # 53 "../../include/objcrt/objcrt.h"typedef char*SEL;typedef char*STR;typedef char BOOL;typedef FILE*IOD;typedef id SHR;# 62 "../../include/objcrt/objcrt.h"typedef id(*IMP)();  typedef void(*ARGIMP)(id,SEL,void*);# 85 "../../include/objcrt/objcrt.h"extern BOOL msgFlag;extern FILE*msgIOD;extern FILE*dbgIOD;extern BOOL allocFlag;extern BOOL dbgFlag;extern BOOL noCacheFlag;extern BOOL noNilRcvr;# 98 "../../include/objcrt/objcrt.h"SEL selUid(STR);STR selName(SEL);void dbg(char*fmt,...);void prnstack(FILE*file);void loadobjc(void*modPtr);void unloadobjc(void*modPtr);# 107 "../../include/objcrt/objcrt.h"IMP fwdimp(id,SEL,IMP);IMP fwdimpSuper(id,SEL,IMP);void fwdmsg(id,SEL,void*,ARGIMP);id selptrfwd(id,SEL,id,id,id,id);  id idincref(id obj);id idassign(id*lhs,id rhs);id iddecref(id obj); extern id(*_fileIn)(FILE*);extern BOOL(*_fileOut)(FILE*,id);extern BOOL(*_storeOn)(STR,id);extern id(*_readFrom)(STR);void setfilein(id(*f)(FILE*));void setfileout(BOOL(*f)(FILE*,id)); extern id(*_showOn)(id,unsigned); void*OC_Malloc(size_t);void*OC_MallocAtomic(size_t);void*OC_Calloc(size_t);void*OC_Realloc(void*,size_t);void*OC_Free(void*data);# 1 "../../util/string.h"#include <string.h> # 32 "../../include/objpak/ocstring.h"typedef struct objstr{int count;int capacity;char*ptr;}*objstr_t;# 31 "../../include/objpak/ordcltn.h"typedef struct objcol{int count;int capacity;id*ptr;}*objcol_t;# 22 "node.h"extern FILE*gfile;extern int inlineno;extern id infilename;extern int outlineno;extern char*outfilename;extern int exitstatus;extern id loadedmodules; void gc(char c);void gextc(void);void gcom(char*cm);void gvarlist(id c,char*sp,char*iz);void gcommalist(id c);void gs(char*str);void gf(char*fmt,...);void gl(int no,char*fn);void g_otbvars(void);void gstderr(void);void gnormal(void);char*browsepath(char*filename); void warn(char*fmt,...);void warnat(id sym,char*fmt,...);void fatal(char*fmt,...);void fatalat(id sym,char*fmt,...);# 22 "expr.h"extern id e_nil;extern id e_self;extern id e_cmd;extern id e_super;extern id e_aFiler;extern id e_ft_id;# 22 "type.h"extern id t_unknown;extern id t_void;extern id t_char;extern id t_bool;extern id t_int;extern id t_long;extern id t_uns;extern id t_double;extern id t_str;extern id t_sel;extern id t_id;# 22 "options.h"void defoptions(void); extern int o_warnings;extern int o_gnu;extern int o_hpux;extern int o_vms;extern int o_refcnt;extern int o_ppi;extern int o_watcom;extern int o_ibmvac;extern int o_msdos;extern int o_enableasm;extern int o_nolinetags;extern int o_buffered;extern int o_quiet;extern int o_outputcode;extern int o_version;extern int o_otb;extern int o_llkeyw;extern int o_comments;extern int o_duptypedefs;extern int o_seltranslation;extern int o_categories;extern int o_blocks;extern int o_fwd;extern int o_selptr;extern int o_cache;extern int o_filer;extern int o_selfassign;extern char*o_bind;extern char*o_browsedir;extern int o_refbind;extern int o_inlinecache;extern int o_cplus;extern int o_gencode;extern int o_st80;extern int o_selfassign;extern int o_nilrcvr;extern int o_shareddata;extern int o_oneperfile;extern int o_cvars;extern int o_warnlex;extern int o_warnfwd;extern int o_warnsuggest;extern int o_warnintvar;extern int o_warnclasstype;extern int o_warntypeconflict;extern int o_warnundefined;extern int o_warnlocalnst;extern int o_warnnotfound;extern int o_warnmissingmethods;extern int o_postlink;extern char*o_infile;extern char*o_outfile;extern char*o_srcfilename;extern char*o_initcall;extern char*o_tagformat;extern char*o_mainfun;extern char*o_pathsep;extern int o_debuginfo;extern int o_checkbind;extern int o_linemax;extern int o_structassign;extern id o_stepbreak;extern int o_stepnext;# 22 "method.h"struct Method_PRIVATE { # 42 "../../include/objcrt/Object.h"id isa;# 46 "../../include/objcrt/Object.h"unsigned short attr;unsigned short objID;# 24 "method.h"int lineno;id filename;id restype;id usel;id ksel;id selector;BOOL varargs;BOOL haveneedscast;BOOL needscast;BOOL havecanforward;BOOL canforward;BOOL haveisselptr;BOOL isselptr;BOOL havehash;unsigned typehash;}; # 22 "method.h"extern id  Method; # 22 "method.h"extern struct _SHARED _Method;extern struct _SHARED __Method;  # 50 "method.m"static id i_Method_usel(struct Method_PRIVATE *self,SEL _cmd){return self->usel;} static id i_Method_ksel(struct Method_PRIVATE *self,SEL _cmd){return self->ksel;} static id i_Method_canforward_(struct Method_PRIVATE *self,SEL _cmd,BOOL f){self->havecanforward=(BOOL)1;self->canforward=f;return(id)self;} static id i_Method_calccanforward(struct Method_PRIVATE *self,SEL _cmd){id objcT0,objcT1,objcT2,objcT3;self-># 69 "method.m"havecanforward=(BOOL)1;self->canforward=(BOOL)1; if(self->varargs){self->canforward=(BOOL)0;return(id)self;}if((objcT0=(id)self,(*(BOOL(*)(id,SEL))_imp(objcT0,selTransTbl[0]))(objcT0,selTransTbl[0]))==(BOOL)0||(objcT1=(id)self,(*(BOOL(*)(id,SEL))_imp(objcT1,selTransTbl[1]))(objcT1,selTransTbl[1]))){self->canforward=(BOOL)1;return(id)self;}  if(self->restype&& !((objcT2=self->restype,(*(BOOL(*)(id,SEL))_imp(objcT2,selTransTbl[2]))(objcT2,selTransTbl[2]))||(objcT3=self->restype,(*(BOOL(*)(id,SEL))_imp(objcT3,selTransTbl[3]))(objcT3,selTransTbl[3])))){self->canforward=(BOOL)0;return(id)self;}if(self->ksel){id objcT4; # 87 "method.m"int i,n; for(i=0,n=(objcT4=self->ksel,(*(unsigned(*)(id,SEL))_imp(objcT4,selTransTbl[4]))(objcT4,selTransTbl[4]));i<n;i++){id objcT5,objcT6; # 90 "method.m"if( !(objcT5=(objcT6=self->ksel,(*(id(*)(id,SEL,unsigned))_imp(objcT6,selTransTbl[5]))(objcT6,selTransTbl[5],i)),(*(BOOL(*)(id,SEL))_imp(objcT5,selTransTbl[2]))(objcT5,selTransTbl[2]))){self->canforward=(BOOL)0;return(id)self;}}}return(id)self;} static id i_Method_calcisselptr(struct Method_PRIVATE *self,SEL _cmd){id objcT7;self-># 101 "method.m"haveisselptr=(BOOL)1;self->isselptr=(BOOL)1; if((objcT7=(id)self,(*(BOOL(*)(id,SEL))_imp(objcT7,selTransTbl[0]))(objcT7,selTransTbl[0]))==(BOOL)0){id objcT8; # 105 "method.m"if(self->ksel&&(objcT8=self->ksel,(*(unsigned(*)(id,SEL))_imp(objcT8,selTransTbl[4]))(objcT8,selTransTbl[4]))>3)self->isselptr=(BOOL)0;}else{if(self->usel){id objcT9; # 109 "method.m"if(self->restype&& !(objcT9=self->restype,(*(BOOL(*)(id,SEL))_imp(objcT9,selTransTbl[1]))(objcT9,selTransTbl[1])))self->isselptr=(BOOL)0;}if(self->ksel){id objcT10; # 113 "method.m"int i,n=(objcT10=self->ksel,(*(unsigned(*)(id,SEL))_imp(objcT10,selTransTbl[4]))(objcT10,selTransTbl[4])); if(n>3){self->isselptr=(BOOL)0;}else{id objcT11; # 118 "method.m"if(self->restype&& !(objcT11=self->restype,(*(BOOL(*)(id,SEL))_imp(objcT11,selTransTbl[1]))(objcT11,selTransTbl[1]))){self->isselptr=(BOOL)0;return(id)self;}for(i=0;i<n;i++){id objcT12,objcT13; # 123 "method.m"if( !(objcT12=(objcT13=self->ksel,(*(id(*)(id,SEL,unsigned))_imp(objcT13,selTransTbl[5]))(objcT13,selTransTbl[5],i)),(*(BOOL(*)(id,SEL))_imp(objcT12,selTransTbl[1]))(objcT12,selTransTbl[1]))){self->isselptr=(BOOL)0;return(id)self;}}}}}return(id)self;} static id i_Method_calchash(struct Method_PRIVATE *self,SEL _cmd){self->havehash=(BOOL)1;# 141 "method.m"if(self->usel){id objcT14,objcT15;self-># 142 "method.m"typehash=(self->restype)?(objcT14=self->restype,(*(unsigned(*)(id,SEL))_imp(objcT14,selTransTbl[6]))(objcT14,selTransTbl[6])):(objcT15=t_id,(*(unsigned(*)(id,SEL))_imp(objcT15,selTransTbl[6]))(objcT15,selTransTbl[6]));}if(self->ksel){id objcT16,objcT17,objcT18; # 145 "method.m"int i,n;self-> typehash=(self->restype)?(objcT16=self->restype,(*(unsigned(*)(id,SEL))_imp(objcT16,selTransTbl[6]))(objcT16,selTransTbl[6])):(objcT17=t_id,(*(unsigned(*)(id,SEL))_imp(objcT17,selTransTbl[6]))(objcT17,selTransTbl[6]));for(i=0,n=(objcT18=self->ksel,(*(unsigned(*)(id,SEL))_imp(objcT18,selTransTbl[4]))(objcT18,selTransTbl[4]));i<n;i++){id objcT19,objcT20;self-># 149 "method.m"typehash=(self->typehash<<1)^(objcT19=(objcT20=self->ksel,(*(id(*)(id,SEL,unsigned))_imp(objcT20,selTransTbl[5]))(objcT20,selTransTbl[5],i)),(*(unsigned(*)(id,SEL))_imp(objcT19,selTransTbl[7]))(objcT19,selTransTbl[7]));}}return(id)self;} static unsigned i_Method_typehash(struct Method_PRIVATE *self,SEL _cmd){id objcT21; # 157 "method.m"if( !self->havehash)(objcT21=(id)self,(*_imp(objcT21,selTransTbl[8]))(objcT21,selTransTbl[8]));return self->typehash;} static BOOL i_Method_typeEqual_(struct Method_PRIVATE *self,SEL _cmd,id that){if((id)self==that){return(BOOL)1;}else{id objcT22,objcT23,objcT24,objcT25; # 167 "method.m"id y;id a=self->restype;id b=(objcT22=that,(*_imp(objcT22,selTransTbl[9]))(objcT22,selTransTbl[9])); if( !a)a=t_id;if( !b)b=t_id;if( !(objcT23=a,(*(BOOL(*)(id,SEL,id))_imp(objcT23,selTransTbl[10]))(objcT23,selTransTbl[10],b)))return(BOOL)0;if(self->usel&&(y=(objcT24=that,(*_imp(objcT24,selTransTbl[11]))(objcT24,selTransTbl[11])))){return(BOOL)1;}if(self->ksel&&(y=(objcT25=that,(*_imp(objcT25,selTransTbl[12]))(objcT25,selTransTbl[12])))){id objcT26,objcT27; # 181 "method.m"int i,n=(objcT26=self->ksel,(*(unsigned(*)(id,SEL))_imp(objcT26,selTransTbl[4]))(objcT26,selTransTbl[4])); if(n!=(objcT27=y,(*(unsigned(*)(id,SEL))_imp(objcT27,selTransTbl[4]))(objcT27,selTransTbl[4])))return(BOOL)0;for(i=0;i<n;i++){id objcT28,objcT29,objcT30; # 186 "method.m"if( !(objcT28=(objcT29=self->ksel,(*(id(*)(id,SEL,unsigned))_imp(objcT29,selTransTbl[5]))(objcT29,selTransTbl[5],i)),(*(BOOL(*)(id,SEL,id))_imp(objcT28,selTransTbl[13]))(objcT28,selTransTbl[13],(objcT30=y,(*(id(*)(id,SEL,unsigned))_imp(objcT30,selTransTbl[5]))(objcT30,selTransTbl[5],i)))))return(BOOL)0;}return(BOOL)1;}return(BOOL)0;}} static id i_Method_calcneedscast(struct Method_PRIVATE *self,SEL _cmd){id objcT31;self-># 197 "method.m"haveneedscast++; if(o_inlinecache){self->needscast=(BOOL)1;return(id)self;}if(self->restype!=(id)0&& !(objcT31=self->restype,(*(BOOL(*)(id,SEL))_imp(objcT31,selTransTbl[14]))(objcT31,selTransTbl[14]))){self->needscast=(BOOL)1;return(id)self;}if(self->ksel){id objcT32; # 208 "method.m"int i,n; for(i=0,n=(objcT32=self->ksel,(*(unsigned(*)(id,SEL))_imp(objcT32,selTransTbl[4]))(objcT32,selTransTbl[4]));i<n;i++){id objcT33,objcT34; # 211 "method.m"if( !(objcT33=(objcT34=self->ksel,(*(id(*)(id,SEL,unsigned))_imp(objcT34,selTransTbl[5]))(objcT34,selTransTbl[5],i)),(*(BOOL(*)(id,SEL))_imp(objcT33,selTransTbl[14]))(objcT33,selTransTbl[14]))){self->needscast=(BOOL)1;break;}}}return(id)self;} static BOOL i_Method_needscast(struct Method_PRIVATE *self,SEL _cmd){id objcT35; # 222 "method.m"

Lines 1–500 of 958.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t