/* generated by Id 1.1 at ,$ */ /* with the command: -I../stage1/ -c ArrayedCollection.st -o ../stage2/ArrayedCollection.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_= 0; static oop s_new_5f_= 0; static oop s_value_5f_= 0; static oop s_species= 0; static oop s__5fimport_= 0; static oop s_yourself= 0; static oop s_with_with_= 0; static oop s_collect_= 0; static oop s_initialize= 0; static oop s_size= 0; static oop s_atAllPut_= 0; static oop s_initialize_= 0; static oop s_new_withAll_= 0; static oop s_doWithIndex_= 0; static oop s_new= 0; static oop s_with_= 0; static oop s_function_5f_arity_5f_outer_state_nlr_5f_= 0; static oop s_byteSize= 0; static oop s__2a= 0; static oop s_elementSize= 0; static oop s__5fsize= 0; static oop s__5fintegerValue= 0; static oop s_withAll_= 0; static oop s_value_= 0; static oop s_at_put_= 0; static struct _Selector { const char *name; oop *addr; } _Selectors[]= { { "new:", &s_new_ }, { "new_:", &s_new_5f_ }, { "value_:", &s_value_5f_ }, { "species", &s_species }, { "_import:", &s__5fimport_ }, { "yourself", &s_yourself }, { "with:with:", &s_with_with_ }, { "collect:", &s_collect_ }, { "initialize", &s_initialize }, { "size", &s_size }, { "atAllPut:", &s_atAllPut_ }, { "initialize:", &s_initialize_ }, { "new:withAll:", &s_new_withAll_ }, { "doWithIndex:", &s_doWithIndex_ }, { "new", &s_new }, { "with:", &s_with_ }, { "function_:arity_:outer:state:nlr_:", &s_function_5f_arity_5f_outer_state_nlr_5f_ }, { "byteSize", &s_byteSize }, { "*", &s__2a }, { "elementSize", &s_elementSize }, { "_size", &s__5fsize }, { "_integerValue", &s__5fintegerValue }, { "withAll:", &s_withAll_ }, { "value:", &s_value_ }, { "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; }; static oop l_4= 0; static oop l_7= 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_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 struct __methodinfo __info1= { "new:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 25, 30, 0 }; static oop ArrayedCollection__new_(oop v__closure, oop v_stateful_self, oop v_self, oop v_anInteger) { _enter(&__info1); oop _1= 0; oop _2= 0; _line(25); _1= v_self; _line(27); _1=_superv(v_SequenceableCollection, s_new, 1, _1); _2= v_anInteger; _line(27); _1=_sendv(s_initialize_, 2, _1, _2); _leave(); return _1; _leave(); } static struct __methodinfo __info2= { "new:withAll:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 30, 35, &__info1 }; static oop ArrayedCollection__new_withAll_(oop v__closure, oop v_stateful_self, oop v_self, oop v_capacity, oop v_value) { _enter(&__info2); oop _1= 0; oop _2= 0; _line(30); _1= v_self; _2= v_capacity; _line(32); _1=_sendv(s_new_, 2, _1, _2); _2= v_value; _line(32); _1=_sendv(s_atAllPut_, 2, _1, _2); _leave(); return _1; _leave(); } static struct __methodinfo __info3= { "initialize", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 35, 41, &__info2 }; static oop ArrayedCollection__initialize(oop v__closure, oop v_stateful_self, oop v_self) { _enter(&__info3); oop _1= 0; _line(35); _1= v_self; _line(37); _1=_superv(v_SequenceableCollection, s_initialize, 1, _1); _1= l_4; ((struct t_ArrayedCollection *)v_stateful_self)->v_size= _1; _1= v_self; _leave(); return _1; _leave(); } static struct __methodinfo __info5= { "initialize:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 41, 47, &__info3 }; static oop ArrayedCollection__initialize_(oop v__closure, oop v_stateful_self, oop v_self, oop v_anInteger) { _enter(&__info5); oop _1= 0; oop _2= 0; _line(41); _1= v_self; _2= v_anInteger; _line(43); _1=_superv(v_SequenceableCollection, s_initialize_, 2, _1, _2); _1= v_anInteger; ((struct t_ArrayedCollection *)v_stateful_self)->v_size= _1; _1= v_self; _leave(); return _1; _leave(); } static struct __methodinfo __info6= { "with:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 47, 54, &__info5 }; static oop ArrayedCollection__with_(oop v__closure, oop v_stateful_self, oop v_self, oop v_anObject) { _enter(&__info6); oop _1= 0; oop _2= 0; oop _3= 0; _line(47); _1= v_self; _2= l_7; _line(49); _1=_sendv(s_new_, 2, _1, _2); _2= l_7; _3= v_anObject; _line(50); _sendv(s_at_put_, 3, _1, _2, _3); _1=_sendv(s_yourself, 1, _1); _leave(); return _1; _leave(); } static struct __methodinfo __info8= { "with:with:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 54, 62, &__info6 }; static oop ArrayedCollection__with_with_(oop v__closure, oop v_stateful_self, oop v_self, oop v_anObject, oop v_anotherObject) { _enter(&__info8); oop _1= 0; oop _2= 0; oop _3= 0; _line(54); _1= v_self; _2= l_9; _line(56); _1=_sendv(s_new_, 2, _1, _2); _2= l_10; _3= v_anObject; _line(57); _sendv(s_at_put_, 3, _1, _2, _3); _2= l_9; _3= v_anotherObject; _sendv(s_at_put_, 3, _1, _2, _3); _1=_sendv(s_yourself, 1, _1); _leave(); return _1; _leave(); } static struct __methodinfo __info12= { "[] withAll:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 62, 68, &__info8 }; static oop b_12(oop v__closure, oop v__self, oop v_e, oop v_i) { _enter(&__info12); oop _1= 0; oop _2= 0; oop _3= 0; _line(65); _1= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1]; /* self */ _2= v_i; _3= v_e; _line(65); _1=_sendv(s_at_put_, 3, _1, _2, _3); _leave(); return _1; _leave(); } static struct __methodinfo __info11= { "withAll:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 62, 68, &__info12 }; static oop ArrayedCollection__withAll_(oop v__closure, oop v_stateful_self, oop v_self, oop v_aCollection) { _enter(&__info11); oop _state1= _sendv(s_new_5f_, 2, v__vector, 4); oop _1= 0; oop _2= 0; ((oop *)_state1)[2]= v_stateful_self; ((oop *)_state1)[1]= v_self; _line(62); _1= ((oop *)_state1)[1]; /* self */ _2= v_aCollection; _line(64); _2=_sendv(s_size, 1, _2); _line(64); _1=_sendv(s_new_, 2, _1, _2); ((oop *)_state1)[1]= _1; /* self */ ((oop *)_state1)[2]= _1; /* stateful_self */ _1= v_aCollection; /* Scope('e'->ArgumentVariableNode 'i'->ArgumentVariableNode) */ /* Scope('size'->SlotVariableNode 'self'->ArgumentVariableNode 'aCollection'->ArgumentVariableNode 'stateful_self'->ArgumentVariableNode) */ /* nil */ /* 2 */ /* 1 */ _2= _sendv(s_function_5f_arity_5f_outer_state_nlr_5f_, 6, v_BlockClosure, (oop)b_12, 2, 0, ((oop *)_state1), 0); _line(65); _1=_sendv(s_doWithIndex_, 2, _1, _2); _1= ((oop *)_state1)[1]; /* self */ _leave(); return _1; _leave(); } static struct __methodinfo __info13= { "size", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 68, 73, &__info11 }; static oop ArrayedCollection__size(oop v__closure, oop v_stateful_self, oop v_self) { _enter(&__info13); oop _1= 0; _line(68); _1= ((struct t_ArrayedCollection *)v_stateful_self)->v_size; _leave(); return _1; _leave(); } static struct __methodinfo __info14= { "byteSize", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 73, 78, &__info13 }; static oop ArrayedCollection__byteSize(oop v__closure, oop v_stateful_self, oop v_self) { _enter(&__info14); oop _1= 0; oop _2= 0; _line(73); _1= ((struct t_ArrayedCollection *)v_stateful_self)->v_size; _2= v_self; _line(75); _2=_sendv(s_elementSize, 1, _2); { int _l= (long)_1 >> 1; int _r= (long)_2 >> 1; int _s= (_l * _r); if ((1 & (long)_1 & (long)_2) && ((_r == 0) || (_s / _r == _l)) && ((_s ^ (_s << 1)) >= 0)) _1= (oop)(long)(_s << 1 | 1); else _1= _sendv(s__2a, 2, _1, _2); } _leave(); return _1; _leave(); } static struct __methodinfo __info16= { "[] collect:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 78, 86, &__info14 }; static oop b_16(oop v__closure, oop v__self, oop v_elt, oop v_ind) { _enter(&__info16); oop _1= 0; oop _2= 0; oop _3= 0; oop _4= 0; _line(82); _1= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[1]; /* answer */ _2= v_ind; _3= ((oop *)((struct t_BlockClosure *)((struct t_BlockClosure *)v__self)->v_state))[2]; /* unaryBlock */ _4= v_elt; _line(82); _3=_sendv(s_value_, 2, _3, _4); _line(82); _1=_sendv(s_at_put_, 3, _1, _2, _3); _leave(); return _1; _leave(); } static struct __methodinfo __info15= { "collect:", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 78, 86, &__info16 }; static oop ArrayedCollection__collect_(oop v__closure, oop v_stateful_self, oop v_self, oop v_unaryBlock) { _enter(&__info15); oop _state1= _sendv(s_new_5f_, 2, v__vector, 3); oop _1= 0; oop _2= 0; ((oop *)_state1)[2]= v_unaryBlock; _line(78); _1= v_self; _line(81); _1=_sendv(s_species, 1, _1); _2= v_self; _line(81); _2=_sendv(s_size, 1, _2); _line(81); _1=_sendv(s_new_, 2, _1, _2); ((oop *)_state1)[1]= _1; /* answer */ _1= v_self; /* Scope('elt'->ArgumentVariableNode 'ind'->ArgumentVariableNode) */ /* Scope('size'->SlotVariableNode 'self'->ArgumentVariableNode 'answer'->TemporaryVariableNode 'unaryBlock'->ArgumentVariableNode 'stateful_self'->ArgumentVariableNode) */ /* nil */ /* 2 */ /* 1 */ _2= _sendv(s_function_5f_arity_5f_outer_state_nlr_5f_, 6, v_BlockClosure, (oop)b_16, 2, 0, ((oop *)_state1), 0); _line(82); _1=_sendv(s_doWithIndex_, 2, _1, _2); _1= ((oop *)_state1)[1]; /* answer */ _leave(); return _1; _leave(); } static struct __methodinfo __info17= { "_size", "ArrayedCollection", "/Users/piumarta/src/idst/object/st80/ArrayedCollection.st", 0, 86, 90, &__info15 }; static oop ArrayedCollection___5fsize(oop v__closure, oop v_stateful_self, oop v_self) { _enter(&__info17); oop _1= 0; _line(86); _1= ((struct t_ArrayedCollection *)v_stateful_self)->v_size; _line(88); _1=_sendv(s__5fintegerValue, 1, _1); _leave(); return _1; _leave(); } static struct __methodinfo __info= { "__id__init__", "", "ArrayedCollection.st", 0, 0, 0, &__info17 }; void __id__init__ArrayedCollection(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, "SequenceableCollection", "__id__init__SequenceableCollection"); 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_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"); _libid->method(v_ArrayedCollection, s_new_, (_imp_t)ArrayedCollection__new_); _libid->method(v_ArrayedCollection, s_new_withAll_, (_imp_t)ArrayedCollection__new_withAll_); l_4= _sendv(s_value_5f_, 2, v_SmallInteger, 0); _libid->method(v_ArrayedCollection, s_initialize, (_imp_t)ArrayedCollection__initialize); _libid->method(v_ArrayedCollection, s_initialize_, (_imp_t)ArrayedCollection__initialize_); l_7= _sendv(s_value_5f_, 2, v_SmallInteger, 1); _libid->method(v_ArrayedCollection, s_with_, (_imp_t)ArrayedCollection__with_); l_9= _sendv(s_value_5f_, 2, v_SmallInteger, 2); l_10= _sendv(s_value_5f_, 2, v_SmallInteger, 1); _libid->method(v_ArrayedCollection, s_with_with_, (_imp_t)ArrayedCollection__with_with_); _libid->method(v_ArrayedCollection, s_withAll_, (_imp_t)ArrayedCollection__withAll_); _libid->method(v_ArrayedCollection, s_size, (_imp_t)ArrayedCollection__size); _libid->method(v_ArrayedCollection, s_byteSize, (_imp_t)ArrayedCollection__byteSize); _libid->method(v_ArrayedCollection, s_collect_, (_imp_t)ArrayedCollection__collect_); _libid->method(v_ArrayedCollection, s__5fsize, (_imp_t)ArrayedCollection___5fsize); _leave(); }