new c_src
[nit.git] / c_src / genericity._sep.c
1 /* This C file is generated by NIT to compile module genericity. */
2 #include "genericity._sep.h"
3 val_t genericity___MMLocalClass___get_type(val_t self) {
4 struct trace_t trace = {NULL, NULL, 80, LOCATE_genericity___MMLocalClass___get_type};
5 val_t variable[5];
6 void **closurevariable = NULL;
7 trace.prev = tracehead; tracehead = &trace;
8 trace.file = LOCATE_genericity;
9 variable[0] = self;
10 variable[2] = variable[0];
11 variable[2] = ATTR_static_type___MMLocalClass____base_type_cache(variable[2]) /*MMLocalClass::_base_type_cache*/;
12 variable[2] = TAG_Bool((variable[2] == NIT_NULL /*null*/) || ((variable[2] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[2])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[2], NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[2])(variable[2], NIT_NULL /*null*/) /*Object::==*/)))));
13 variable[3] = variable[2];
14 if (UNTAG_Bool(variable[3])) { /* and */
15 variable[3] = variable[0];
16 variable[3] = CALL_genericity___MMLocalClass___is_generic(variable[3])(variable[3]) /*MMLocalClass::is_generic*/;
17 }
18 variable[2] = variable[3];
19 if (UNTAG_Bool(variable[2])) { /*if*/
20 variable[2] = variable[0];
21 variable[3] = variable[0];
22 variable[4] = variable[0];
23 variable[4] = CALL_genericity___MMLocalClass___formals_types(variable[4])(variable[4]) /*MMLocalClass::formals_types*/;
24 variable[3] = CALL_genericity___MMLocalClass___get_instantiate_type(variable[3])(variable[3], variable[4]) /*MMLocalClass::get_instantiate_type*/;
25 ATTR_static_type___MMLocalClass____base_type_cache(variable[2]) /*MMLocalClass::_base_type_cache*/ = variable[3];
26 variable[2] = variable[0];
27 variable[2] = ATTR_static_type___MMLocalClass____base_type_cache(variable[2]) /*MMLocalClass::_base_type_cache*/;
28 variable[1] = variable[2];
29 goto return_label0;
30 } else { /*if*/
31 variable[2] = CALL_SUPER_genericity___MMLocalClass___get_type(variable[0])(variable[0]) /*super MMLocalClass::get_type*/;
32 variable[1] = variable[2];
33 goto return_label0;
34 }
35 return_label0: while(false);
36 tracehead = trace.prev;
37 return variable[1];
38 }
39 val_t genericity___MMLocalClass___get_formal(val_t self, val_t param0) {
40 struct trace_t trace = {NULL, NULL, 25, LOCATE_genericity___MMLocalClass___get_formal};
41 val_t variable[9];
42 void **closurevariable = NULL;
43 trace.prev = tracehead; tracehead = &trace;
44 trace.file = LOCATE_genericity;
45 variable[0] = self;
46 variable[1] = param0;
47 variable[3] = variable[0];
48 variable[3] = CALL_genericity___MMLocalClass___formals_types(variable[3])(variable[3]) /*MMLocalClass::formals_types*/;
49 variable[4] = variable[3];
50 variable[5] = variable[1] /*pos*/;
51 variable[7] = TAG_Bool(UNTAG_Int( variable[5] /*index*/)>=UNTAG_Int( TAG_Int(0)));
52 variable[8] = variable[7];
53 if (UNTAG_Bool(variable[8])) { /* and */
54 variable[8] = variable[4];
55 variable[8] = ATTR_array___AbstractArray____length(variable[8]) /*AbstractArray::_length*/;
56 variable[8] = TAG_Bool(UNTAG_Int( variable[5] /*index*/)<UNTAG_Int(variable[8]));
57 }
58 variable[7] = variable[8];
59 if (!UNTAG_Bool(variable[7])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
60 variable[7] = variable[4];
61 variable[7] = ATTR_array___Array____items(variable[7]) /*Array::_items*/;
62 variable[7] = UNBOX_NativeArray(variable[7])[UNTAG_Int( variable[5] /*index*/)];
63 variable[6] = variable[7];
64 goto return_label2;
65 return_label2: while(false);
66 variable[3] = variable[6];
67 variable[2] = variable[3];
68 goto return_label1;
69 return_label1: while(false);
70 tracehead = trace.prev;
71 return variable[2];
72 }
73 void genericity___MMLocalClass___register_formal(val_t self, val_t param0) {
74 struct trace_t trace = {NULL, NULL, 31, LOCATE_genericity___MMLocalClass___register_formal};
75 val_t variable[5];
76 void **closurevariable = NULL;
77 trace.prev = tracehead; tracehead = &trace;
78 trace.file = LOCATE_genericity;
79 variable[0] = self;
80 variable[1] = param0;
81 variable[3] = CALL_genericity___MMTypeFormalParameter___def_class( variable[1] /*f*/)( variable[1] /*f*/) /*MMTypeFormalParameter::def_class*/;
82 variable[4] = variable[0];
83 variable[3] = TAG_Bool((variable[3] == variable[4]) || ((variable[3] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[3])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[3],variable[4])):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[3])(variable[3], variable[4]) /*Object::==*/)))));
84 if (!UNTAG_Bool(variable[3])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMLocalClass___register_formal, LOCATE_genericity, 35); nit_exit(1);}
85 variable[3] = CALL_genericity___MMTypeFormalParameter___position( variable[1] /*f*/)( variable[1] /*f*/) /*MMTypeFormalParameter::position*/;
86 variable[4] = variable[0];
87 variable[4] = ATTR_genericity___MMLocalClass____formals_types(variable[4]) /*MMLocalClass::_formals_types*/;
88 variable[4] = CALL_abstract_collection___Collection___length(variable[4])(variable[4]) /*AbstractArray::length*/;
89 variable[3] = TAG_Bool((variable[3])==(variable[4]));
90 if (!UNTAG_Bool(variable[3])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMLocalClass___register_formal, LOCATE_genericity, 36); nit_exit(1);}
91 variable[3] = variable[0];
92 variable[3] = ATTR_genericity___MMLocalClass____formals_types(variable[3]) /*MMLocalClass::_formals_types*/;
93 CALL_abstract_collection___SimpleCollection___add(variable[3])(variable[3], variable[1] /*f*/) /*AbstractArray::add*/;
94 return_label3: while(false);
95 tracehead = trace.prev;
96 return;
97 }
98 val_t genericity___MMLocalClass___get_instantiate_type(val_t self, val_t param0) {
99 struct trace_t trace = {NULL, NULL, 43, LOCATE_genericity___MMLocalClass___get_instantiate_type};
100 val_t variable[7];
101 void **closurevariable = NULL;
102 trace.prev = tracehead; tracehead = &trace;
103 trace.file = LOCATE_genericity;
104 variable[0] = self;
105 variable[1] = param0;
106 variable[3] = variable[0];
107 variable[3] = ATTR_genericity___MMLocalClass____types(variable[3]) /*MMLocalClass::_types*/;
108 variable[3] = CALL_abstract_collection___Collection___iterator(variable[3])(variable[3]) /*AbstractArray::iterator*/;
109 while (true) { /*for*/
110 variable[4] = CALL_abstract_collection___Iterator___is_ok(variable[3])(variable[3]) /*ArrayIterator::is_ok*/;
111 if (!UNTAG_Bool(variable[4])) break; /*for*/
112 variable[4] = CALL_abstract_collection___Iterator___item(variable[3])(variable[3]) /*ArrayIterator::item*/;
113 variable[5] = variable[4];
114 variable[6] = CALL_genericity___MMTypeGeneric___params_equals( variable[5] /*g*/)( variable[5] /*g*/, variable[1] /*t*/) /*MMTypeGeneric::params_equals*/;
115 if (UNTAG_Bool(variable[6])) { /*if*/
116 variable[2] = variable[5] /*g*/;
117 goto return_label4;
118 }
119 continue_5: while(0);
120 CALL_abstract_collection___Iterator___next(variable[3])(variable[3]) /*ArrayIterator::next*/;
121 }
122 break_5: while(0);
123 variable[4] = variable[0];
124 variable[5] = NEW_MMTypeGeneric_genericity___MMTypeGeneric___init(variable[4], variable[1] /*t*/); /*new MMTypeGeneric*/
125 variable[4] = variable[5];
126 variable[3] = variable[4];
127 variable[4] = variable[0];
128 variable[4] = ATTR_genericity___MMLocalClass____types(variable[4]) /*MMLocalClass::_types*/;
129 CALL_abstract_collection___SimpleCollection___add(variable[4])(variable[4], variable[3] /*g*/) /*AbstractArray::add*/;
130 variable[2] = variable[3] /*g*/;
131 goto return_label4;
132 return_label4: while(false);
133 tracehead = trace.prev;
134 return variable[2];
135 }
136 val_t genericity___MMLocalClass___formals_types(val_t self) {
137 struct trace_t trace = {NULL, NULL, 57, LOCATE_genericity___MMLocalClass___formals_types};
138 val_t variable[13];
139 void **closurevariable = NULL;
140 trace.prev = tracehead; tracehead = &trace;
141 trace.file = LOCATE_genericity;
142 variable[0] = self;
143 variable[2] = variable[0];
144 variable[2] = ATTR_genericity___MMLocalClass____formals_types(variable[2]) /*MMLocalClass::_formals_types*/;
145 variable[2] = CALL_abstract_collection___Collection___is_empty(variable[2])(variable[2]) /*AbstractArray::is_empty*/;
146 if (UNTAG_Bool(variable[2])) { /*if*/
147 variable[2] = variable[0];
148 variable[2] = TAG_Bool((variable[2]==NIT_NULL) || VAL_ISA(variable[2], COLOR_MMConcreteClass, ID_MMConcreteClass)) /*cast MMConcreteClass*/;
149 if (!UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[2])))) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMLocalClass___formals_types, LOCATE_genericity, 62); nit_exit(1);}
150 variable[2] = variable[0];
151 variable[2] = CALL_abstractmetamodel___MMLocalClass___arity(variable[2])(variable[2]) /*MMLocalClass::arity*/;
152 variable[3] = NEW_Range_range___Range___without_last( TAG_Int(0), variable[2]); /*new Range[Int]*/
153 variable[2] = variable[3];
154 variable[2] = CALL_abstract_collection___Collection___iterator(variable[2])(variable[2]) /*Range::iterator*/;
155 while (true) { /*for*/
156 variable[3] = CALL_abstract_collection___Iterator___is_ok(variable[2])(variable[2]) /*Iterator::is_ok*/;
157 if (!UNTAG_Bool(variable[3])) break; /*for*/
158 variable[3] = CALL_abstract_collection___Iterator___item(variable[2])(variable[2]) /*Iterator::item*/;
159 variable[4] = variable[3];
160 variable[6] = variable[0];
161 variable[6] = CALL_abstractmetamodel___MMLocalClass___global(variable[6])(variable[6]) /*MMLocalClass::global*/;
162 variable[6] = CALL_abstractmetamodel___MMGlobalClass___intro(variable[6])(variable[6]) /*MMGlobalClass::intro*/;
163 variable[6] = CALL_genericity___MMLocalClass___get_formal(variable[6])(variable[6], variable[4] /*i*/) /*MMLocalClass::get_formal*/;
164 variable[5] = variable[6];
165 variable[7] = CALL_type_formal___MMTypeFormal___name( variable[5] /*oft*/)( variable[5] /*oft*/) /*MMTypeFormal::name*/;
166 variable[8] = variable[0];
167 variable[9] = NEW_MMTypeFormalParameter_genericity___MMTypeFormalParameter___init(variable[7], variable[4] /*i*/, variable[8]); /*new MMTypeFormalParameter*/
168 variable[7] = variable[9];
169 variable[6] = variable[7];
170 variable[7] = variable[0];
171 CALL_genericity___MMLocalClass___register_formal(variable[7])(variable[7], variable[6] /*ft*/) /*MMLocalClass::register_formal*/;
172 continue_7: while(0);
173 CALL_abstract_collection___Iterator___next(variable[2])(variable[2]) /*Iterator::next*/;
174 }
175 break_7: while(0);
176 variable[2] = variable[0];
177 variable[2] = CALL_abstractmetamodel___MMLocalClass___arity(variable[2])(variable[2]) /*MMLocalClass::arity*/;
178 variable[3] = NEW_Range_range___Range___without_last( TAG_Int(0), variable[2]); /*new Range[Int]*/
179 variable[2] = variable[3];
180 variable[2] = CALL_abstract_collection___Collection___iterator(variable[2])(variable[2]) /*Range::iterator*/;
181 while (true) { /*for*/
182 variable[3] = CALL_abstract_collection___Iterator___is_ok(variable[2])(variable[2]) /*Iterator::is_ok*/;
183 if (!UNTAG_Bool(variable[3])) break; /*for*/
184 variable[3] = CALL_abstract_collection___Iterator___item(variable[2])(variable[2]) /*Iterator::item*/;
185 variable[4] = variable[3];
186 variable[6] = variable[0];
187 variable[6] = CALL_abstractmetamodel___MMLocalClass___global(variable[6])(variable[6]) /*MMLocalClass::global*/;
188 variable[6] = CALL_abstractmetamodel___MMGlobalClass___intro(variable[6])(variable[6]) /*MMGlobalClass::intro*/;
189 variable[6] = CALL_genericity___MMLocalClass___get_formal(variable[6])(variable[6], variable[4] /*i*/) /*MMLocalClass::get_formal*/;
190 variable[5] = variable[6];
191 variable[7] = variable[0];
192 variable[7] = ATTR_genericity___MMLocalClass____formals_types(variable[7]) /*MMLocalClass::_formals_types*/;
193 variable[8] = variable[7];
194 variable[9] = variable[4] /*i*/;
195 variable[11] = TAG_Bool(UNTAG_Int( variable[9] /*index*/)>=UNTAG_Int( TAG_Int(0)));
196 variable[12] = variable[11];
197 if (UNTAG_Bool(variable[12])) { /* and */
198 variable[12] = variable[8];
199 variable[12] = ATTR_array___AbstractArray____length(variable[12]) /*AbstractArray::_length*/;
200 variable[12] = TAG_Bool(UNTAG_Int( variable[9] /*index*/)<UNTAG_Int(variable[12]));
201 }
202 variable[11] = variable[12];
203 if (!UNTAG_Bool(variable[11])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
204 variable[11] = variable[8];
205 variable[11] = ATTR_array___Array____items(variable[11]) /*Array::_items*/;
206 variable[11] = UNBOX_NativeArray(variable[11])[UNTAG_Int( variable[9] /*index*/)];
207 variable[10] = variable[11];
208 goto return_label9;
209 return_label9: while(false);
210 variable[7] = variable[10];
211 variable[6] = variable[7];
212 variable[7] = CALL_type_formal___MMTypeFormal___bound( variable[5] /*oft*/)( variable[5] /*oft*/) /*MMTypeFormal::bound*/;
213 variable[8] = variable[0];
214 variable[8] = CALL_abstractmetamodel___MMLocalClass___module(variable[8])(variable[8]) /*MMLocalClass::module*/;
215 variable[7] = CALL_static_type___MMType___for_module(variable[7])(variable[7], variable[8]) /*MMType::for_module*/;
216 CALL_genericity___MMTypeFormalParameter___bound__eq( variable[6] /*ft*/)( variable[6] /*ft*/, variable[7]) /*MMTypeFormalParameter::bound=*/;
217 continue_8: while(0);
218 CALL_abstract_collection___Iterator___next(variable[2])(variable[2]) /*Iterator::next*/;
219 }
220 break_8: while(0);
221 }
222 variable[2] = variable[0];
223 variable[2] = ATTR_genericity___MMLocalClass____formals_types(variable[2]) /*MMLocalClass::_formals_types*/;
224 variable[1] = variable[2];
225 goto return_label6;
226 return_label6: while(false);
227 tracehead = trace.prev;
228 return variable[1];
229 }
230 val_t genericity___MMLocalClass___is_generic(val_t self) {
231 struct trace_t trace = {NULL, NULL, 90, LOCATE_genericity___MMLocalClass___is_generic};
232 val_t variable[3];
233 void **closurevariable = NULL;
234 trace.prev = tracehead; tracehead = &trace;
235 trace.file = LOCATE_genericity;
236 variable[0] = self;
237 variable[2] = variable[0];
238 variable[2] = CALL_abstractmetamodel___MMLocalClass___arity(variable[2])(variable[2]) /*MMLocalClass::arity*/;
239 variable[2] = TAG_Bool(UNTAG_Int(variable[2])>UNTAG_Int( TAG_Int(0)));
240 variable[1] = variable[2];
241 goto return_label10;
242 return_label10: while(false);
243 tracehead = trace.prev;
244 return variable[1];
245 }
246 val_t genericity___MMType___is_generic(val_t self) {
247 struct trace_t trace = {NULL, NULL, 95, LOCATE_genericity___MMType___is_generic};
248 val_t *variable = NULL;
249 void **closurevariable = NULL;
250 trace.prev = tracehead; tracehead = &trace;
251 trace.file = LOCATE_genericity;
252 fprintf(stderr, "Deferred method called");
253 fprintf(stderr, " (%s:%d)\n", LOCATE_genericity, 95);
254 nit_exit(1);
255 tracehead = trace.prev;
256 return NIT_NULL;
257 }
258 val_t genericity___MMTypeFormal___is_generic(val_t self) {
259 struct trace_t trace = {NULL, NULL, 100, LOCATE_genericity___MMTypeFormal___is_generic};
260 val_t variable[3];
261 void **closurevariable = NULL;
262 trace.prev = tracehead; tracehead = &trace;
263 trace.file = LOCATE_genericity;
264 variable[0] = self;
265 variable[2] = variable[0];
266 variable[2] = ATTR_type_formal___MMTypeFormal____bound(variable[2]) /*MMTypeFormal::_bound*/;
267 variable[2] = CALL_genericity___MMType___is_generic(variable[2])(variable[2]) /*MMType::is_generic*/;
268 variable[1] = variable[2];
269 goto return_label11;
270 return_label11: while(false);
271 tracehead = trace.prev;
272 return variable[1];
273 }
274 val_t genericity___MMTypeSimpleClass___is_generic(val_t self) {
275 struct trace_t trace = {NULL, NULL, 104, LOCATE_genericity___MMTypeSimpleClass___is_generic};
276 val_t variable[2];
277 void **closurevariable = NULL;
278 trace.prev = tracehead; tracehead = &trace;
279 trace.file = LOCATE_genericity;
280 variable[0] = self;
281 variable[1] = TAG_Bool(false);
282 goto return_label12;
283 return_label12: while(false);
284 tracehead = trace.prev;
285 return variable[1];
286 }
287 val_t genericity___MMTypeGeneric___to_s(val_t self) {
288 struct trace_t trace = {NULL, NULL, 174, LOCATE_genericity___MMTypeGeneric___to_s};
289 val_t variable[13];
290 void **closurevariable = NULL;
291 trace.prev = tracehead; tracehead = &trace;
292 trace.file = LOCATE_genericity;
293 variable[0] = self;
294 variable[2] = NEW_Array_array___Array___with_capacity(TAG_Int(5)); /*new Array[String]*/
295 variable[3] = NEW_String_string___String___with_native(BOX_NativeString(""), TAG_Int(0)); /*new String*/
296 variable[4] = variable[3];
297 CALL_abstract_collection___SimpleCollection___add(variable[2])(variable[2], variable[4]) /*AbstractArray::add*/;
298 variable[5] = CALL_SUPER_genericity___MMTypeGeneric___to_s(variable[0])(variable[0]) /*super MMTypeGeneric::to_s*/;
299 variable[6] = variable[5];
300 CALL_abstract_collection___SimpleCollection___add(variable[2])(variable[2], variable[6]) /*AbstractArray::add*/;
301 variable[7] = NEW_String_string___String___with_native(BOX_NativeString("["), TAG_Int(1)); /*new String*/
302 variable[8] = variable[7];
303 CALL_abstract_collection___SimpleCollection___add(variable[2])(variable[2], variable[8]) /*AbstractArray::add*/;
304 variable[9] = variable[0];
305 variable[9] = ATTR_genericity___MMTypeGeneric____params(variable[9]) /*MMTypeGeneric::_params*/;
306 variable[10] = NEW_String_string___String___with_native(BOX_NativeString(", "), TAG_Int(2)); /*new String*/
307 variable[9] = CALL_string___Collection___join(variable[9])(variable[9], variable[10]) /*Collection::join*/;
308 variable[10] = variable[9];
309 CALL_abstract_collection___SimpleCollection___add(variable[2])(variable[2], variable[10]) /*AbstractArray::add*/;
310 variable[11] = NEW_String_string___String___with_native(BOX_NativeString("]"), TAG_Int(1)); /*new String*/
311 variable[12] = variable[11];
312 CALL_abstract_collection___SimpleCollection___add(variable[2])(variable[2], variable[12]) /*AbstractArray::add*/;
313 variable[2] = CALL_string___Object___to_s(variable[2])(variable[2]) /*Object::to_s*/;
314 variable[1] = variable[2];
315 goto return_label13;
316 return_label13: while(false);
317 tracehead = trace.prev;
318 return variable[1];
319 }
320 val_t genericity___MMTypeGeneric___is_supertype(val_t self, val_t param0) {
321 struct trace_t trace = {NULL, NULL, 114, LOCATE_genericity___MMTypeGeneric___is_supertype};
322 val_t variable[5];
323 void **closurevariable = NULL;
324 trace.prev = tracehead; tracehead = &trace;
325 trace.file = LOCATE_genericity;
326 variable[0] = self;
327 variable[1] = param0;
328 variable[3] = CALL_static_type___MMType___local_class( variable[1] /*t*/)( variable[1] /*t*/) /*MMType::local_class*/;
329 variable[3] = CALL_abstractmetamodel___MMLocalClass___cshe(variable[3])(variable[3]) /*MMLocalClass::cshe*/;
330 variable[4] = variable[0];
331 variable[4] = ATTR_static_type___MMTypeClass____local_class(variable[4]) /*MMTypeClass::_local_class*/;
332 variable[3] = CALL_partial_order___PartialOrderElement_____leq(variable[3])(variable[3], variable[4]) /*PartialOrderElement::<=*/;
333 if (UNTAG_Bool(variable[3])) { /*if*/
334 variable[4] = variable[0];
335 variable[4] = ATTR_static_type___MMTypeClass____local_class(variable[4]) /*MMTypeClass::_local_class*/;
336 variable[4] = CALL_static_type___MMType___upcast_for( variable[1] /*t*/)( variable[1] /*t*/, variable[4]) /*MMType::upcast_for*/;
337 variable[3] = variable[4];
338 variable[4] = TAG_Bool(( variable[3] /*u*/==NIT_NULL) || VAL_ISA( variable[3] /*u*/, COLOR_MMTypeGeneric, ID_MMTypeGeneric)) /*cast MMTypeGeneric*/;
339 if (UNTAG_Bool(variable[4])) { /*if*/
340 variable[4] = variable[0];
341 variable[4] = CALL_genericity___MMTypeGeneric___is_subtype(variable[4])(variable[4], variable[3] /*u*/) /*MMTypeGeneric::is_subtype*/;
342 variable[2] = variable[4];
343 goto return_label14;
344 }
345 }
346 variable[2] = TAG_Bool(false);
347 goto return_label14;
348 return_label14: while(false);
349 tracehead = trace.prev;
350 return variable[2];
351 }
352 val_t genericity___MMTypeGeneric___for_module(val_t self, val_t param0) {
353 struct trace_t trace = {NULL, NULL, 134, LOCATE_genericity___MMTypeGeneric___for_module};
354 val_t variable[9];
355 void **closurevariable = NULL;
356 trace.prev = tracehead; tracehead = &trace;
357 trace.file = LOCATE_genericity;
358 variable[0] = self;
359 variable[1] = param0;
360 variable[4] = variable[0];
361 variable[3] = variable[4];
362 variable[4] = variable[0];
363 variable[4] = CALL_static_type___MMType___module(variable[4])(variable[4]) /*MMTypeClass::module*/;
364 variable[4] = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable[4] == variable[1] /*mod*/) || ((variable[4] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[4])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[4], variable[1] /*mod*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[4])(variable[4], variable[1] /*mod*/) /*Object::==*/)))))));
365 if (UNTAG_Bool(variable[4])) { /*if*/
366 variable[5] = NEW_Array_array___Array___init(); /*new Array[MMType]*/
367 variable[4] = variable[5];
368 variable[5] = variable[0];
369 variable[5] = ATTR_genericity___MMTypeGeneric____params(variable[5]) /*MMTypeGeneric::_params*/;
370 variable[5] = CALL_abstract_collection___Collection___iterator(variable[5])(variable[5]) /*AbstractArray::iterator*/;
371 while (true) { /*for*/
372 variable[6] = CALL_abstract_collection___Iterator___is_ok(variable[5])(variable[5]) /*ArrayIterator::is_ok*/;
373 if (!UNTAG_Bool(variable[6])) break; /*for*/
374 variable[6] = CALL_abstract_collection___Iterator___item(variable[5])(variable[5]) /*ArrayIterator::item*/;
375 variable[7] = variable[6];
376 variable[8] = CALL_static_type___MMType___for_module( variable[7] /*p*/)( variable[7] /*p*/, variable[1] /*mod*/) /*MMType::for_module*/;
377 CALL_abstract_collection___SimpleCollection___add( variable[4] /*parms*/)( variable[4] /*parms*/, variable[8]) /*AbstractArray::add*/;
378 continue_16: while(0);
379 CALL_abstract_collection___Iterator___next(variable[5])(variable[5]) /*ArrayIterator::next*/;
380 }
381 break_16: while(0);
382 variable[6] = variable[0];
383 variable[6] = ATTR_static_type___MMTypeClass____local_class(variable[6]) /*MMTypeClass::_local_class*/;
384 variable[6] = CALL_abstractmetamodel___MMLocalClass___for_module(variable[6])(variable[6], variable[1] /*mod*/) /*MMLocalClass::for_module*/;
385 variable[5] = variable[6];
386 variable[6] = CALL_genericity___MMLocalClass___get_instantiate_type( variable[5] /*b*/)( variable[5] /*b*/, variable[4] /*parms*/) /*MMLocalClass::get_instantiate_type*/;
387 variable[3] = variable[6] /*t=*/;
388 }
389 variable[4] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[3] /*t*/ == NIT_NULL /*null*/) || (( variable[3] /*t*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[3] /*t*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[3] /*t*/, NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[3] /*t*/)( variable[3] /*t*/, NIT_NULL /*null*/) /*Object::==*/)))))));
390 if (!UNTAG_Bool(variable[4])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeGeneric___for_module, LOCATE_genericity, 145); nit_exit(1);}
391 variable[2] = variable[3] /*t*/;
392 goto return_label15;
393 return_label15: while(false);
394 tracehead = trace.prev;
395 return variable[2];
396 }
397 val_t genericity___MMTypeGeneric___adapt_to(val_t self, val_t param0) {
398 struct trace_t trace = {NULL, NULL, 149, LOCATE_genericity___MMTypeGeneric___adapt_to};
399 val_t variable[8];
400 void **closurevariable = NULL;
401 trace.prev = tracehead; tracehead = &trace;
402 trace.file = LOCATE_genericity;
403 variable[0] = self;
404 variable[1] = param0;
405 variable[4] = NEW_Array_array___Array___init(); /*new Array[MMType]*/
406 variable[3] = variable[4];
407 variable[4] = variable[0];
408 variable[4] = ATTR_genericity___MMTypeGeneric____params(variable[4]) /*MMTypeGeneric::_params*/;
409 variable[4] = CALL_abstract_collection___Collection___iterator(variable[4])(variable[4]) /*AbstractArray::iterator*/;
410 while (true) { /*for*/
411 variable[5] = CALL_abstract_collection___Iterator___is_ok(variable[4])(variable[4]) /*ArrayIterator::is_ok*/;
412 if (!UNTAG_Bool(variable[5])) break; /*for*/
413 variable[5] = CALL_abstract_collection___Iterator___item(variable[4])(variable[4]) /*ArrayIterator::item*/;
414 variable[6] = variable[5];
415 variable[7] = CALL_static_type___MMType___adapt_to( variable[6] /*i*/)( variable[6] /*i*/, variable[1] /*r*/) /*MMType::adapt_to*/;
416 CALL_abstract_collection___SimpleCollection___add( variable[3] /*rv*/)( variable[3] /*rv*/, variable[7]) /*AbstractArray::add*/;
417 continue_18: while(0);
418 CALL_abstract_collection___Iterator___next(variable[4])(variable[4]) /*ArrayIterator::next*/;
419 }
420 break_18: while(0);
421 variable[5] = variable[0];
422 variable[5] = ATTR_static_type___MMTypeClass____local_class(variable[5]) /*MMTypeClass::_local_class*/;
423 variable[5] = CALL_genericity___MMLocalClass___get_instantiate_type(variable[5])(variable[5], variable[3] /*rv*/) /*MMLocalClass::get_instantiate_type*/;
424 variable[4] = variable[5];
425 variable[2] = variable[4] /*l*/;
426 goto return_label17;
427 return_label17: while(false);
428 tracehead = trace.prev;
429 return variable[2];
430 }
431 val_t genericity___MMTypeGeneric___upcast_for(val_t self, val_t param0) {
432 struct trace_t trace = {NULL, NULL, 125, LOCATE_genericity___MMTypeGeneric___upcast_for};
433 val_t variable[5];
434 void **closurevariable = NULL;
435 trace.prev = tracehead; tracehead = &trace;
436 trace.file = LOCATE_genericity;
437 variable[0] = self;
438 variable[1] = param0;
439 variable[4] = CALL_SUPER_genericity___MMTypeGeneric___upcast_for(variable[0])(variable[0], variable[1]) /*super MMTypeGeneric::upcast_for*/;
440 variable[3] = variable[4];
441 variable[4] = variable[0];
442 variable[4] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[3] /*t*/ == variable[4]) || (( variable[3] /*t*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[3] /*t*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[3] /*t*/,variable[4])):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[3] /*t*/)( variable[3] /*t*/, variable[4]) /*Object::==*/)))))));
443 if (UNTAG_Bool(variable[4])) { /*if*/
444 variable[4] = variable[0];
445 variable[4] = CALL_static_type___MMType___adapt_to( variable[3] /*t*/)( variable[3] /*t*/, variable[4]) /*MMType::adapt_to*/;
446 variable[3] = variable[4] /*t=*/;
447 }
448 variable[2] = variable[3] /*t*/;
449 goto return_label19;
450 return_label19: while(false);
451 tracehead = trace.prev;
452 return variable[2];
453 }
454 val_t genericity___MMTypeGeneric___is_generic(val_t self) {
455 struct trace_t trace = {NULL, NULL, 112, LOCATE_genericity___MMTypeGeneric___is_generic};
456 val_t variable[2];
457 void **closurevariable = NULL;
458 trace.prev = tracehead; tracehead = &trace;
459 trace.file = LOCATE_genericity;
460 variable[0] = self;
461 variable[1] = TAG_Bool(true);
462 goto return_label20;
463 return_label20: while(false);
464 tracehead = trace.prev;
465 return variable[1];
466 }
467 val_t genericity___MMTypeGeneric___params(val_t self) {
468 struct trace_t trace = {NULL, NULL, 109, LOCATE_genericity___MMTypeGeneric___params};
469 val_t *variable = NULL;
470 void **closurevariable = NULL;
471 trace.prev = tracehead; tracehead = &trace;
472 trace.file = LOCATE_genericity;
473 tracehead = trace.prev;
474 return ATTR_genericity___MMTypeGeneric____params( self) /*MMTypeGeneric::_params*/;
475 }
476 val_t genericity___MMTypeGeneric___params_equals(val_t self, val_t param0) {
477 struct trace_t trace = {NULL, NULL, 159, LOCATE_genericity___MMTypeGeneric___params_equals};
478 val_t variable[12];
479 void **closurevariable = NULL;
480 trace.prev = tracehead; tracehead = &trace;
481 trace.file = LOCATE_genericity;
482 variable[0] = self;
483 variable[1] = param0;
484 variable[3] = CALL_abstract_collection___Collection___length( variable[1] /*t*/)( variable[1] /*t*/) /*AbstractArray::length*/;
485 variable[4] = variable[0];
486 variable[4] = ATTR_genericity___MMTypeGeneric____params(variable[4]) /*MMTypeGeneric::_params*/;
487 variable[4] = CALL_abstract_collection___Collection___length(variable[4])(variable[4]) /*AbstractArray::length*/;
488 variable[3] = TAG_Bool((variable[3])!=(variable[4]));
489 if (UNTAG_Bool(variable[3])) { /*if*/
490 variable[2] = TAG_Bool(false);
491 goto return_label21;
492 }
493 variable[3] = CALL_abstract_collection___Collection___length( variable[1] /*t*/)( variable[1] /*t*/) /*AbstractArray::length*/;
494 variable[4] = NEW_Range_range___Range___without_last( TAG_Int(0), variable[3]); /*new Range[Int]*/
495 variable[3] = variable[4];
496 variable[3] = CALL_abstract_collection___Collection___iterator(variable[3])(variable[3]) /*Range::iterator*/;
497 while (true) { /*for*/
498 variable[4] = CALL_abstract_collection___Iterator___is_ok(variable[3])(variable[3]) /*Iterator::is_ok*/;
499 if (!UNTAG_Bool(variable[4])) break; /*for*/
500 variable[4] = CALL_abstract_collection___Iterator___item(variable[3])(variable[3]) /*Iterator::item*/;
501 variable[5] = variable[4];
502 variable[6] = variable[0];
503 variable[6] = ATTR_genericity___MMTypeGeneric____params(variable[6]) /*MMTypeGeneric::_params*/;
504 variable[7] = variable[6];
505 variable[8] = variable[5] /*i*/;
506 variable[10] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)>=UNTAG_Int( TAG_Int(0)));
507 variable[11] = variable[10];
508 if (UNTAG_Bool(variable[11])) { /* and */
509 variable[11] = variable[7];
510 variable[11] = ATTR_array___AbstractArray____length(variable[11]) /*AbstractArray::_length*/;
511 variable[11] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)<UNTAG_Int(variable[11]));
512 }
513 variable[10] = variable[11];
514 if (!UNTAG_Bool(variable[10])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
515 variable[10] = variable[7];
516 variable[10] = ATTR_array___Array____items(variable[10]) /*Array::_items*/;
517 variable[10] = UNBOX_NativeArray(variable[10])[UNTAG_Int( variable[8] /*index*/)];
518 variable[9] = variable[10];
519 goto return_label23;
520 return_label23: while(false);
521 variable[6] = variable[9];
522 variable[6] = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable[6] == NIT_NULL /*null*/) || ((variable[6] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[6])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[6], NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[6])(variable[6], NIT_NULL /*null*/) /*Object::==*/)))))));
523 if (!UNTAG_Bool(variable[6])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeGeneric___params_equals, LOCATE_genericity, 165); nit_exit(1);}
524 variable[6] = variable[1] /*t*/;
525 variable[7] = variable[5] /*i*/;
526 variable[9] = TAG_Bool(UNTAG_Int( variable[7] /*index*/)>=UNTAG_Int( TAG_Int(0)));
527 variable[10] = variable[9];
528 if (UNTAG_Bool(variable[10])) { /* and */
529 variable[10] = variable[6];
530 variable[10] = ATTR_array___AbstractArray____length(variable[10]) /*AbstractArray::_length*/;
531 variable[10] = TAG_Bool(UNTAG_Int( variable[7] /*index*/)<UNTAG_Int(variable[10]));
532 }
533 variable[9] = variable[10];
534 if (!UNTAG_Bool(variable[9])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
535 variable[9] = variable[6];
536 variable[9] = ATTR_array___Array____items(variable[9]) /*Array::_items*/;
537 variable[9] = UNBOX_NativeArray(variable[9])[UNTAG_Int( variable[7] /*index*/)];
538 variable[8] = variable[9];
539 goto return_label24;
540 return_label24: while(false);
541 variable[6] = variable[8];
542 variable[6] = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable[6] == NIT_NULL /*null*/) || ((variable[6] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[6])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[6], NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[6])(variable[6], NIT_NULL /*null*/) /*Object::==*/)))))));
543 if (!UNTAG_Bool(variable[6])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeGeneric___params_equals, LOCATE_genericity, 166); nit_exit(1);}
544 variable[6] = variable[0];
545 variable[6] = ATTR_genericity___MMTypeGeneric____params(variable[6]) /*MMTypeGeneric::_params*/;
546 variable[7] = variable[6];
547 variable[8] = variable[5] /*i*/;
548 variable[10] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)>=UNTAG_Int( TAG_Int(0)));
549 variable[11] = variable[10];
550 if (UNTAG_Bool(variable[11])) { /* and */
551 variable[11] = variable[7];
552 variable[11] = ATTR_array___AbstractArray____length(variable[11]) /*AbstractArray::_length*/;
553 variable[11] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)<UNTAG_Int(variable[11]));
554 }
555 variable[10] = variable[11];
556 if (!UNTAG_Bool(variable[10])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
557 variable[10] = variable[7];
558 variable[10] = ATTR_array___Array____items(variable[10]) /*Array::_items*/;
559 variable[10] = UNBOX_NativeArray(variable[10])[UNTAG_Int( variable[8] /*index*/)];
560 variable[9] = variable[10];
561 goto return_label25;
562 return_label25: while(false);
563 variable[6] = variable[9];
564 variable[7] = variable[1] /*t*/;
565 variable[8] = variable[5] /*i*/;
566 variable[10] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)>=UNTAG_Int( TAG_Int(0)));
567 variable[11] = variable[10];
568 if (UNTAG_Bool(variable[11])) { /* and */
569 variable[11] = variable[7];
570 variable[11] = ATTR_array___AbstractArray____length(variable[11]) /*AbstractArray::_length*/;
571 variable[11] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)<UNTAG_Int(variable[11]));
572 }
573 variable[10] = variable[11];
574 if (!UNTAG_Bool(variable[10])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
575 variable[10] = variable[7];
576 variable[10] = ATTR_array___Array____items(variable[10]) /*Array::_items*/;
577 variable[10] = UNBOX_NativeArray(variable[10])[UNTAG_Int( variable[8] /*index*/)];
578 variable[9] = variable[10];
579 goto return_label26;
580 return_label26: while(false);
581 variable[7] = variable[9];
582 variable[6] = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable[6] == variable[7]) || ((variable[6] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[6])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[6],variable[7])):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[6])(variable[6], variable[7]) /*Object::==*/)))))));
583 if (UNTAG_Bool(variable[6])) { /*if*/
584 variable[2] = TAG_Bool(false);
585 goto return_label21;
586 }
587 continue_22: while(0);
588 CALL_abstract_collection___Iterator___next(variable[3])(variable[3]) /*Iterator::next*/;
589 }
590 break_22: while(0);
591 variable[2] = TAG_Bool(true);
592 goto return_label21;
593 return_label21: while(false);
594 tracehead = trace.prev;
595 return variable[2];
596 }
597 val_t genericity___MMTypeGeneric___is_subtype(val_t self, val_t param0) {
598 struct trace_t trace = {NULL, NULL, 179, LOCATE_genericity___MMTypeGeneric___is_subtype};
599 val_t variable[13];
600 void **closurevariable = NULL;
601 trace.prev = tracehead; tracehead = &trace;
602 trace.file = LOCATE_genericity;
603 variable[0] = self;
604 variable[1] = param0;
605 variable[3] = variable[0];
606 variable[3] = ATTR_genericity___MMTypeGeneric____params(variable[3]) /*MMTypeGeneric::_params*/;
607 variable[3] = CALL_abstract_collection___Collection___length(variable[3])(variable[3]) /*AbstractArray::length*/;
608 variable[4] = NEW_Range_range___Range___without_last( TAG_Int(0), variable[3]); /*new Range[Int]*/
609 variable[3] = variable[4];
610 variable[3] = CALL_abstract_collection___Collection___iterator(variable[3])(variable[3]) /*Range::iterator*/;
611 while (true) { /*for*/
612 variable[4] = CALL_abstract_collection___Iterator___is_ok(variable[3])(variable[3]) /*Iterator::is_ok*/;
613 if (!UNTAG_Bool(variable[4])) break; /*for*/
614 variable[4] = CALL_abstract_collection___Iterator___item(variable[3])(variable[3]) /*Iterator::item*/;
615 variable[5] = variable[4];
616 variable[6] = CALL_genericity___MMTypeGeneric___params( variable[1] /*t*/)( variable[1] /*t*/) /*MMTypeGeneric::params*/;
617 variable[7] = variable[6];
618 variable[8] = variable[5] /*i*/;
619 variable[10] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)>=UNTAG_Int( TAG_Int(0)));
620 variable[11] = variable[10];
621 if (UNTAG_Bool(variable[11])) { /* and */
622 variable[11] = variable[7];
623 variable[11] = ATTR_array___AbstractArray____length(variable[11]) /*AbstractArray::_length*/;
624 variable[11] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)<UNTAG_Int(variable[11]));
625 }
626 variable[10] = variable[11];
627 if (!UNTAG_Bool(variable[10])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
628 variable[10] = variable[7];
629 variable[10] = ATTR_array___Array____items(variable[10]) /*Array::_items*/;
630 variable[10] = UNBOX_NativeArray(variable[10])[UNTAG_Int( variable[8] /*index*/)];
631 variable[9] = variable[10];
632 goto return_label29;
633 return_label29: while(false);
634 variable[6] = variable[9];
635 variable[7] = variable[0];
636 variable[7] = ATTR_genericity___MMTypeGeneric____params(variable[7]) /*MMTypeGeneric::_params*/;
637 variable[8] = variable[7];
638 variable[9] = variable[5] /*i*/;
639 variable[11] = TAG_Bool(UNTAG_Int( variable[9] /*index*/)>=UNTAG_Int( TAG_Int(0)));
640 variable[12] = variable[11];
641 if (UNTAG_Bool(variable[12])) { /* and */
642 variable[12] = variable[8];
643 variable[12] = ATTR_array___AbstractArray____length(variable[12]) /*AbstractArray::_length*/;
644 variable[12] = TAG_Bool(UNTAG_Int( variable[9] /*index*/)<UNTAG_Int(variable[12]));
645 }
646 variable[11] = variable[12];
647 if (!UNTAG_Bool(variable[11])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
648 variable[11] = variable[8];
649 variable[11] = ATTR_array___Array____items(variable[11]) /*Array::_items*/;
650 variable[11] = UNBOX_NativeArray(variable[11])[UNTAG_Int( variable[9] /*index*/)];
651 variable[10] = variable[11];
652 goto return_label30;
653 return_label30: while(false);
654 variable[7] = variable[10];
655 variable[6] = CALL_static_type___MMType_____l(variable[6])(variable[6], variable[7]) /*MMType::<*/;
656 if (UNTAG_Bool( TAG_Bool(!UNTAG_Bool(variable[6])))) { /*if*/
657 variable[2] = TAG_Bool(false);
658 goto return_label27;
659 }
660 continue_28: while(0);
661 CALL_abstract_collection___Iterator___next(variable[3])(variable[3]) /*Iterator::next*/;
662 }
663 break_28: while(0);
664 variable[2] = TAG_Bool(true);
665 goto return_label27;
666 return_label27: while(false);
667 tracehead = trace.prev;
668 return variable[2];
669 }
670 void genericity___MMTypeGeneric___init(val_t self, val_t param0, val_t param1, int* init_table) {
671 struct trace_t trace = {NULL, NULL, 192, LOCATE_genericity___MMTypeGeneric___init};
672 val_t variable[5];
673 void **closurevariable = NULL;
674 trace.prev = tracehead; tracehead = &trace;
675 trace.file = LOCATE_genericity;
676 variable[0] = self;
677 variable[1] = param0;
678 variable[2] = param1;
679 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_MMTypeGeneric].i]) return;
680 CALL_static_type___MMTypeClass___init(variable[0])(variable[0], variable[1] /*c*/, init_table /*YYY*/) /*MMTypeClass::init*/;
681 variable[4] = variable[0];
682 ATTR_genericity___MMTypeGeneric____params(variable[4]) /*MMTypeGeneric::_params*/ = variable[2] /*p*/;
683 return_label31: while(false);
684 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_MMTypeGeneric].i] = 1;
685 tracehead = trace.prev;
686 return;
687 }
688 val_t genericity___MMTypeFormalParameter___module(val_t self) {
689 struct trace_t trace = {NULL, NULL, 207, LOCATE_genericity___MMTypeFormalParameter___module};
690 val_t variable[3];
691 void **closurevariable = NULL;
692 trace.prev = tracehead; tracehead = &trace;
693 trace.file = LOCATE_genericity;
694 variable[0] = self;
695 variable[2] = variable[0];
696 variable[2] = ATTR_genericity___MMTypeFormalParameter____def_class(variable[2]) /*MMTypeFormalParameter::_def_class*/;
697 variable[2] = CALL_abstractmetamodel___MMLocalClass___module(variable[2])(variable[2]) /*MMLocalClass::module*/;
698 variable[1] = variable[2];
699 goto return_label32;
700 return_label32: while(false);
701 tracehead = trace.prev;
702 return variable[1];
703 }
704 val_t genericity___MMTypeFormalParameter___for_module(val_t self, val_t param0) {
705 struct trace_t trace = {NULL, NULL, 209, LOCATE_genericity___MMTypeFormalParameter___for_module};
706 val_t variable[6];
707 void **closurevariable = NULL;
708 trace.prev = tracehead; tracehead = &trace;
709 trace.file = LOCATE_genericity;
710 variable[0] = self;
711 variable[1] = param0;
712 variable[4] = variable[0];
713 variable[3] = variable[4];
714 variable[4] = variable[0];
715 variable[4] = CALL_static_type___MMType___module(variable[4])(variable[4]) /*MMTypeFormalParameter::module*/;
716 variable[4] = TAG_Bool(!UNTAG_Bool(TAG_Bool((variable[4] == variable[1] /*mod*/) || ((variable[4] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[4])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[4], variable[1] /*mod*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[4])(variable[4], variable[1] /*mod*/) /*Object::==*/)))))));
717 if (UNTAG_Bool(variable[4])) { /*if*/
718 variable[4] = variable[0];
719 variable[4] = ATTR_genericity___MMTypeFormalParameter____def_class(variable[4]) /*MMTypeFormalParameter::_def_class*/;
720 variable[4] = CALL_abstractmetamodel___MMLocalClass___global(variable[4])(variable[4]) /*MMLocalClass::global*/;
721 variable[4] = CALL_abstractmetamodel___MMModule_____bra( variable[1] /*mod*/)( variable[1] /*mod*/, variable[4]) /*MMModule::[]*/;
722 variable[5] = variable[0];
723 variable[5] = CALL_genericity___MMTypeFormalParameter___position(variable[5])(variable[5]) /*MMTypeFormalParameter::position*/;
724 variable[4] = CALL_genericity___MMLocalClass___get_formal(variable[4])(variable[4], variable[5]) /*MMLocalClass::get_formal*/;
725 variable[3] = variable[4] /*t=*/;
726 }
727 variable[4] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[3] /*t*/ == NIT_NULL /*null*/) || (( variable[3] /*t*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[3] /*t*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[3] /*t*/, NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[3] /*t*/)( variable[3] /*t*/, NIT_NULL /*null*/) /*Object::==*/)))))));
728 if (!UNTAG_Bool(variable[4])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___for_module, LOCATE_genericity, 215); nit_exit(1);}
729 variable[2] = variable[3] /*t*/;
730 goto return_label33;
731 return_label33: while(false);
732 tracehead = trace.prev;
733 return variable[2];
734 }
735 val_t genericity___MMTypeFormalParameter___adapt_to(val_t self, val_t param0) {
736 struct trace_t trace = {NULL, NULL, 227, LOCATE_genericity___MMTypeFormalParameter___adapt_to};
737 val_t variable[12];
738 void **closurevariable = NULL;
739 trace.prev = tracehead; tracehead = &trace;
740 trace.file = LOCATE_genericity;
741 variable[0] = self;
742 variable[1] = param0;
743 variable[3] = CALL_type_formal___MMType___direct_type( variable[1] /*r*/)( variable[1] /*r*/) /*MMType::direct_type*/;
744 variable[1] = variable[3] /*r=*/;
745 variable[4] = variable[0];
746 variable[4] = CALL_genericity___MMTypeFormalParameter___def_class(variable[4])(variable[4]) /*MMTypeFormalParameter::def_class*/;
747 variable[4] = CALL_static_type___MMType___upcast_for( variable[1] /*r*/)( variable[1] /*r*/, variable[4]) /*MMType::upcast_for*/;
748 variable[3] = variable[4];
749 variable[4] = TAG_Bool(( variable[3] /*old_r*/==NIT_NULL) || VAL_ISA( variable[3] /*old_r*/, COLOR_MMTypeGeneric, ID_MMTypeGeneric)) /*cast MMTypeGeneric*/;
750 if (!UNTAG_Bool(variable[4])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___adapt_to, LOCATE_genericity, 235); nit_exit(1);}
751 variable[5] = CALL_genericity___MMTypeGeneric___params( variable[3] /*old_r*/)( variable[3] /*old_r*/) /*MMTypeGeneric::params*/;
752 variable[6] = variable[0];
753 variable[6] = CALL_genericity___MMTypeFormalParameter___position(variable[6])(variable[6]) /*MMTypeFormalParameter::position*/;
754 variable[7] = variable[5];
755 variable[8] = variable[6];
756 variable[10] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)>=UNTAG_Int( TAG_Int(0)));
757 variable[11] = variable[10];
758 if (UNTAG_Bool(variable[11])) { /* and */
759 variable[11] = variable[7];
760 variable[11] = ATTR_array___AbstractArray____length(variable[11]) /*AbstractArray::_length*/;
761 variable[11] = TAG_Bool(UNTAG_Int( variable[8] /*index*/)<UNTAG_Int(variable[11]));
762 }
763 variable[10] = variable[11];
764 if (!UNTAG_Bool(variable[10])) { fprintf(stderr, "Assert%s failed", " 'index' "); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_array___Array_____bra, LOCATE_genericity, 229); nit_exit(1);}
765 variable[10] = variable[7];
766 variable[10] = ATTR_array___Array____items(variable[10]) /*Array::_items*/;
767 variable[10] = UNBOX_NativeArray(variable[10])[UNTAG_Int( variable[8] /*index*/)];
768 variable[9] = variable[10];
769 goto return_label35;
770 return_label35: while(false);
771 variable[5] = variable[9];
772 variable[4] = variable[5];
773 variable[5] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[4] /*reduct*/ == NIT_NULL /*null*/) || (( variable[4] /*reduct*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[4] /*reduct*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[4] /*reduct*/, NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[4] /*reduct*/)( variable[4] /*reduct*/, NIT_NULL /*null*/) /*Object::==*/)))))));
774 if (!UNTAG_Bool(variable[5])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___adapt_to, LOCATE_genericity, 237); nit_exit(1);}
775 variable[2] = variable[4] /*reduct*/;
776 goto return_label34;
777 return_label34: while(false);
778 tracehead = trace.prev;
779 return variable[2];
780 }
781 val_t genericity___MMTypeFormalParameter___upcast_for(val_t self, val_t param0) {
782 struct trace_t trace = {NULL, NULL, 219, LOCATE_genericity___MMTypeFormalParameter___upcast_for};
783 val_t variable[4];
784 void **closurevariable = NULL;
785 trace.prev = tracehead; tracehead = &trace;
786 trace.file = LOCATE_genericity;
787 variable[0] = self;
788 variable[1] = param0;
789 variable[3] = variable[0];
790 variable[2] = variable[3];
791 goto return_label36;
792 return_label36: while(false);
793 tracehead = trace.prev;
794 return variable[2];
795 }
796 val_t genericity___MMTypeFormalParameter___def_class(val_t self) {
797 struct trace_t trace = {NULL, NULL, 201, LOCATE_genericity___MMTypeFormalParameter___def_class};
798 val_t *variable = NULL;
799 void **closurevariable = NULL;
800 trace.prev = tracehead; tracehead = &trace;
801 trace.file = LOCATE_genericity;
802 tracehead = trace.prev;
803 return ATTR_genericity___MMTypeFormalParameter____def_class( self) /*MMTypeFormalParameter::_def_class*/;
804 }
805 val_t genericity___MMTypeFormalParameter___position(val_t self) {
806 struct trace_t trace = {NULL, NULL, 204, LOCATE_genericity___MMTypeFormalParameter___position};
807 val_t *variable = NULL;
808 void **closurevariable = NULL;
809 trace.prev = tracehead; tracehead = &trace;
810 trace.file = LOCATE_genericity;
811 tracehead = trace.prev;
812 return ATTR_genericity___MMTypeFormalParameter____position( self) /*MMTypeFormalParameter::_position*/;
813 }
814 void genericity___MMTypeFormalParameter___bound__eq(val_t self, val_t param0) {
815 struct trace_t trace = {NULL, NULL, 221, LOCATE_genericity___MMTypeFormalParameter___bound__eq};
816 val_t variable[4];
817 void **closurevariable = NULL;
818 trace.prev = tracehead; tracehead = &trace;
819 trace.file = LOCATE_genericity;
820 variable[0] = self;
821 variable[1] = param0;
822 variable[3] = variable[0];
823 variable[3] = ATTR_type_formal___MMTypeFormal____bound(variable[3]) /*MMTypeFormal::_bound*/;
824 variable[3] = TAG_Bool((variable[3] == NIT_NULL /*null*/) || ((variable[3] != NIT_NULL) && ((CALL_kernel___Object_____eqeq(variable[3])==kernel___Object_____eqeq)?(IS_EQUAL_NN(variable[3], NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq(variable[3])(variable[3], NIT_NULL /*null*/) /*Object::==*/)))));
825 if (!UNTAG_Bool(variable[3])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___bound__eq, LOCATE_genericity, 223); nit_exit(1);}
826 variable[3] = variable[0];
827 ATTR_type_formal___MMTypeFormal____bound(variable[3]) /*MMTypeFormal::_bound*/ = variable[1] /*t*/;
828 return_label37: while(false);
829 tracehead = trace.prev;
830 return;
831 }
832 void genericity___MMTypeFormalParameter___with_bound(val_t self, val_t param0, val_t param1, val_t param2, val_t param3, int* init_table) {
833 struct trace_t trace = {NULL, NULL, 241, LOCATE_genericity___MMTypeFormalParameter___with_bound};
834 val_t variable[7];
835 void **closurevariable = NULL;
836 trace.prev = tracehead; tracehead = &trace;
837 trace.file = LOCATE_genericity;
838 variable[0] = self;
839 variable[1] = param0;
840 variable[2] = param1;
841 variable[3] = param2;
842 variable[4] = param3;
843 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_MMTypeFormalParameter].i]) return;
844 variable[6] = variable[0];
845 CALL_genericity___MMTypeFormalParameter___init(variable[6])(variable[6], variable[1] /*n*/, variable[2] /*p*/, variable[3] /*intro*/, init_table /*YYY*/) /*MMTypeFormalParameter::init*/;
846 variable[6] = variable[0];
847 ATTR_type_formal___MMTypeFormal____bound(variable[6]) /*MMTypeFormal::_bound*/ = variable[4] /*b*/;
848 return_label38: while(false);
849 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_MMTypeFormalParameter].i] = 1;
850 tracehead = trace.prev;
851 return;
852 }
853 void genericity___MMTypeFormalParameter___init(val_t self, val_t param0, val_t param1, val_t param2, int* init_table) {
854 struct trace_t trace = {NULL, NULL, 247, LOCATE_genericity___MMTypeFormalParameter___init};
855 val_t variable[6];
856 void **closurevariable = NULL;
857 trace.prev = tracehead; tracehead = &trace;
858 trace.file = LOCATE_genericity;
859 variable[0] = self;
860 variable[1] = param0;
861 variable[2] = param1;
862 variable[3] = param2;
863 if (init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_MMTypeFormalParameter].i]) return;
864 variable[5] = TAG_Bool(!UNTAG_Bool(TAG_Bool(( variable[1] /*n*/ == NIT_NULL /*null*/) || (( variable[1] /*n*/ != NIT_NULL) && ((CALL_kernel___Object_____eqeq( variable[1] /*n*/)==kernel___Object_____eqeq)?(IS_EQUAL_NN( variable[1] /*n*/, NIT_NULL /*null*/)):(UNTAG_Bool(CALL_kernel___Object_____eqeq( variable[1] /*n*/)( variable[1] /*n*/, NIT_NULL /*null*/) /*Object::==*/)))))));
865 if (!UNTAG_Bool(variable[5])) { fprintf(stderr, "Assert%s failed", ""); fprintf(stderr, " in %s (%s:%d)\n", LOCATE_genericity___MMTypeFormalParameter___init, LOCATE_genericity, 249); nit_exit(1);}
866 CALL_type_formal___MMTypeFormal___init(variable[0])(variable[0], variable[1] /*n*/, NIT_NULL /*null*/, init_table /*YYY*/) /*MMTypeFormal::init*/;
867 variable[5] = variable[0];
868 ATTR_genericity___MMTypeFormalParameter____position(variable[5]) /*MMTypeFormalParameter::_position*/ = variable[2] /*p*/;
869 variable[5] = variable[0];
870 ATTR_genericity___MMTypeFormalParameter____def_class(variable[5]) /*MMTypeFormalParameter::_def_class*/ = variable[3] /*intro*/;
871 return_label39: while(false);
872 init_table[VAL2OBJ(variable[0])->vft[INIT_TABLE_POS_MMTypeFormalParameter].i] = 1;
873 tracehead = trace.prev;
874 return;
875 }
876 val_t genericity___MMTypeNone___for_module(val_t self, val_t param0) {
877 struct trace_t trace = {NULL, NULL, 258, LOCATE_genericity___MMTypeNone___for_module};
878 val_t variable[4];
879 void **closurevariable = NULL;
880 trace.prev = tracehead; tracehead = &trace;
881 trace.file = LOCATE_genericity;
882 variable[0] = self;
883 variable[1] = param0;
884 variable[3] = variable[0];
885 variable[2] = variable[3];
886 goto return_label40;
887 return_label40: while(false);
888 tracehead = trace.prev;
889 return variable[2];
890 }
891 val_t genericity___MMTypeNone___adapt_to(val_t self, val_t param0) {
892 struct trace_t trace = {NULL, NULL, 259, LOCATE_genericity___MMTypeNone___adapt_to};
893 val_t variable[4];
894 void **closurevariable = NULL;
895 trace.prev = tracehead; tracehead = &trace;
896 trace.file = LOCATE_genericity;
897 variable[0] = self;
898 variable[1] = param0;
899 variable[3] = variable[0];
900 variable[2] = variable[3];
901 goto return_label41;
902 return_label41: while(false);
903 tracehead = trace.prev;
904 return variable[2];
905 }
906 val_t genericity___MMTypeNone___is_generic(val_t self) {
907 struct trace_t trace = {NULL, NULL, 257, LOCATE_genericity___MMTypeNone___is_generic};
908 val_t variable[2];
909 void **closurevariable = NULL;
910 trace.prev = tracehead; tracehead = &trace;
911 trace.file = LOCATE_genericity;
912 variable[0] = self;
913 variable[1] = TAG_Bool(false);
914 goto return_label42;
915 return_label42: while(false);
916 tracehead = trace.prev;
917 return variable[1];
918 }