layout_builders: Added perfect hashing for mproperties
[nit.git] / c_src / compiling___icode_generator._sep.c
1 /* This C file is generated by NIT to compile module compiling___icode_generator. */
2 #include "compiling___icode_generator._sep.h"
3 static const char LOCATE_compiling___icode_generator___Program___generate_icode_files[] = "icode_generator::Program::generate_icode_files";
4 void compiling___icode_generator___Program___generate_icode_files(val_t p0){
5 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
6 val_t REGB0;
7 val_t tmp;
8 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
9 fra.me.file = LOCATE_compiling___icode_generator;
10 fra.me.line = 26;
11 fra.me.meth = LOCATE_compiling___icode_generator___Program___generate_icode_files;
12 fra.me.has_broke = 0;
13 fra.me.REG_size = 3;
14 fra.me.nitni_local_ref_head = NULL;
15 fra.me.REG[0] = NIT_NULL;
16 fra.me.REG[1] = NIT_NULL;
17 fra.me.REG[2] = NIT_NULL;
18 fra.me.REG[0] = p0;
19 /* compiling/icode_generator.nit:26 */
20 fra.me.REG[1] = fra.me.REG[0];
21 /* compiling/icode_generator.nit:28 */
22 fra.me.REG[2] = CALL_program___Program___tc(fra.me.REG[1])(fra.me.REG[1]);
23 fra.me.REG[2] = CALL_compiling___compiling_base___ToolContext___compdir(fra.me.REG[2])(fra.me.REG[2]);
24 REGB0 = TAG_Bool(fra.me.REG[2]==NIT_NULL);
25 if (UNTAG_Bool(REGB0)) {
26 nit_abort("Reciever is null", NULL, LOCATE_compiling___icode_generator, 28);
27 }
28 CALL_standard___file___String___mkdir(fra.me.REG[2])(fra.me.REG[2]);
29 CALL_program___Program___with_each_live_local_classes(fra.me.REG[1])(fra.me.REG[1], (&(fra.me)), ((fun_t)OC_compiling___icode_generator___Program___generate_icode_files_1));
30 stack_frame_head = fra.me.prev;
31 return;
32 }
33 void OC_compiling___icode_generator___Program___generate_icode_files_1(struct stack_frame_t *closctx, val_t p0){
34 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
35 val_t REGB0;
36 val_t tmp;
37 /* compiling/icode_generator.nit:30 */
38 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
39 fra.me.file = LOCATE_compiling___icode_generator;
40 fra.me.line = 30;
41 fra.me.meth = LOCATE_compiling___icode_generator___Program___generate_icode_files;
42 fra.me.has_broke = 0;
43 fra.me.REG_size = 2;
44 fra.me.nitni_local_ref_head = NULL;
45 fra.me.REG[0] = NIT_NULL;
46 fra.me.REG[1] = NIT_NULL;
47 fra.me.REG[0] = p0;
48 /* compiling/icode_generator.nit:31 */
49 fra.me.REG[1] = CALL_program___Program___tc(closctx->REG[1])(closctx->REG[1]);
50 fra.me.REG[1] = CALL_compiling___compiling_base___ToolContext___compdir(fra.me.REG[1])(fra.me.REG[1]);
51 REGB0 = TAG_Bool((fra.me.REG[1]!=NIT_NULL) && VAL_ISA(fra.me.REG[1], COLOR_standard___string___String, ID_standard___string___String)) /*cast String*/;
52 if (UNTAG_Bool(REGB0)) {
53 } else {
54 nit_abort("Cast failed", NULL, LOCATE_compiling___icode_generator, 31);
55 }
56 CALL_compiling___icode_generator___MMLocalClass___generate_icode_file(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
57 stack_frame_head = fra.me.prev;
58 return;
59 }
60 static const char LOCATE_compiling___icode_generator___FileICodeDumper___init[] = "icode_generator::FileICodeDumper::init";
61 void compiling___icode_generator___FileICodeDumper___init(val_t p0, val_t p1, int* init_table){
62 int itpos0 = VAL2OBJ(p0)->vft[INIT_TABLE_POS_compiling___icode_generator___FileICodeDumper].i;
63 struct {struct stack_frame_t me; val_t MORE_REG[2];} fra;
64 val_t REGB0;
65 val_t REGB1;
66 val_t tmp;
67 if (init_table[itpos0]) return;
68 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
69 fra.me.file = LOCATE_compiling___icode_generator;
70 fra.me.line = 41;
71 fra.me.meth = LOCATE_compiling___icode_generator___FileICodeDumper___init;
72 fra.me.has_broke = 0;
73 fra.me.REG_size = 3;
74 fra.me.nitni_local_ref_head = NULL;
75 fra.me.REG[0] = NIT_NULL;
76 fra.me.REG[1] = NIT_NULL;
77 fra.me.REG[2] = NIT_NULL;
78 fra.me.REG[0] = p0;
79 fra.me.REG[1] = p1;
80 /* compiling/icode_generator.nit:41 */
81 fra.me.REG[2] = fra.me.REG[0];
82 /* compiling/icode_generator.nit:43 */
83 REGB0 = TAG_Bool(0);
84 REGB1 = TAG_Bool(0);
85 CALL_analysis___icode_dump___ICodeDumper___init(fra.me.REG[0])(fra.me.REG[0], REGB0, REGB1, init_table);
86 /* compiling/icode_generator.nit:44 */
87 ATTR_compiling___icode_generator___FileICodeDumper____file(fra.me.REG[2]) = fra.me.REG[1];
88 stack_frame_head = fra.me.prev;
89 init_table[itpos0] = 1;
90 return;
91 }
92 static const char LOCATE_compiling___icode_generator___FileICodeDumper___write[] = "icode_generator::FileICodeDumper::(icode_dump::ICodeDumper::write)";
93 void compiling___icode_generator___FileICodeDumper___write(val_t p0, val_t p1){
94 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
95 val_t REGB0;
96 val_t REGB1;
97 val_t REGB2;
98 val_t tmp;
99 static val_t once_value_1; /* Once value */
100 static val_t once_value_3; /* Once value */
101 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
102 fra.me.file = LOCATE_compiling___icode_generator;
103 fra.me.line = 47;
104 fra.me.meth = LOCATE_compiling___icode_generator___FileICodeDumper___write;
105 fra.me.has_broke = 0;
106 fra.me.REG_size = 4;
107 fra.me.nitni_local_ref_head = NULL;
108 fra.me.REG[0] = NIT_NULL;
109 fra.me.REG[1] = NIT_NULL;
110 fra.me.REG[2] = NIT_NULL;
111 fra.me.REG[3] = NIT_NULL;
112 fra.me.REG[0] = p0;
113 fra.me.REG[1] = p1;
114 /* compiling/icode_generator.nit:48 */
115 REGB0 = TAG_Int(0);
116 REGB1 = CALL_analysis___icode_dump___ICodeDumper___indent_level(fra.me.REG[0])(fra.me.REG[0]);
117 /* ../lib/standard/kernel.nit:355 */
118 while(1) {
119 REGB2 = TAG_Bool(VAL_ISA(REGB1, VTCOLOR_standard___kernel___Comparable___OTHER(REGB0), VTID_standard___kernel___Comparable___OTHER(REGB0))) /*cast OTHER*/;
120 if (UNTAG_Bool(REGB2)) {
121 } else {
122 nit_abort("Cast failed", NULL, LOCATE_standard___kernel, 0);
123 }
124 /* ../lib/standard/kernel.nit:235 */
125 REGB2 = TAG_Bool(UNTAG_Int(REGB0)<UNTAG_Int(REGB1));
126 /* ../lib/standard/kernel.nit:355 */
127 if (UNTAG_Bool(REGB2)) {
128 /* compiling/icode_generator.nit:49 */
129 REGB2 = TAG_Bool(ATTR_compiling___icode_generator___FileICodeDumper____file(fra.me.REG[0])!=NIT_NULL);
130 if (UNTAG_Bool(REGB2)) {
131 } else {
132 nit_abort("Uninitialized attribute %s", "_file", LOCATE_compiling___icode_generator, 49);
133 }
134 fra.me.REG[2] = ATTR_compiling___icode_generator___FileICodeDumper____file(fra.me.REG[0]);
135 if (!once_value_1) {
136 fra.me.REG[3] = BOX_NativeString(" ");
137 REGB2 = TAG_Int(4);
138 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB2);
139 once_value_1 = fra.me.REG[3];
140 register_static_object(&once_value_1);
141 } else fra.me.REG[3] = once_value_1;
142 fra.me.REG[3] = fra.me.REG[3];
143 CALL_standard___stream___OStream___write(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
144 /* ../lib/standard/kernel.nit:357 */
145 REGB2 = TAG_Int(1);
146 /* ../lib/standard/kernel.nit:238 */
147 REGB2 = TAG_Int(UNTAG_Int(REGB0)+UNTAG_Int(REGB2));
148 /* ../lib/standard/kernel.nit:357 */
149 REGB0 = REGB2;
150 } else {
151 /* ../lib/standard/kernel.nit:355 */
152 goto label2;
153 }
154 }
155 label2: while(0);
156 /* compiling/icode_generator.nit:51 */
157 REGB0 = TAG_Bool(ATTR_compiling___icode_generator___FileICodeDumper____file(fra.me.REG[0])!=NIT_NULL);
158 if (UNTAG_Bool(REGB0)) {
159 } else {
160 nit_abort("Uninitialized attribute %s", "_file", LOCATE_compiling___icode_generator, 51);
161 }
162 fra.me.REG[3] = ATTR_compiling___icode_generator___FileICodeDumper____file(fra.me.REG[0]);
163 CALL_standard___stream___OStream___write(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]);
164 /* compiling/icode_generator.nit:52 */
165 REGB0 = TAG_Bool(ATTR_compiling___icode_generator___FileICodeDumper____file(fra.me.REG[0])!=NIT_NULL);
166 if (UNTAG_Bool(REGB0)) {
167 } else {
168 nit_abort("Uninitialized attribute %s", "_file", LOCATE_compiling___icode_generator, 52);
169 }
170 fra.me.REG[0] = ATTR_compiling___icode_generator___FileICodeDumper____file(fra.me.REG[0]);
171 if (!once_value_3) {
172 fra.me.REG[1] = BOX_NativeString("\n");
173 REGB0 = TAG_Int(1);
174 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
175 once_value_3 = fra.me.REG[1];
176 register_static_object(&once_value_3);
177 } else fra.me.REG[1] = once_value_3;
178 fra.me.REG[1] = fra.me.REG[1];
179 CALL_standard___stream___OStream___write(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
180 stack_frame_head = fra.me.prev;
181 return;
182 }
183 static const char LOCATE_compiling___icode_generator___MMLocalClass___generate_icode_file[] = "icode_generator::MMLocalClass::generate_icode_file";
184 void compiling___icode_generator___MMLocalClass___generate_icode_file(val_t p0, val_t p1){
185 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
186 val_t REGB0;
187 val_t REGB1;
188 val_t tmp;
189 static val_t once_value_1; /* Once value */
190 static val_t once_value_2; /* Once value */
191 static val_t once_value_3; /* Once value */
192 static val_t once_value_4; /* Once value */
193 static val_t once_value_5; /* Once value */
194 static val_t once_value_6; /* Once value */
195 static val_t once_value_7; /* Once value */
196 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
197 fra.me.file = LOCATE_compiling___icode_generator;
198 fra.me.line = 57;
199 fra.me.meth = LOCATE_compiling___icode_generator___MMLocalClass___generate_icode_file;
200 fra.me.has_broke = 0;
201 fra.me.REG_size = 4;
202 fra.me.nitni_local_ref_head = NULL;
203 fra.me.REG[0] = NIT_NULL;
204 fra.me.REG[1] = NIT_NULL;
205 fra.me.REG[2] = NIT_NULL;
206 fra.me.REG[3] = NIT_NULL;
207 fra.me.REG[0] = p0;
208 fra.me.REG[1] = p1;
209 /* compiling/icode_generator.nit:59 */
210 REGB0 = TAG_Int(5);
211 fra.me.REG[2] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
212 if (!once_value_1) {
213 fra.me.REG[3] = BOX_NativeString("");
214 REGB0 = TAG_Int(0);
215 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
216 once_value_1 = fra.me.REG[3];
217 register_static_object(&once_value_1);
218 } else fra.me.REG[3] = once_value_1;
219 fra.me.REG[3] = fra.me.REG[3];
220 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
221 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
222 if (!once_value_2) {
223 fra.me.REG[1] = BOX_NativeString("/");
224 REGB0 = TAG_Int(1);
225 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
226 once_value_2 = fra.me.REG[1];
227 register_static_object(&once_value_2);
228 } else fra.me.REG[1] = once_value_2;
229 fra.me.REG[1] = fra.me.REG[1];
230 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
231 fra.me.REG[1] = CALL_standard___string___Object___to_s(fra.me.REG[0])(fra.me.REG[0]);
232 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
233 if (!once_value_3) {
234 fra.me.REG[1] = BOX_NativeString(".icode");
235 REGB0 = TAG_Int(6);
236 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
237 once_value_3 = fra.me.REG[1];
238 register_static_object(&once_value_3);
239 } else fra.me.REG[1] = once_value_3;
240 fra.me.REG[1] = fra.me.REG[1];
241 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
242 fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
243 fra.me.REG[2] = NEW_OFStream_standard___file___OFStream___open(fra.me.REG[2]);
244 /* compiling/icode_generator.nit:60 */
245 fra.me.REG[1] = CALL_primitive_info___MMLocalClass___primitive_info(fra.me.REG[0])(fra.me.REG[0]);
246 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
247 if (UNTAG_Bool(REGB0)) {
248 } else {
249 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
250 if (UNTAG_Bool(REGB1)) {
251 REGB1 = TAG_Bool(0);
252 REGB0 = REGB1;
253 } else {
254 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
255 REGB0 = REGB1;
256 }
257 }
258 if (UNTAG_Bool(REGB0)) {
259 /* compiling/icode_generator.nit:62 */
260 fra.me.REG[1] = CALL_program___MMLocalClass___init_var_iroutine(fra.me.REG[0])(fra.me.REG[0]);
261 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
262 if (UNTAG_Bool(REGB0)) {
263 } else {
264 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
265 if (UNTAG_Bool(REGB1)) {
266 REGB1 = TAG_Bool(0);
267 REGB0 = REGB1;
268 } else {
269 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
270 REGB0 = REGB1;
271 }
272 }
273 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
274 if (UNTAG_Bool(REGB0)) {
275 /* compiling/icode_generator.nit:63 */
276 fra.me.REG[1] = NEW_FileICodeDumper_compiling___icode_generator___FileICodeDumper___init(fra.me.REG[2]);
277 /* compiling/icode_generator.nit:64 */
278 CALL_analysis___icode_dump___ICodeDumper___indent(fra.me.REG[1])(fra.me.REG[1]);
279 /* compiling/icode_generator.nit:65 */
280 if (!once_value_4) {
281 fra.me.REG[3] = BOX_NativeString("Init var iroutine::\n");
282 REGB0 = TAG_Int(20);
283 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
284 once_value_4 = fra.me.REG[3];
285 register_static_object(&once_value_4);
286 } else fra.me.REG[3] = once_value_4;
287 fra.me.REG[3] = fra.me.REG[3];
288 CALL_standard___stream___OStream___write(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
289 /* compiling/icode_generator.nit:66 */
290 fra.me.REG[3] = CALL_program___MMLocalClass___init_var_iroutine(fra.me.REG[0])(fra.me.REG[0]);
291 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
292 if (UNTAG_Bool(REGB0)) {
293 nit_abort("Reciever is null", NULL, LOCATE_compiling___icode_generator, 66);
294 }
295 CALL_analysis___icode_dump___IRoutine___dump(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]);
296 /* compiling/icode_generator.nit:67 */
297 if (!once_value_5) {
298 fra.me.REG[1] = BOX_NativeString("\n\n");
299 REGB0 = TAG_Int(2);
300 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
301 once_value_5 = fra.me.REG[1];
302 register_static_object(&once_value_5);
303 } else fra.me.REG[1] = once_value_5;
304 fra.me.REG[1] = fra.me.REG[1];
305 CALL_standard___stream___OStream___write(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
306 }
307 /* compiling/icode_generator.nit:69 */
308 fra.me.REG[1] = CALL_program___MMLocalClass___checknew_iroutine(fra.me.REG[0])(fra.me.REG[0]);
309 REGB0 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
310 if (UNTAG_Bool(REGB0)) {
311 } else {
312 REGB1 = TAG_Bool(fra.me.REG[1]==NIT_NULL);
313 if (UNTAG_Bool(REGB1)) {
314 REGB1 = TAG_Bool(0);
315 REGB0 = REGB1;
316 } else {
317 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], NIT_NULL);
318 REGB0 = REGB1;
319 }
320 }
321 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
322 if (UNTAG_Bool(REGB0)) {
323 /* compiling/icode_generator.nit:70 */
324 fra.me.REG[1] = NEW_FileICodeDumper_compiling___icode_generator___FileICodeDumper___init(fra.me.REG[2]);
325 /* compiling/icode_generator.nit:71 */
326 CALL_analysis___icode_dump___ICodeDumper___indent(fra.me.REG[1])(fra.me.REG[1]);
327 /* compiling/icode_generator.nit:72 */
328 if (!once_value_6) {
329 fra.me.REG[3] = BOX_NativeString("Check new instance iroutine::\n");
330 REGB0 = TAG_Int(30);
331 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
332 once_value_6 = fra.me.REG[3];
333 register_static_object(&once_value_6);
334 } else fra.me.REG[3] = once_value_6;
335 fra.me.REG[3] = fra.me.REG[3];
336 CALL_standard___stream___OStream___write(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
337 /* compiling/icode_generator.nit:73 */
338 fra.me.REG[3] = CALL_program___MMLocalClass___checknew_iroutine(fra.me.REG[0])(fra.me.REG[0]);
339 REGB0 = TAG_Bool(fra.me.REG[3]==NIT_NULL);
340 if (UNTAG_Bool(REGB0)) {
341 nit_abort("Reciever is null", NULL, LOCATE_compiling___icode_generator, 73);
342 }
343 CALL_analysis___icode_dump___IRoutine___dump(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[1]);
344 /* compiling/icode_generator.nit:74 */
345 if (!once_value_7) {
346 fra.me.REG[1] = BOX_NativeString("\n\n");
347 REGB0 = TAG_Int(2);
348 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
349 once_value_7 = fra.me.REG[1];
350 register_static_object(&once_value_7);
351 } else fra.me.REG[1] = once_value_7;
352 fra.me.REG[1] = fra.me.REG[1];
353 CALL_standard___stream___OStream___write(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[1]);
354 }
355 /* compiling/icode_generator.nit:78 */
356 fra.me.REG[1] = CALL_metamodel___abstractmetamodel___MMLocalClass___global_properties(fra.me.REG[0])(fra.me.REG[0]);
357 CALL_standard___collection___abstract_collection___Collection___iterate(fra.me.REG[1])(fra.me.REG[1], (&(fra.me)), ((fun_t)OC_compiling___icode_generator___MMLocalClass___generate_icode_file_8));
358 }
359 /* compiling/icode_generator.nit:92 */
360 fra.me.REG[1] = CALL_metamodel___abstractmetamodel___MMLocalClass___global_properties(fra.me.REG[0])(fra.me.REG[0]);
361 CALL_standard___collection___abstract_collection___Collection___iterate(fra.me.REG[1])(fra.me.REG[1], (&(fra.me)), ((fun_t)OC_compiling___icode_generator___MMLocalClass___generate_icode_file_13));
362 /* compiling/icode_generator.nit:98 */
363 CALL_standard___stream___IOS___close(fra.me.REG[2])(fra.me.REG[2]);
364 stack_frame_head = fra.me.prev;
365 return;
366 }
367 void OC_compiling___icode_generator___MMLocalClass___generate_icode_file_8(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){
368 struct {struct stack_frame_t me; val_t MORE_REG[3];} fra;
369 val_t REGB0;
370 fun_t CREG[1];
371 val_t tmp;
372 static val_t once_value_10; /* Once value */
373 static val_t once_value_11; /* Once value */
374 static val_t once_value_12; /* Once value */
375 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
376 fra.me.file = LOCATE_compiling___icode_generator;
377 fra.me.line = 0;
378 fra.me.meth = LOCATE_compiling___icode_generator___MMLocalClass___generate_icode_file;
379 fra.me.has_broke = 0;
380 fra.me.REG_size = 4;
381 fra.me.nitni_local_ref_head = NULL;
382 fra.me.REG[0] = NIT_NULL;
383 fra.me.REG[1] = NIT_NULL;
384 fra.me.REG[2] = NIT_NULL;
385 fra.me.REG[3] = NIT_NULL;
386 fra.me.closure_ctx = closctx_param;
387 fra.me.closure_funs = CREG;
388 fra.me.REG[0] = p0;
389 CREG[0] = clos_fun0;
390 /* compiling/icode_generator.nit:79 */
391 REGB0 = CALL_metamodel___abstractmetamodel___MMGlobalProperty___is_init_for(fra.me.REG[0])(fra.me.REG[0], closctx->REG[0]);
392 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
393 if (UNTAG_Bool(REGB0)) {
394 goto label9;
395 }
396 /* compiling/icode_generator.nit:80 */
397 fra.me.REG[0] = CALL_metamodel___abstractmetamodel___MMLocalClass_____bra(closctx->REG[0])(closctx->REG[0], fra.me.REG[0]);
398 /* compiling/icode_generator.nit:81 */
399 REGB0 = TAG_Bool(VAL_ISA(fra.me.REG[0], COLOR_metamodel___abstractmetamodel___MMMethod, ID_metamodel___abstractmetamodel___MMMethod)) /*cast MMMethod*/;
400 if (UNTAG_Bool(REGB0)) {
401 } else {
402 nit_abort("Assert failed", NULL, LOCATE_compiling___icode_generator, 81);
403 }
404 /* compiling/icode_generator.nit:82 */
405 fra.me.REG[1] = CALL_program___MMLocalClass___new_instance_iroutine(closctx->REG[0])(closctx->REG[0]);
406 REGB0 = CALL_standard___collection___abstract_collection___MapRead___has_key(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[0]);
407 REGB0 = TAG_Bool(!UNTAG_Bool(REGB0));
408 if (UNTAG_Bool(REGB0)) {
409 goto label9;
410 }
411 /* compiling/icode_generator.nit:83 */
412 fra.me.REG[1] = NEW_FileICodeDumper_compiling___icode_generator___FileICodeDumper___init(closctx->REG[2]);
413 /* compiling/icode_generator.nit:84 */
414 CALL_analysis___icode_dump___ICodeDumper___indent(fra.me.REG[1])(fra.me.REG[1]);
415 /* compiling/icode_generator.nit:85 */
416 REGB0 = TAG_Int(3);
417 fra.me.REG[2] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
418 if (!once_value_10) {
419 fra.me.REG[3] = BOX_NativeString("New instance:: ");
420 REGB0 = TAG_Int(15);
421 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
422 once_value_10 = fra.me.REG[3];
423 register_static_object(&once_value_10);
424 } else fra.me.REG[3] = once_value_10;
425 fra.me.REG[3] = fra.me.REG[3];
426 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
427 fra.me.REG[3] = CALL_metamodel___abstractmetamodel___MMLocalProperty___full_name(fra.me.REG[0])(fra.me.REG[0]);
428 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
429 if (!once_value_11) {
430 fra.me.REG[3] = BOX_NativeString("\n");
431 REGB0 = TAG_Int(1);
432 fra.me.REG[3] = NEW_String_standard___string___String___with_native(fra.me.REG[3], REGB0);
433 once_value_11 = fra.me.REG[3];
434 register_static_object(&once_value_11);
435 } else fra.me.REG[3] = once_value_11;
436 fra.me.REG[3] = fra.me.REG[3];
437 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[3]);
438 fra.me.REG[2] = CALL_standard___string___Object___to_s(fra.me.REG[2])(fra.me.REG[2]);
439 CALL_standard___stream___OStream___write(closctx->REG[2])(closctx->REG[2], fra.me.REG[2]);
440 /* compiling/icode_generator.nit:86 */
441 fra.me.REG[2] = CALL_program___MMLocalClass___new_instance_iroutine(closctx->REG[0])(closctx->REG[0]);
442 fra.me.REG[0] = CALL_standard___collection___abstract_collection___MapRead_____bra(fra.me.REG[2])(fra.me.REG[2], fra.me.REG[0]);
443 REGB0 = TAG_Bool(fra.me.REG[0]==NIT_NULL);
444 if (UNTAG_Bool(REGB0)) {
445 nit_abort("Reciever is null", NULL, LOCATE_compiling___icode_generator, 86);
446 }
447 CALL_analysis___icode_dump___IRoutine___dump(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[1]);
448 /* compiling/icode_generator.nit:87 */
449 if (!once_value_12) {
450 fra.me.REG[1] = BOX_NativeString("\n\n");
451 REGB0 = TAG_Int(2);
452 fra.me.REG[1] = NEW_String_standard___string___String___with_native(fra.me.REG[1], REGB0);
453 once_value_12 = fra.me.REG[1];
454 register_static_object(&once_value_12);
455 } else fra.me.REG[1] = once_value_12;
456 fra.me.REG[1] = fra.me.REG[1];
457 CALL_standard___stream___OStream___write(closctx->REG[2])(closctx->REG[2], fra.me.REG[1]);
458 label9: while(0);
459 stack_frame_head = fra.me.prev;
460 return;
461 }
462 void OC_compiling___icode_generator___MMLocalClass___generate_icode_file_13(struct stack_frame_t *closctx, val_t p0, struct stack_frame_t *closctx_param, fun_t clos_fun0){
463 struct {struct stack_frame_t me; val_t MORE_REG[1];} fra;
464 val_t REGB0;
465 val_t REGB1;
466 fun_t CREG[1];
467 val_t tmp;
468 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
469 fra.me.file = LOCATE_compiling___icode_generator;
470 fra.me.line = 0;
471 fra.me.meth = LOCATE_compiling___icode_generator___MMLocalClass___generate_icode_file;
472 fra.me.has_broke = 0;
473 fra.me.REG_size = 2;
474 fra.me.nitni_local_ref_head = NULL;
475 fra.me.REG[0] = NIT_NULL;
476 fra.me.REG[1] = NIT_NULL;
477 fra.me.closure_ctx = closctx_param;
478 fra.me.closure_funs = CREG;
479 fra.me.REG[0] = p0;
480 CREG[0] = clos_fun0;
481 /* compiling/icode_generator.nit:93 */
482 fra.me.REG[0] = CALL_metamodel___abstractmetamodel___MMLocalClass_____bra(closctx->REG[0])(closctx->REG[0], fra.me.REG[0]);
483 /* compiling/icode_generator.nit:94 */
484 fra.me.REG[1] = CALL_metamodel___abstractmetamodel___MMLocalProperty___local_class(fra.me.REG[0])(fra.me.REG[0]);
485 REGB0 = TAG_Bool(IS_EQUAL_OO(fra.me.REG[1],closctx->REG[0]));
486 if (UNTAG_Bool(REGB0)) {
487 } else {
488 REGB1 = CALL_standard___kernel___Object_____eqeq(fra.me.REG[1])(fra.me.REG[1], closctx->REG[0]);
489 REGB0 = REGB1;
490 }
491 if (UNTAG_Bool(REGB0)) {
492 REGB0 = TAG_Bool(VAL_ISA(fra.me.REG[0], COLOR_metamodel___abstractmetamodel___MMMethod, ID_metamodel___abstractmetamodel___MMMethod)) /*cast MMMethod*/;
493 } else {
494 REGB1 = TAG_Bool(0);
495 REGB0 = REGB1;
496 }
497 if (UNTAG_Bool(REGB0)) {
498 /* compiling/icode_generator.nit:95 */
499 CALL_compiling___icode_generator___MMMethod___generate_icode(fra.me.REG[0])(fra.me.REG[0], closctx->REG[2]);
500 }
501 stack_frame_head = fra.me.prev;
502 return;
503 }
504 static const char LOCATE_compiling___icode_generator___MMMethod___generate_icode[] = "icode_generator::MMMethod::generate_icode";
505 void compiling___icode_generator___MMMethod___generate_icode(val_t p0, val_t p1){
506 struct {struct stack_frame_t me; val_t MORE_REG[4];} fra;
507 val_t REGB0;
508 val_t tmp;
509 static val_t once_value_1; /* Once value */
510 static val_t once_value_2; /* Once value */
511 static val_t once_value_3; /* Once value */
512 fra.me.prev = stack_frame_head; stack_frame_head = &fra.me;
513 fra.me.file = LOCATE_compiling___icode_generator;
514 fra.me.line = 103;
515 fra.me.meth = LOCATE_compiling___icode_generator___MMMethod___generate_icode;
516 fra.me.has_broke = 0;
517 fra.me.REG_size = 5;
518 fra.me.nitni_local_ref_head = NULL;
519 fra.me.REG[0] = NIT_NULL;
520 fra.me.REG[1] = NIT_NULL;
521 fra.me.REG[2] = NIT_NULL;
522 fra.me.REG[3] = NIT_NULL;
523 fra.me.REG[4] = NIT_NULL;
524 fra.me.REG[0] = p0;
525 fra.me.REG[1] = p1;
526 /* compiling/icode_generator.nit:105 */
527 fra.me.REG[2] = NEW_FileICodeDumper_compiling___icode_generator___FileICodeDumper___init(fra.me.REG[1]);
528 /* compiling/icode_generator.nit:106 */
529 CALL_analysis___icode_dump___ICodeDumper___indent(fra.me.REG[2])(fra.me.REG[2]);
530 /* compiling/icode_generator.nit:107 */
531 REGB0 = TAG_Int(3);
532 fra.me.REG[3] = NEW_Array_standard___collection___array___Array___with_capacity(REGB0);
533 if (!once_value_1) {
534 fra.me.REG[4] = BOX_NativeString("Method:: ");
535 REGB0 = TAG_Int(9);
536 fra.me.REG[4] = NEW_String_standard___string___String___with_native(fra.me.REG[4], REGB0);
537 once_value_1 = fra.me.REG[4];
538 register_static_object(&once_value_1);
539 } else fra.me.REG[4] = once_value_1;
540 fra.me.REG[4] = fra.me.REG[4];
541 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]);
542 fra.me.REG[4] = CALL_metamodel___abstractmetamodel___MMLocalProperty___full_name(fra.me.REG[0])(fra.me.REG[0]);
543 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]);
544 if (!once_value_2) {
545 fra.me.REG[4] = BOX_NativeString("\n");
546 REGB0 = TAG_Int(1);
547 fra.me.REG[4] = NEW_String_standard___string___String___with_native(fra.me.REG[4], REGB0);
548 once_value_2 = fra.me.REG[4];
549 register_static_object(&once_value_2);
550 } else fra.me.REG[4] = once_value_2;
551 fra.me.REG[4] = fra.me.REG[4];
552 CALL_standard___collection___abstract_collection___SimpleCollection___add(fra.me.REG[3])(fra.me.REG[3], fra.me.REG[4]);
553 fra.me.REG[3] = CALL_standard___string___Object___to_s(fra.me.REG[3])(fra.me.REG[3]);
554 CALL_standard___stream___OStream___write(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[3]);
555 /* compiling/icode_generator.nit:108 */
556 fra.me.REG[0] = CALL_icode___icode_base___MMMethod___iroutine(fra.me.REG[0])(fra.me.REG[0]);
557 REGB0 = TAG_Bool(fra.me.REG[0]==NIT_NULL);
558 if (UNTAG_Bool(REGB0)) {
559 nit_abort("Reciever is null", NULL, LOCATE_compiling___icode_generator, 108);
560 }
561 CALL_analysis___icode_dump___IRoutine___dump(fra.me.REG[0])(fra.me.REG[0], fra.me.REG[2]);
562 /* compiling/icode_generator.nit:109 */
563 if (!once_value_3) {
564 fra.me.REG[2] = BOX_NativeString("\n\n");
565 REGB0 = TAG_Int(2);
566 fra.me.REG[2] = NEW_String_standard___string___String___with_native(fra.me.REG[2], REGB0);
567 once_value_3 = fra.me.REG[2];
568 register_static_object(&once_value_3);
569 } else fra.me.REG[2] = once_value_3;
570 fra.me.REG[2] = fra.me.REG[2];
571 CALL_standard___stream___OStream___write(fra.me.REG[1])(fra.me.REG[1], fra.me.REG[2]);
572 stack_frame_head = fra.me.prev;
573 return;
574 }