/* generated by Id 1.1 at ,$ */ /* with the command: -I../stage1/ -c Symbol.st -o ../stage2/Symbol.o.c */ #include static struct __libid *_libid= 0; #ifdef ID_DEBUG # define _enter(info) void *__id_debug= _libid->enter(info) # define _line(lno) _libid->line(lno) # define _leave() _libid->leave(__id_debug) # define _backtrace() _libid->backtrace() #else # define _enter(info) (void)info # define _line(lno) # define _leave() # define _backtrace() "(no debugging information)\n" #endif #define _return _leave(); return #define _sendv(MSG, N, RCV, ARG...) ({ \ struct __send _s= { (MSG), (N), (RCV) }; \ ((_imp_t)(_libid->bindv(&_s)))(&_s, _s.receiver, _s.receiver, ##ARG); \ }) #define _superv(TYP, MSG, N, RCV, ARG...) ({ \ struct __send _s= { (MSG), (N), (TYP) }; \ _imp_t _imp= _libid->bindv(&_s); \ _s.receiver= (RCV); \ _imp(&_s, _s.receiver, _s.receiver, ##ARG); \ }) static oop s_new_5f_= 0; static oop s__5fclone= 0; static oop s_nextPut_= 0; static oop s_size_5f_value_5f_= 0; static oop s__5fdebugName= 0; static oop s_at_ifAbsent_= 0; static oop s_new= 0; static oop s__5fimport_= 0; static oop s_basicNewFromString_= 0; static oop s_function_5f_arity_5f_outer_state_nlr_5f_= 0; static oop s_initialize_= 0; static oop s_value_5f_= 0; static oop s_byteAt_put_= 0; static oop s_byteAt_= 0; static oop s_nextPutAll_= 0; static oop s_printOn_= 0; static oop s__5fslots= 0; static oop s_to_do_= 0; static oop s__2c= 0; static oop s_size= 0; static oop s_asSymbol= 0; static oop s__5fsizeof= 0; static oop s_intern_= 0; static oop s_at_put_= 0; static struct _Selector { const char *name; oop *addr; } _Selectors[]= { { "new_:", &s_new_5f_ }, { "_clone", &s__5fclone }, { "nextPut:", &s_nextPut_ }, { "size_:value_:", &s_size_5f_value_5f_ }, { "_debugName", &s__5fdebugName }, { "at:ifAbsent:", &s_at_ifAbsent_ }, { "new", &s_new }, { "_import:", &s__5fimport_ }, { "basicNewFromString:", &s_basicNewFromString_ }, { "function_:arity_:outer:state:nlr_:", &s_function_5f_arity_5f_outer_state_nlr_5f_ }, { "initialize:", &s_initialize_ }, { "value_:", &s_value_5f_ }, { "byteAt:put:", &s_byteAt_put_ }, { "byteAt:", &s_byteAt_ }, { "nextPutAll:", &s_nextPutAll_ }, { "printOn:", &s_printOn_ }, { "_slots", &s__5fslots }, { "to:do:", &s_to_do_ }, { ",", &s__2c }, { "size", &s_size }, { "asSymbol", &s_asSymbol }, { "_sizeof", &s__5fsizeof }, { "intern:", &s_intern_ }, { "at:put:", &s_at_put_ }, { 0, 0 } }; struct t__object { struct _vtable *_vtable[0]; }; struct t__selector { struct _vtable *_vtable[0]; oop v__size; oop v__elements; }; struct t__assoc { struct _vtable *_vtable[0]; oop v_key; oop v_value; }; struct t__closure { struct _vtable *_vtable[0]; oop v__method; oop v_data; }; struct t__vector { struct _vtable *_vtable[0]; oop v__size; }; struct t__vtable { struct _vtable *_vtable[0]; oop v__tally; oop v_bindings; oop v_delegate; }; struct t_Object { struct _vtable *_vtable[0]; }; struct t_UndefinedObject { struct _vtable *_vtable[0]; }; struct t_StaticBlockClosure { struct _vtable *_vtable[0]; oop v__function; oop v__arity; }; struct t_BlockClosure { struct _vtable *_vtable[0]; oop v__function; oop v__arity; oop v_outer; oop v_state; oop v__nlr; }; struct t_Magnitude { struct _vtable *_vtable[0]; }; struct t_Character { struct _vtable *_vtable[0]; oop v_value; }; struct t_Number { struct _vtable *_vtable[0]; }; struct t_Fraction { struct _vtable *_vtable[0]; oop v_numerator; oop v_denominator; }; struct t_Float { struct _vtable *_vtable[0]; }; struct t_Integer { struct _vtable *_vtable[0]; }; struct t_SmallInteger { struct _vtable *_vtable[0]; }; struct t_LargePositiveInteger { struct _vtable *_vtable[0]; oop v_bytes; }; struct t_LargeNegativeInteger { struct _vtable *_vtable[0]; oop v_bytes; }; struct t_Collection { struct _vtable *_vtable[0]; }; struct t_SequenceableCollection { struct _vtable *_vtable[0]; }; struct t_ArrayedCollection { struct _vtable *_vtable[0]; oop v_size; }; struct t_Array { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; struct t_ImmutableArray { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; struct t_WordArray { struct _vtable *_vtable[0]; oop v_size; oop v__words; }; struct t_ImmutableWordArray { struct _vtable *_vtable[0]; oop v_size; oop v__words; }; struct t_ByteArray { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_ImmutableByteArray { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_String { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_ImmutableString { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_Symbol { struct _vtable *_vtable[0]; oop v_size; oop v__bytes; }; struct t_nil { struct _vtable *_vtable[0]; }; struct t_true { struct _vtable *_vtable[0]; }; struct t_false { struct _vtable *_vtable[0]; }; struct t_CharacterTable { struct _vtable *_vtable[0]; oop v_size; oop v__pointers; }; struct t_Set { struct _vtable *_vtable[0]; oop v_tally; oop v_array; }; struct t_LookupKey { struct _vtable *_vtable[0]; oop v_key; }; struct t_Association { struct _vtable *_vtable[0]; oop v_key; oop v_value; }; struct t_OrderedCollection { struct _vtable *_vtable[0]; oop v_array; oop v_firstIndex; oop v_lastIndex; }; struct t_Dictionary { struct _vtable *_vtable[0]; oop v_tally; oop v_array; }; struct t_SymbolTable { struct _vtable *_vtable[0]; oop v_tally; oop v_array; }; static oop l_5= 0; static oop l_9= 0; static oop l_10= 0; static oop v__object= 0; static oop v__vector= 0; static oop v_Object= 0; static oop v_UndefinedObject= 0; static oop v_StaticBlockClosure= 0; static oop v_BlockClosure= 0; static oop v_Magnitude= 0; static oop v_Character= 0; static oop v_Number= 0; static oop v_Integer= 0; static oop v_SmallInteger= 0; static oop v_LargePositiveInteger= 0; static oop v_Collection= 0; static oop v_SequenceableCollection= 0; static oop v_ArrayedCollection= 0; static oop v_Array= 0; static oop v_WordArray= 0; static oop v_ByteArray= 0; static oop v_String= 0; static oop v_ImmutableString= 0; static oop v_Symbol= 0; static oop v_Set= 0; static oop v_LookupKey= 0; static oop v_Dictionary= 0; static oop v_SymbolTable= 0; static struct __methodinfo __info1= { "size_:value_:", "Symbol", "/Users/piumarta/src/idst/object/st80/Symbol.st", 0, 26, 31, 0 }; static oop Symbol__size_5f_value_5f_(oop v__closure, oop v_stateful_self, oop v_self, oop v__size, oop v__value) { _enter(&__info1); oop _1= 0; oop _2= 0; oop _3= 0; oop _4= 0; _line(26); _1= v_self; _2= v_String; _3= v__size; _4= v__value; _line(28); _2=_sendv(s_size_5f_value_5f_, 3, _2, _3, _4); _line(28); _1=_sendv(s_intern_, 2, _1, _2); _leave(); return _1; _leave(); } static size_t SymbolTable___5fsizeof(oop _closure, oop v_self) { return sizeof(struct t_SymbolTable); } static char *SymbolTable___5fdebugName(oop _closure, oop v_self) { return "SymbolTable"; } static struct __slotinfo *SymbolTable___5fslots(oop _closure, oop v_self) { static struct __slotinfo info[]= { { "tally", 0, 4 }, { "array", 4, 4 }, { 0, 0, 0 } }; return &info[0]; } static struct __methodinfo __info3= { "[] intern:", "Symbol", "/Users/piumarta/src/idst/object/st80/Symbol.st", 0, 36, 44, &__info1 }; static oop b_3(oop v__closure, oop v__self) { _enter(&__info3); oop _1= 0; oop _2= 0; oop _3= 0; oop _4= 0; _line(39); _1= v_SymbolTable; _2= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1]; /* aString */ _3= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[2]; /* self */ _4= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1]; /* aString */ _line(39); _3=_sendv(s_basicNewFromString_, 2, _3, _4); _line(39); _1=_sendv(s_at_put_, 3, _1, _2, _3); _leave(); return _1; _leave(); } static struct __methodinfo __info2= { "intern:", "Symbol", "/Users/piumarta/src/idst/object/st80/Symbol.st", 0, 36, 44, &__info3 }; static oop Symbol__intern_(oop v__closure, oop v_stateful_self, oop v_self, oop v_aString) { _enter(&__info2); oop _state1= _sendv(s_new_5f_, 2, v__vector, 6); oop v_symbol= 0; oop _1= 0; oop _2= 0; oop _3= 0; (void)v_symbol; ((oop *)_state1)[3]= v_stateful_self; ((oop *)_state1)[2]= v_self; ((oop *)_state1)[1]= v_aString; _line(36); _1= v_SymbolTable; _2= ((oop *)_state1)[1]; /* aString */ /* Scope() */ /* Scope('size'->SlotVariableNode 'symbol'->TemporaryVariableNode 'aString'->ArgumentVariableNode 'self'->ArgumentVariableNode '_bytes'->SlotVariableNode 'stateful_self'->ArgumentVariableNode) */ /* nil */ /* 2 */ /* 1 */ _3= _sendv(s_function_5f_arity_5f_outer_state_nlr_5f_, 6, v_BlockClosure, (oop)b_3, 0, 0, ((oop *)_state1), 0); _line(39); _1=_sendv(s_at_ifAbsent_, 3, _1, _2, _3); v_symbol= _1; _1= v_symbol; _leave(); return _1; _leave(); } static struct __methodinfo __info6= { "[] basicNewFromString:", "Symbol", "/Users/piumarta/src/idst/object/st80/Symbol.st", 0, 44, 52, &__info2 }; static oop b_6(oop v__closure, oop v__self, oop v_index) { _enter(&__info6); oop _1= 0; oop _2= 0; oop _3= 0; oop _4= 0; _line(49); _1= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1]; /* self */ _2= v_index; _3= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[3]; /* aString */ _4= v_index; _line(49); _3=_sendv(s_byteAt_, 2, _3, _4); _line(49); _1=_sendv(s_byteAt_put_, 3, _1, _2, _3); _leave(); return _1; _leave(); } static struct __methodinfo __info4= { "basicNewFromString:", "Symbol", "/Users/piumarta/src/idst/object/st80/Symbol.st", 0, 44, 52, &__info6 }; static oop Symbol__basicNewFromString_(oop v__closure, oop v_stateful_self, oop v_self, oop v_aString) { _enter(&__info4); oop _state1= _sendv(s_new_5f_, 2, v__vector, 6); oop v_length= 0; oop _1= 0; oop _2= 0; oop _3= 0; (void)v_length; ((oop *)_state1)[2]= v_stateful_self; ((oop *)_state1)[1]= v_self; ((oop *)_state1)[3]= v_aString; _line(44); _1= ((oop *)_state1)[3]; /* aString */ _line(47); _1=_sendv(s_size, 1, _1); v_length= _1; _1= ((oop *)_state1)[1]; /* self */ _line(48); _1=_sendv(s__5fclone, 1, _1); _2= v_length; _line(48); _1=_sendv(s_initialize_, 2, _1, _2); ((oop *)_state1)[1]= _1; /* self */ ((oop *)_state1)[2]= _1; /* stateful_self */ _1= l_5; _2= v_length; /* Scope('index'->ArgumentVariableNode) */ /* Scope('size'->SlotVariableNode 'self'->ArgumentVariableNode 'aString'->ArgumentVariableNode 'length'->TemporaryVariableNode '_bytes'->SlotVariableNode 'stateful_self'->ArgumentVariableNode) */ /* nil */ /* 2 */ /* 1 */ _3= _sendv(s_function_5f_arity_5f_outer_state_nlr_5f_, 6, v_BlockClosure, (oop)b_6, 1, 0, ((oop *)_state1), 0); _line(49); _1=_sendv(s_to_do_, 3, _1, _2, _3); _1= ((oop *)_state1)[1]; /* self */ _leave(); return _1; _leave(); } static struct __methodinfo __info7= { ",", "Symbol", "/Users/piumarta/src/idst/object/st80/Symbol.st", 0, 52, 57, &__info4 }; static oop Symbol___2c(oop v__closure, oop v_stateful_self, oop v_self, oop v_aSymbolOrString) { _enter(&__info7); oop _1= 0; oop _2= 0; oop _3= 0; _line(52); _1= v_self; _2= v_self; _3= v_aSymbolOrString; _line(54); _2=_superv(v_ImmutableString, s__2c, 2, _2, _3); _line(54); _1=_sendv(s_intern_, 2, _1, _2); _leave(); return _1; _leave(); } static struct __methodinfo __info8= { "printOn:", "Symbol", "/Users/piumarta/src/idst/object/st80/Symbol.st", 0, 57, 64, &__info7 }; static oop Symbol__printOn_(oop v__closure, oop v_stateful_self, oop v_self, oop v_aStream) { _enter(&__info8); oop _1= 0; oop _2= 0; _line(57); _1= v_aStream; _2= l_9; _line(59); _sendv(s_nextPutAll_, 2, _1, _2); _2= v_self; _sendv(s_nextPutAll_, 2, _1, _2); _2= l_10; _1=_sendv(s_nextPut_, 2, _1, _2); _1= v_self; _leave(); return _1; _leave(); } static struct __methodinfo __info11= { "asSymbol", "String", "/Users/piumarta/src/idst/object/st80/Symbol.st", 0, 64, 68, &__info8 }; static oop String__asSymbol(oop v__closure, oop v_stateful_self, oop v_self) { _enter(&__info11); oop _1= 0; oop _2= 0; _line(64); _1= v_Symbol; _2= v_self; _line(66); _1=_sendv(s_intern_, 2, _1, _2); _leave(); return _1; _leave(); } static struct __methodinfo __info= { "__id__init__", "", "Symbol.st", 0, 0, 0, &__info11 }; void __id__init__Symbol(struct __libid *__libid) { if (_libid) return; if (!(_libid= __libid)) { fprintf(stderr, "init _libid %p\n", __libid); abort(); } # define GC_add_roots _libid->gc_addRoots GC_INIT(); { struct _Selector *s= 0; for (s= _Selectors; s->name; ++s) *s->addr= _libid->intern(s->name); } _enter(&__info); _libid->infos(&__info, &__info1); _sendv(s__5fimport_, 3, _libid->_object, "String", "__id__init__String"); v__object= _libid->import("_object"); v__vector= _libid->import("_vector"); v_Object= _libid->import("Object"); v_UndefinedObject= _libid->import("UndefinedObject"); v_StaticBlockClosure= _libid->import("StaticBlockClosure"); v_BlockClosure= _libid->import("BlockClosure"); v_Magnitude= _libid->import("Magnitude"); v_Character= _libid->import("Character"); v_Number= _libid->import("Number"); v_Integer= _libid->import("Integer"); v_SmallInteger= _libid->import("SmallInteger"); v_LargePositiveInteger= _libid->import("LargePositiveInteger"); v_Collection= _libid->import("Collection"); v_SequenceableCollection= _libid->import("SequenceableCollection"); v_ArrayedCollection= _libid->import("ArrayedCollection"); v_Array= _libid->import("Array"); v_WordArray= _libid->import("WordArray"); v_ByteArray= _libid->import("ByteArray"); v_String= _libid->import("String"); v_ImmutableString= _libid->import("ImmutableString"); v_Symbol= _libid->import("Symbol"); _sendv(s__5fimport_, 3, _libid->_object, "Dictionary", "__id__init__Dictionary"); v_Set= _libid->import("Set"); v_LookupKey= _libid->import("LookupKey"); v_Dictionary= _libid->import("Dictionary"); _libid->method(v_Symbol, s_size_5f_value_5f_, (_imp_t)Symbol__size_5f_value_5f_); v_SymbolTable= _libid->proto2(v_Dictionary, SymbolTable___5fsizeof(0, 0)); _libid->method(v_SymbolTable, s__5fsizeof, (_imp_t)SymbolTable___5fsizeof); _libid->method(v_SymbolTable, s__5fdebugName, (_imp_t)SymbolTable___5fdebugName); _libid->method(v_SymbolTable, s__5fslots, (_imp_t)SymbolTable___5fslots); _libid->export("SymbolTable", v_SymbolTable); { oop _1= 0; _1= v_SymbolTable; _line(33); _1=_sendv(s_new, 1, _1); v_SymbolTable= _1; _libid->export("SymbolTable", v_SymbolTable); } _libid->method(v_Symbol, s_intern_, (_imp_t)Symbol__intern_); l_5= _sendv(s_value_5f_, 2, v_SmallInteger, 1); _libid->method(v_Symbol, s_basicNewFromString_, (_imp_t)Symbol__basicNewFromString_); _libid->method(v_Symbol, s__2c, (_imp_t)Symbol___2c); l_9= _sendv(s_size_5f_value_5f_, 3, v_ImmutableString, 2, "#'"); l_10= _sendv(s_value_5f_, 2, v_Character, 39); _libid->method(v_Symbol, s_printOn_, (_imp_t)Symbol__printOn_); _libid->method(v_String, s_asSymbol, (_imp_t)String__asSymbol); _leave(); }