X-Git-Url: http://nitlanguage.org diff --git a/c_src/hash._sep.c b/c_src/hash._sep.c index 88adbd7..53950ad 100644 --- a/c_src/hash._sep.c +++ b/c_src/hash._sep.c @@ -1,1000 +1,89 @@ /* This C file is generated by NIT to compile module hash. */ #include "hash._sep.h" -val_t hash___Object___hash(val_t self) { - struct trace_t trace = {NULL, NULL, 21, LOCATE_hash___Object___hash}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = TAG_Int((bigint) self); - variable0 = TAG_Int(UNTAG_Int(variable0)/UNTAG_Int( TAG_Int(8))); - goto return_label0; - return_label0: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___String___hash(val_t self) { - struct trace_t trace = {NULL, NULL, 29, LOCATE_hash___String___hash}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = TAG_Int(5381); - variable2 = ATTR_array___AbstractArray____length( self) /*AbstractArray::_length*/; - variable2 = TAG_Int(UNTAG_Int(variable2)-UNTAG_Int( TAG_Int(1))); - variable1 = variable2; - variable3 = ATTR_string___String____items( self) /*String::_items*/; - variable2 = variable3; - while (true) { /*while*/ - variable3 = TAG_Bool(UNTAG_Int( variable1 /*i*/)>=UNTAG_Int( TAG_Int(0))); - if (!UNTAG_Bool(variable3)) break; /* while*/ - variable3 = TAG_Int(UNTAG_Int( variable0 /*h*/)*UNTAG_Int( TAG_Int(32))); - variable3 = TAG_Int(UNTAG_Int(variable3)+UNTAG_Int( variable0 /*h*/)); - variable4 = TAG_Char(UNBOX_NativeString( variable2 /*it*/)[UNTAG_Int( variable1 /*i*/)]); - variable4 = TAG_Int((unsigned char)UNTAG_Char(variable4)); - variable3 = TAG_Int(UNTAG_Int(variable3)+UNTAG_Int(variable4)); - variable0 = variable3 /*h=*/; - variable1 = TAG_Int(UNTAG_Int(variable1)-UNTAG_Int( TAG_Int(1))) /*i*/; - continue_2: while(0); - } - break_2: while(0); - variable0 = variable0 /*h*/; - goto return_label1; - return_label1: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___Int___hash(val_t self) { - struct trace_t trace = {NULL, NULL, 45, LOCATE_hash___Int___hash}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = self; - goto return_label3; - return_label3: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___Char___hash(val_t self) { - struct trace_t trace = {NULL, NULL, 49, LOCATE_hash___Char___hash}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = TAG_Int((unsigned char)UNTAG_Char( self)); - goto return_label4; - return_label4: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___Bool___hash(val_t self) { - struct trace_t trace = {NULL, NULL, 53, LOCATE_hash___Bool___hash}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - if (UNTAG_Bool( self)) { /*if*/ - variable0 = TAG_Int(1); - goto return_label5; - } else { /*if*/ - variable0 = TAG_Int(0); - goto return_label5; - } - return_label5: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___HashCollection___length(val_t self) { - struct trace_t trace = {NULL, NULL, 69, LOCATE_hash___HashCollection___length}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - tracehead = trace.prev; - return ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/; -} -val_t hash___HashCollection___first_item(val_t self) { - struct trace_t trace = {NULL, NULL, 71, LOCATE_hash___HashCollection___first_item}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - tracehead = trace.prev; - return ATTR_hash___HashCollection____first_item( self) /*HashCollection::_first_item*/; -} -val_t hash___HashCollection___index_at(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 80, LOCATE_hash___HashCollection___index_at}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable2 = ATTR_hash___HashCollection____array( self) /*HashCollection::_array*/; - variable1 = variable2; - variable2 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable0 /*k*/ == NIT_NULL /*null*/) || (( variable0 /*k*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable0 /*k*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable0 /*k*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable0 /*k*/,COLOR_kernel___Object_____eqeq))( variable0 /*k*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (!UNTAG_Bool(variable2)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashCollection___index_at, LOCATE_hash, 84); nit_exit(1);} - variable2 = ATTR_hash___HashCollection____last_accessed_key( self) /*HashCollection::_last_accessed_key*/; - variable2 = TAG_Bool(( variable0 /*k*/ == variable2) || (( variable0 /*k*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable0 /*k*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable0 /*k*/,variable2)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable0 /*k*/,COLOR_kernel___Object_____eqeq))( variable0 /*k*/, variable2) /*Object::==*/))))); - if (UNTAG_Bool(variable2)) { /*if*/ - variable2 = ATTR_hash___HashCollection____last_accessed_index( self) /*HashCollection::_last_accessed_index*/; - variable1 = variable2; - goto return_label6; - } - variable3 = ((hash___Object___hash_t)CALL( variable0 /*k*/,COLOR_hash___Object___hash))( variable0 /*k*/) /*Object::hash*/; - variable4 = ATTR_hash___HashCollection____capacity( self) /*HashCollection::_capacity*/; - variable3 = TAG_Int(UNTAG_Int(variable3)%UNTAG_Int(variable4)); - variable2 = variable3; - variable3 = TAG_Bool(UNTAG_Int( variable2 /*base*/)=UNTAG_Int(variable3)); - if (UNTAG_Bool(variable3)) { /*if*/ - variable3 = TAG_Int(UNTAG_Int( variable2 /*l*/)*UNTAG_Int( TAG_Int(2))); - ((hash___HashCollection___enlarge_t)CALL( self,COLOR_hash___HashCollection___enlarge))( self, variable3) /*HashCollection::enlarge*/; - } - tracehead = trace.prev; - return; -} -void hash___HashCollection___remove_index(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 132, LOCATE_hash___HashCollection___remove_index}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable1 = TAG_Bool(UNTAG_Int( variable0 /*i*/)>=UNTAG_Int( TAG_Int(0))); - variable2 = variable1; - if (UNTAG_Bool(variable2)) { /* and */ - variable2 = ATTR_hash___HashCollection____capacity( self) /*HashCollection::_capacity*/; - variable2 = TAG_Bool(UNTAG_Int( variable0 /*i*/)=UNTAG_Int( TAG_Int(0))); - if (!UNTAG_Bool(variable1)) break; /* while*/ - variable1 = ATTR_hash___HashCollection____array( self) /*HashCollection::_array*/; - UNBOX_NativeArray(variable1)[UNTAG_Int( variable0 /*i*/)]= NIT_NULL /*null*/; - variable0 = TAG_Int(UNTAG_Int(variable0)-UNTAG_Int( TAG_Int(1))) /*i*/; - continue_12: while(0); - } - break_12: while(0); - ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/ = TAG_Int(0); - ATTR_hash___HashCollection____first_item( self) /*HashCollection::_first_item*/ = NIT_NULL /*null*/; - ATTR_hash___HashCollection____last_item( self) /*HashCollection::_last_item*/ = NIT_NULL /*null*/; - ATTR_hash___HashCollection____last_accessed_key( self) /*HashCollection::_last_accessed_key*/ = NIT_NULL /*null*/; - tracehead = trace.prev; - return; -} -void hash___HashCollection___enlarge(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 185, LOCATE_hash___HashCollection___enlarge}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - val_t variable6; - val_t variable7; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable2 = ATTR_hash___HashCollection____capacity( self) /*HashCollection::_capacity*/; - variable1 = variable2; - variable2 = ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/; - variable2 = TAG_Int(UNTAG_Int(variable2)+UNTAG_Int( TAG_Int(1))); - variable2 = TAG_Bool(UNTAG_Int( variable0 /*cap*/)=UNTAG_Int( TAG_Int(0))); - if (!UNTAG_Bool(variable4)) break; /* while*/ - UNBOX_NativeArray( variable2 /*new_array*/)[UNTAG_Int( variable3 /*i*/)]= NIT_NULL /*null*/; - variable3 = TAG_Int(UNTAG_Int(variable3)-UNTAG_Int( TAG_Int(1))) /*i*/; - continue_14: while(0); - } - break_14: while(0); - variable4 = ATTR_hash___HashCollection____capacity( self) /*HashCollection::_capacity*/; - variable4 = TAG_Bool(UNTAG_Int(variable4)<=UNTAG_Int( variable1 /*old_cap*/)); - if (UNTAG_Bool(variable4)) { /*if*/ - goto return_label13; - } - variable5 = ATTR_hash___HashCollection____array( self) /*HashCollection::_array*/; - variable4 = variable5; - variable6 = ATTR_hash___HashCollection____first_item( self) /*HashCollection::_first_item*/; - variable5 = variable6; - while (true) { /*while*/ - variable6 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable5 /*node*/ == NIT_NULL /*null*/) || (( variable5 /*node*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable5 /*node*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable5 /*node*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable5 /*node*/,COLOR_kernel___Object_____eqeq))( variable5 /*node*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (!UNTAG_Bool(variable6)) break; /* while*/ - variable7 = ((hash___HashNode___key_t)CALL( variable5 /*node*/,COLOR_hash___HashNode___key))( variable5 /*node*/) /*HashNode::key*/; - variable7 = ((hash___HashCollection___index_at_t)CALL( self,COLOR_hash___HashCollection___index_at))( self, variable7) /*HashCollection::index_at*/; - variable6 = variable7; - variable7 = UNBOX_NativeArray( variable4 /*new_array*/)[UNTAG_Int( variable6 /*ind*/)]; - variable7 = TAG_Bool((variable7 == NIT_NULL /*null*/) || ((variable7 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable7,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable7, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable7,COLOR_kernel___Object_____eqeq))(variable7, NIT_NULL /*null*/) /*Object::==*/))))); - if (!UNTAG_Bool(variable7)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashCollection___enlarge, LOCATE_hash, 213); nit_exit(1);} - UNBOX_NativeArray( variable4 /*new_array*/)[UNTAG_Int( variable6 /*ind*/)]= variable5 /*node*/; - variable7 = ((hash___HashNode___next_item_t)CALL( variable5 /*node*/,COLOR_hash___HashNode___next_item))( variable5 /*node*/) /*HashNode::next_item*/; - variable5 = variable7 /*node=*/; - continue_15: while(0); - } - break_15: while(0); - ATTR_hash___HashCollection____last_accessed_key( self) /*HashCollection::_last_accessed_key*/ = NIT_NULL /*null*/; - return_label13: while(false); - tracehead = trace.prev; - return; -} -val_t hash___HashNode___key(val_t self) { - struct trace_t trace = {NULL, NULL, 222, LOCATE_hash___HashNode___key}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - fprintf(stderr, "Deferred method %s called"); - fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashCollection___enlarge, LOCATE_hash, 222); - nit_exit(1); - tracehead = trace.prev; - return NIT_NULL; -} -val_t hash___HashNode___next_item(val_t self) { - struct trace_t trace = {NULL, NULL, 224, LOCATE_hash___HashNode___next_item}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - tracehead = trace.prev; - return ATTR_hash___HashNode____next_item( self) /*HashNode::_next_item*/; -} -void hash___HashNode___next_item__eq(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 224, LOCATE_hash___HashNode___next_item__eq}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - ATTR_hash___HashNode____next_item( self) /*HashNode::_next_item*/ = param0; - tracehead = trace.prev; - return; -} -val_t hash___HashNode___prev_item(val_t self) { - struct trace_t trace = {NULL, NULL, 225, LOCATE_hash___HashNode___prev_item}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - tracehead = trace.prev; - return ATTR_hash___HashNode____prev_item( self) /*HashNode::_prev_item*/; -} -void hash___HashNode___prev_item__eq(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 225, LOCATE_hash___HashNode___prev_item__eq}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - ATTR_hash___HashNode____prev_item( self) /*HashNode::_prev_item*/ = param0; - tracehead = trace.prev; - return; -} -val_t hash___HashMap___iterator(val_t self) { - struct trace_t trace = {NULL, NULL, 232, LOCATE_hash___HashMap___iterator}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = NEW_hash___HashMapIterator___init( self); /*new HashMapIterator[K, V]*/ - goto return_label16; - return_label16: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___HashMap___first(val_t self) { - struct trace_t trace = {NULL, NULL, 234, LOCATE_hash___HashMap___first}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/; - variable0 = TAG_Bool(UNTAG_Int(variable0)>UNTAG_Int( TAG_Int(0))); - if (!UNTAG_Bool(variable0)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashMap___first, LOCATE_hash, 236); nit_exit(1);} - variable0 = ATTR_hash___HashCollection____first_item( self) /*HashCollection::_first_item*/; - variable0 = ((abstract_collection___Couple___second_t)CALL(variable0,COLOR_abstract_collection___Couple___second))(variable0) /*Couple::second*/; - goto return_label17; - return_label17: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___HashMap___is_empty(val_t self) { - struct trace_t trace = {NULL, NULL, 240, LOCATE_hash___HashMap___is_empty}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/; - variable0 = TAG_Bool((variable0)==( TAG_Int(0))); - goto return_label18; - return_label18: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___HashMap___count(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 242, LOCATE_hash___HashMap___count}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - val_t variable4; - val_t variable5; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable1 = TAG_Int(0); - variable2 = TAG_Int(0); - while (true) { /*while*/ - variable3 = ATTR_hash___HashCollection____capacity( self) /*HashCollection::_capacity*/; - variable3 = TAG_Bool(UNTAG_Int( variable2 /*i*/)vft[INIT_TABLE_POS_HashMap].i]) return; - ATTR_hash___HashCollection____capacity( self) /*HashCollection::_capacity*/ = TAG_Int(0); - ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/ = TAG_Int(0); - ((hash___HashCollection___enlarge_t)CALL( self,COLOR_hash___HashCollection___enlarge))( self, TAG_Int(0)) /*HashCollection::enlarge*/; - init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashMap].i] = 1; - tracehead = trace.prev; - return; -} -val_t hash___HashMapNode___key(val_t self) { - struct trace_t trace = {NULL, NULL, 319, LOCATE_hash___HashMapNode___key}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ((abstract_collection___Couple___first_t)CALL( self,COLOR_abstract_collection___Couple___first))( self) /*Couple::first*/; - goto return_label32; - return_label32: while(false); - tracehead = trace.prev; - return variable0; -} -void hash___HashMapNode___init(val_t self, val_t param0, val_t param1, int* init_table) { - struct trace_t trace = {NULL, NULL, 322, LOCATE_hash___HashMapNode___init}; - val_t variable0; - val_t variable1; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable1 = param1; - if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashMapNode].i]) return; - ((abstract_collection___Couple___first__eq_t)CALL( self,COLOR_abstract_collection___Couple___first__eq))( self, variable0 /*k*/) /*Couple::first=*/; - ((abstract_collection___Couple___second__eq_t)CALL( self,COLOR_abstract_collection___Couple___second__eq))( self, variable1 /*v*/) /*Couple::second=*/; - init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashMapNode].i] = 1; - tracehead = trace.prev; - return; -} -val_t hash___HashMapIterator___is_ok(val_t self) { - struct trace_t trace = {NULL, NULL, 331, LOCATE_hash___HashMapIterator___is_ok}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ATTR_hash___HashMapIterator____node( self) /*HashMapIterator::_node*/; - variable0 = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable0 == NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable0, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0, NIT_NULL /*null*/) /*Object::==*/))))))); - goto return_label34; - return_label34: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___HashMapIterator___item(val_t self) { - struct trace_t trace = {NULL, NULL, 333, LOCATE_hash___HashMapIterator___item}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ((hash___HashMapIterator___is_ok_t)CALL( self,COLOR_abstract_collection___Iterator___is_ok))( self) /*HashMapIterator::is_ok*/; - if (!UNTAG_Bool(variable0)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashMapIterator___item, LOCATE_hash, 335); nit_exit(1);} - variable0 = ATTR_hash___HashMapIterator____node( self) /*HashMapIterator::_node*/; - variable0 = ((abstract_collection___Couple___second_t)CALL(variable0,COLOR_abstract_collection___Couple___second))(variable0) /*Couple::second*/; - goto return_label35; - return_label35: while(false); - tracehead = trace.prev; - return variable0; -} -void hash___HashMapIterator___item__eq(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 339, LOCATE_hash___HashMapIterator___item__eq}; - val_t variable0; - val_t variable1; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable1 = ((hash___HashMapIterator___is_ok_t)CALL( self,COLOR_abstract_collection___Iterator___is_ok))( self) /*HashMapIterator::is_ok*/; - if (!UNTAG_Bool(variable1)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashMapIterator___item__eq, LOCATE_hash, 341); nit_exit(1);} - variable1 = ATTR_hash___HashMapIterator____node( self) /*HashMapIterator::_node*/; - ((abstract_collection___Couple___second__eq_t)CALL(variable1,COLOR_abstract_collection___Couple___second__eq))(variable1, variable0 /*value*/) /*Couple::second=*/; - tracehead = trace.prev; - return; -} -val_t hash___HashMapIterator___key(val_t self) { - struct trace_t trace = {NULL, NULL, 345, LOCATE_hash___HashMapIterator___key}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ((hash___HashMapIterator___is_ok_t)CALL( self,COLOR_abstract_collection___Iterator___is_ok))( self) /*HashMapIterator::is_ok*/; - if (!UNTAG_Bool(variable0)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashMapIterator___key, LOCATE_hash, 347); nit_exit(1);} - variable0 = ATTR_hash___HashMapIterator____node( self) /*HashMapIterator::_node*/; - variable0 = ((abstract_collection___Couple___first_t)CALL(variable0,COLOR_abstract_collection___Couple___first))(variable0) /*Couple::first*/; - goto return_label37; - return_label37: while(false); - tracehead = trace.prev; - return variable0; -} -void hash___HashMapIterator___next(val_t self) { - struct trace_t trace = {NULL, NULL, 351, LOCATE_hash___HashMapIterator___next}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ((hash___HashMapIterator___is_ok_t)CALL( self,COLOR_abstract_collection___Iterator___is_ok))( self) /*HashMapIterator::is_ok*/; - if (!UNTAG_Bool(variable0)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashMapIterator___next, LOCATE_hash, 353); nit_exit(1);} - variable0 = ATTR_hash___HashMapIterator____node( self) /*HashMapIterator::_node*/; - variable0 = ((hash___HashNode___next_item_t)CALL(variable0,COLOR_hash___HashNode___next_item))(variable0) /*HashNode::next_item*/; - ATTR_hash___HashMapIterator____node( self) /*HashMapIterator::_node*/ = variable0; - tracehead = trace.prev; - return; -} -void hash___HashMapIterator___init(val_t self, val_t param0, int* init_table) { - struct trace_t trace = {NULL, NULL, 363, LOCATE_hash___HashMapIterator___init}; - val_t variable0; - val_t variable1; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashMapIterator].i]) return; - ATTR_hash___HashMapIterator____map( self) /*HashMapIterator::_map*/ = variable0 /*map*/; - variable1 = ((hash___HashCollection___first_item_t)CALL( variable0 /*map*/,COLOR_hash___HashCollection___first_item))( variable0 /*map*/) /*HashCollection::first_item*/; - ATTR_hash___HashMapIterator____node( self) /*HashMapIterator::_node*/ = variable1; - init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashMapIterator].i] = 1; - tracehead = trace.prev; - return; -} -val_t hash___HashSet___is_empty(val_t self) { - struct trace_t trace = {NULL, NULL, 374, LOCATE_hash___HashSet___is_empty}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/; - variable0 = TAG_Bool((variable0)==( TAG_Int(0))); - goto return_label40; - return_label40: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___HashSet___first(val_t self) { - struct trace_t trace = {NULL, NULL, 376, LOCATE_hash___HashSet___first}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/; - variable0 = TAG_Bool(UNTAG_Int(variable0)>UNTAG_Int( TAG_Int(0))); - if (!UNTAG_Bool(variable0)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashSet___first, LOCATE_hash, 378); nit_exit(1);} - variable0 = ATTR_hash___HashCollection____first_item( self) /*HashCollection::_first_item*/; - variable0 = ((hash___HashSetNode___key_t)CALL(variable0,COLOR_hash___HashNode___key))(variable0) /*HashSetNode::key*/; - goto return_label41; - return_label41: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___HashSet___has(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 382, LOCATE_hash___HashSet___has}; - val_t variable0; - val_t variable1; - val_t variable2; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable1 = ATTR_hash___HashCollection____array( self) /*HashCollection::_array*/; - variable2 = ((hash___HashCollection___index_at_t)CALL( self,COLOR_hash___HashCollection___index_at))( self, variable0 /*item*/) /*HashCollection::index_at*/; - variable1 = UNBOX_NativeArray(variable1)[UNTAG_Int(variable2)]; - variable1 = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable1 == NIT_NULL /*null*/) || ((variable1 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable1, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable1,COLOR_kernel___Object_____eqeq))(variable1, NIT_NULL /*null*/) /*Object::==*/))))))); - goto return_label42; - return_label42: while(false); - tracehead = trace.prev; - return variable1; -} -void hash___HashSet___add(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 387, LOCATE_hash___HashSet___add}; - val_t variable0; - val_t variable1; - val_t variable2; - val_t variable3; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable2 = ((hash___HashCollection___index_at_t)CALL( self,COLOR_hash___HashCollection___index_at))( self, variable0 /*item*/) /*HashCollection::index_at*/; - variable1 = variable2; - variable3 = ATTR_hash___HashCollection____array( self) /*HashCollection::_array*/; - variable3 = UNBOX_NativeArray(variable3)[UNTAG_Int( variable1 /*i*/)]; - variable2 = variable3; - variable3 = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable2 /*c*/ == NIT_NULL /*null*/) || (( variable2 /*c*/ != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL( variable2 /*c*/,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable2 /*c*/, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL( variable2 /*c*/,COLOR_kernel___Object_____eqeq))( variable2 /*c*/, NIT_NULL /*null*/) /*Object::==*/))))))); - if (UNTAG_Bool(variable3)) { /*if*/ - ((hash___HashSetNode___key__eq_t)CALL( variable2 /*c*/,COLOR_hash___HashSetNode___key__eq))( variable2 /*c*/, variable0 /*item*/) /*HashSetNode::key=*/; - } else { /*if*/ - variable3 = NEW_hash___HashSetNode___init( variable0 /*item*/); /*new HashSetNode[E]*/ - ((hash___HashCollection___store_t)CALL( self,COLOR_hash___HashCollection___store))( self, variable1 /*i*/, variable3) /*HashCollection::store*/; - } - tracehead = trace.prev; - return; -} -void hash___HashSet___remove(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 398, LOCATE_hash___HashSet___remove}; - val_t variable0; - val_t variable1; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - variable1 = ((hash___HashCollection___index_at_t)CALL( self,COLOR_hash___HashCollection___index_at))( self, variable0 /*item*/) /*HashCollection::index_at*/; - ((hash___HashCollection___remove_index_t)CALL( self,COLOR_hash___HashCollection___remove_index))( self, variable1) /*HashCollection::remove_index*/; - tracehead = trace.prev; - return; -} -void hash___HashSet___clear(val_t self) { - struct trace_t trace = {NULL, NULL, 400, LOCATE_hash___HashSet___clear}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - ((hash___HashCollection___raz_t)CALL( self,COLOR_hash___HashCollection___raz))( self) /*HashCollection::raz*/; - tracehead = trace.prev; - return; -} -val_t hash___HashSet___iterator(val_t self) { - struct trace_t trace = {NULL, NULL, 402, LOCATE_hash___HashSet___iterator}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = NEW_hash___HashSetIterator___init( self); /*new HashSetIterator[E]*/ - goto return_label46; - return_label46: while(false); - tracehead = trace.prev; - return variable0; -} -void hash___HashSet___init(val_t self, int* init_table) { - struct trace_t trace = {NULL, NULL, 404, LOCATE_hash___HashSet___init}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashSet].i]) return; - ATTR_hash___HashCollection____capacity( self) /*HashCollection::_capacity*/ = TAG_Int(0); - ATTR_hash___HashCollection____length( self) /*HashCollection::_length*/ = TAG_Int(0); - ((hash___HashCollection___enlarge_t)CALL( self,COLOR_hash___HashCollection___enlarge))( self, TAG_Int(0)) /*HashCollection::enlarge*/; - init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashSet].i] = 1; - tracehead = trace.prev; - return; -} -val_t hash___HashSetNode___key(val_t self) { - struct trace_t trace = {NULL, NULL, 416, LOCATE_hash___HashSetNode___key}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - tracehead = trace.prev; - return ATTR_hash___HashSetNode____key( self) /*HashSetNode::_key*/; -} -void hash___HashSetNode___key__eq(val_t self, val_t param0) { - struct trace_t trace = {NULL, NULL, 416, LOCATE_hash___HashSetNode___key__eq}; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - ATTR_hash___HashSetNode____key( self) /*HashSetNode::_key*/ = param0; - tracehead = trace.prev; - return; -} -void hash___HashSetNode___init(val_t self, val_t param0, int* init_table) { - struct trace_t trace = {NULL, NULL, 418, LOCATE_hash___HashSetNode___init}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashSetNode].i]) return; - ATTR_hash___HashSetNode____key( self) /*HashSetNode::_key*/ = variable0 /*e*/; - init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashSetNode].i] = 1; - tracehead = trace.prev; - return; -} -val_t hash___HashSetIterator___is_ok(val_t self) { - struct trace_t trace = {NULL, NULL, 426, LOCATE_hash___HashSetIterator___is_ok}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ATTR_hash___HashSetIterator____node( self) /*HashSetIterator::_node*/; - variable0 = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable0 == NIT_NULL /*null*/) || ((variable0 != NIT_NULL) && ((((kernel___Object_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable0, NIT_NULL /*null*/)):(UNTAG_Bool(((kernel___Object_____eqeq_t)CALL(variable0,COLOR_kernel___Object_____eqeq))(variable0, NIT_NULL /*null*/) /*Object::==*/))))))); - goto return_label49; - return_label49: while(false); - tracehead = trace.prev; - return variable0; -} -val_t hash___HashSetIterator___item(val_t self) { - struct trace_t trace = {NULL, NULL, 428, LOCATE_hash___HashSetIterator___item}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ((hash___HashSetIterator___is_ok_t)CALL( self,COLOR_abstract_collection___Iterator___is_ok))( self) /*HashSetIterator::is_ok*/; - if (!UNTAG_Bool(variable0)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashSetIterator___item, LOCATE_hash, 430); nit_exit(1);} - variable0 = ATTR_hash___HashSetIterator____node( self) /*HashSetIterator::_node*/; - variable0 = ((hash___HashSetNode___key_t)CALL(variable0,COLOR_hash___HashNode___key))(variable0) /*HashSetNode::key*/; - goto return_label50; - return_label50: while(false); - tracehead = trace.prev; - return variable0; -} -void hash___HashSetIterator___next(val_t self) { - struct trace_t trace = {NULL, NULL, 434, LOCATE_hash___HashSetIterator___next}; - val_t variable0; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = ((hash___HashSetIterator___is_ok_t)CALL( self,COLOR_abstract_collection___Iterator___is_ok))( self) /*HashSetIterator::is_ok*/; - if (!UNTAG_Bool(variable0)) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_hash___HashSetIterator___next, LOCATE_hash, 436); nit_exit(1);} - variable0 = ATTR_hash___HashSetIterator____node( self) /*HashSetIterator::_node*/; - variable0 = ((hash___HashNode___next_item_t)CALL(variable0,COLOR_hash___HashNode___next_item))(variable0) /*HashNode::next_item*/; - ATTR_hash___HashSetIterator____node( self) /*HashSetIterator::_node*/ = variable0; - tracehead = trace.prev; - return; -} -void hash___HashSetIterator___init(val_t self, val_t param0, int* init_table) { - struct trace_t trace = {NULL, NULL, 446, LOCATE_hash___HashSetIterator___init}; - val_t variable0; - val_t variable1; - trace.prev = tracehead; tracehead = &trace; - trace.file = LOCATE_hash; - variable0 = param0; - if (init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashSetIterator].i]) return; - ATTR_hash___HashSetIterator____set( self) /*HashSetIterator::_set*/ = variable0 /*set*/; - variable1 = ((hash___HashCollection___first_item_t)CALL( variable0 /*set*/,COLOR_hash___HashCollection___first_item))( variable0 /*set*/) /*HashCollection::first_item*/; - ATTR_hash___HashSetIterator____node( self) /*HashSetIterator::_node*/ = variable1; - init_table[VAL2OBJ( self)->vft[INIT_TABLE_POS_HashSetIterator].i] = 1; - tracehead = trace.prev; - return; +val_t hash___Object___hash(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t REGB0; + val_t REGB1; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_hash; + fra.me.line = 20; + fra.me.meth = LOCATE_hash___Object___hash; + fra.me.has_broke = 0; + fra.me.REG_size = 1; + fra.me.REG[0] = NIT_NULL; + fra.me.REG[0] = p0; + /* ./../lib/standard//hash.nit:24 */ + REGB0 = CALL_kernel___Object___object_id(fra.me.REG[0])(fra.me.REG[0]); + REGB1 = TAG_Int(8); + /* ./../lib/standard//kernel.nit:219 */ + REGB1 = TAG_Int(UNTAG_Int(REGB0)/UNTAG_Int(REGB1)); + /* ./../lib/standard//hash.nit:24 */ + goto label1; + label1: while(0); + stack_frame_head = fra.me.prev; + return REGB1; +} +val_t hash___Int___hash(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_hash; + fra.me.line = 28; + fra.me.meth = LOCATE_hash___Int___hash; + fra.me.has_broke = 0; + fra.me.REG_size = 0; + REGB0 = p0; + /* ./../lib/standard//hash.nit:28 */ + goto label1; + label1: while(0); + stack_frame_head = fra.me.prev; + return REGB0; +} +val_t hash___Char___hash(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t REGB0; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_hash; + fra.me.line = 32; + fra.me.meth = LOCATE_hash___Char___hash; + fra.me.has_broke = 0; + fra.me.REG_size = 0; + REGB0 = p0; + /* ./../lib/standard//kernel.nit:382 */ + REGB0 = TAG_Int((unsigned char)UNTAG_Char(REGB0)); + /* ./../lib/standard//hash.nit:32 */ + goto label1; + label1: while(0); + stack_frame_head = fra.me.prev; + return REGB0; +} +val_t hash___Bool___hash(val_t p0){ + struct {struct stack_frame_t me;} fra; + val_t REGB0; + val_t REGB1; + val_t tmp; + fra.me.prev = stack_frame_head; stack_frame_head = &fra.me; + fra.me.file = LOCATE_hash; + fra.me.line = 36; + fra.me.meth = LOCATE_hash___Bool___hash; + fra.me.has_broke = 0; + fra.me.REG_size = 0; + REGB0 = p0; + /* ./../lib/standard//hash.nit:38 */ + if (UNTAG_Bool(REGB0)) { + /* ./../lib/standard//hash.nit:39 */ + REGB0 = TAG_Int(1); + goto label1; + } else { + /* ./../lib/standard//hash.nit:41 */ + REGB1 = TAG_Int(0); + REGB0 = REGB1; + goto label1; + } + label1: while(0); + stack_frame_head = fra.me.prev; + return REGB0; }