1 #include "hash_collection.sep.0.h"
2 /* method hash_collection#HashCollection#first_item for (self: HashCollection[Object, HashNode[Object]]): nullable HashNode[Object] */
3 val
* hash_collection__HashCollection__first_item(val
* self
) {
4 val
* var
/* : nullable HashNode[Object] */;
5 val
* var1
/* : nullable HashNode[Object] */;
6 var1
= self
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
11 /* method hash_collection#HashCollection#first_item for (self: Object): nullable HashNode[Object] */
12 val
* VIRTUAL_hash_collection__HashCollection__first_item(val
* self
) {
13 val
* var
/* : nullable HashNode[Object] */;
14 val
* var1
/* : nullable HashNode[Object] */;
15 var1
= hash_collection__HashCollection__first_item(self
);
20 /* method hash_collection#HashCollection#index_at for (self: HashCollection[Object, HashNode[Object]], Object): Int */
21 long hash_collection__HashCollection__index_at(val
* self
, val
* p0
) {
23 short int var1
/* : Bool */;
26 const struct type
* type_struct
;
27 const char* var_class_name
;
28 val
* var_k
/* var k: Object */;
29 long var2
/* : Int */;
30 long var3
/* : Int */;
31 long var4
/* : Int */;
32 long var6
/* : Int */;
33 long var_i
/* var i: Int */;
34 long var7
/* : Int */;
35 short int var8
/* : Bool */;
36 short int var10
/* : Bool */;
39 const char* var_class_name13
;
40 short int var14
/* : Bool */;
41 long var15
/* : Int */;
42 long var17
/* : Int */;
43 /* Covariant cast for argument 0 (k) <p0:Object> isa HashCollection#0 */
44 /* <p0:Object> isa HashCollection#0 */
45 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashCollection_FT0
];
46 cltype
= type_struct
->color
;
47 idtype
= type_struct
->id
;
48 if(cltype
>= p0
->type
->table_size
) {
51 var1
= p0
->type
->type_table
[cltype
] == idtype
;
54 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
55 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name
);
56 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 35);
60 var2
= ((long (*)(val
*))(var_k
->class->vft
[COLOR_kernel__Object__hash
]))(var_k
) /* hash on <var_k:Object>*/;
61 var3
= self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
62 { /* Inline kernel#Int#% (var2,var3) */
70 { /* Inline kernel#Int#< (var_i,var7) */
71 /* Covariant cast for argument 0 (i) <var7:Int> isa OTHER */
72 /* <var7:Int> isa OTHER */
73 var10
= 1; /* easy <var7:Int> isa OTHER*/
75 var_class_name13
= type_kernel__Int
.name
;
76 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name13
);
77 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 265);
86 { /* Inline kernel#Int#unary - (var_i) */
100 /* method hash_collection#HashCollection#index_at for (self: Object, Object): Int */
101 long VIRTUAL_hash_collection__HashCollection__index_at(val
* self
, val
* p0
) {
102 long var
/* : Int */;
103 long var1
/* : Int */;
104 var1
= hash_collection__HashCollection__index_at(self
, p0
);
109 /* method hash_collection#HashCollection#node_at for (self: HashCollection[Object, HashNode[Object]], Object): nullable HashNode[Object] */
110 val
* hash_collection__HashCollection__node_at(val
* self
, val
* p0
) {
111 val
* var
/* : nullable HashNode[Object] */;
112 short int var1
/* : Bool */;
115 const struct type
* type_struct
;
116 const char* var_class_name
;
117 val
* var_k
/* var k: Object */;
118 val
* var2
/* : nullable Object */;
119 short int var3
/* : Bool */;
120 val
* var4
/* : nullable HashNode[Object] */;
121 long var5
/* : Int */;
122 val
* var6
/* : nullable HashNode[Object] */;
123 val
* var_res
/* var res: nullable HashNode[Object] */;
124 /* Covariant cast for argument 0 (k) <p0:Object> isa HashCollection#0 */
125 /* <p0:Object> isa HashCollection#0 */
126 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashCollection_FT0
];
127 cltype
= type_struct
->color
;
128 idtype
= type_struct
->id
;
129 if(cltype
>= p0
->type
->table_size
) {
132 var1
= p0
->type
->type_table
[cltype
] == idtype
;
135 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
136 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name
);
137 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 43);
141 var2
= self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_key
].val
; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
142 var3
= ((short int (*)(val
*, val
*))(var_k
->class->vft
[COLOR_kernel__Object__is_same_instance
]))(var_k
, var2
) /* is_same_instance on <var_k:Object>*/;
144 var4
= self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_node
].val
; /* _last_accessed_node on <self:HashCollection[Object, HashNode[Object]]> */
149 var5
= ((long (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__index_at
]))(self
, var_k
) /* index_at on <self:HashCollection[Object, HashNode[Object]]>*/;
150 var6
= ((val
* (*)(val
*, long, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__node_at_idx
]))(self
, var5
, var_k
) /* node_at_idx on <self:HashCollection[Object, HashNode[Object]]>*/;
152 self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_key
].val
= var_k
; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
153 self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_node
].val
= var_res
; /* _last_accessed_node on <self:HashCollection[Object, HashNode[Object]]> */
159 /* method hash_collection#HashCollection#node_at for (self: Object, Object): nullable HashNode[Object] */
160 val
* VIRTUAL_hash_collection__HashCollection__node_at(val
* self
, val
* p0
) {
161 val
* var
/* : nullable HashNode[Object] */;
162 val
* var1
/* : nullable HashNode[Object] */;
163 var1
= hash_collection__HashCollection__node_at(self
, p0
);
168 /* method hash_collection#HashCollection#node_at_idx for (self: HashCollection[Object, HashNode[Object]], Int, Object): nullable HashNode[Object] */
169 val
* hash_collection__HashCollection__node_at_idx(val
* self
, long p0
, val
* p1
) {
170 val
* var
/* : nullable HashNode[Object] */;
171 short int var1
/* : Bool */;
174 const struct type
* type_struct
;
175 const char* var_class_name
;
176 long var_i
/* var i: Int */;
177 val
* var_k
/* var k: Object */;
178 val
* var2
/* : nullable NativeArray[nullable HashNode[Object]] */;
179 val
* var3
/* : nullable Object */;
180 val
* var_c
/* var c: nullable HashNode[Object] */;
181 val
* var4
/* : null */;
182 short int var5
/* : Bool */;
183 val
* var6
/* : Object */;
184 val
* var_ck
/* var ck: Object */;
185 short int var7
/* : Bool */;
186 short int var8
/* : Bool */;
187 short int var_
/* var : Bool */;
188 short int var9
/* : Bool */;
189 val
* var10
/* : nullable HashNode[Object] */;
190 short int var11
/* : Bool */;
193 const struct type
* type_struct14
;
194 const char* var_class_name15
;
195 /* Covariant cast for argument 1 (k) <p1:Object> isa HashCollection#0 */
196 /* <p1:Object> isa HashCollection#0 */
197 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashCollection_FT0
];
198 cltype
= type_struct
->color
;
199 idtype
= type_struct
->id
;
200 if(cltype
>= p1
->type
->table_size
) {
203 var1
= p1
->type
->type_table
[cltype
] == idtype
;
206 var_class_name
= p1
== NULL ?
"null" : p1
->type
->name
;
207 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name
);
208 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 55);
213 var2
= self
->attrs
[COLOR_hash_collection__HashCollection___array
].val
; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
215 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
216 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 58);
219 var3
= ((val
* (*)(val
*, long))(var2
->class->vft
[COLOR_array__NativeArray___91d_93d
]))(var2
, var_i
) /* [] on <var2:nullable NativeArray[nullable HashNode[Object]]>*/;
225 var5
= 0; /* is null */
227 var5
= 1; /* arg is null and recv is not */
230 var6
= var_c
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var_c:nullable HashNode[Object](HashNode[Object])> */
232 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
233 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 60);
237 var8
= ((short int (*)(val
*, val
*))(var_ck
->class->vft
[COLOR_kernel__Object__is_same_instance
]))(var_ck
, var_k
) /* is_same_instance on <var_ck:Object>*/;
242 var9
= ((short int (*)(val
*, val
*))(var_ck
->class->vft
[COLOR_kernel__Object___61d_61d
]))(var_ck
, var_k
) /* == on <var_ck:Object>*/;
249 var10
= var_c
->attrs
[COLOR_hash_collection__HashNode___next_in_bucklet
].val
; /* _next_in_bucklet on <var_c:nullable HashNode[Object](HashNode[Object])> */
250 /* <var10:nullable HashNode[Object]> isa nullable HashCollection#1 */
251 type_struct14
= self
->type
->resolution_table
->types
[COLOR_nullable_hash_collection__HashCollection_FT1
];
252 cltype12
= type_struct14
->color
;
253 idtype13
= type_struct14
->id
;
257 if(cltype12
>= var10
->type
->table_size
) {
260 var11
= var10
->type
->type_table
[cltype12
] == idtype13
;
264 var_class_name15
= var10
== NULL ?
"null" : var10
->type
->name
;
265 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name15
);
266 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 64);
270 CONTINUE_label
: (void)0;
272 BREAK_label
: (void)0;
278 /* method hash_collection#HashCollection#node_at_idx for (self: Object, Int, Object): nullable HashNode[Object] */
279 val
* VIRTUAL_hash_collection__HashCollection__node_at_idx(val
* self
, long p0
, val
* p1
) {
280 val
* var
/* : nullable HashNode[Object] */;
281 val
* var1
/* : nullable HashNode[Object] */;
282 var1
= hash_collection__HashCollection__node_at_idx(self
, p0
, p1
);
287 /* method hash_collection#HashCollection#store for (self: HashCollection[Object, HashNode[Object]], Int, HashNode[Object]) */
288 void hash_collection__HashCollection__store(val
* self
, long p0
, val
* p1
) {
289 short int var
/* : Bool */;
292 const struct type
* type_struct
;
293 const char* var_class_name
;
294 long var_index
/* var index: Int */;
295 val
* var_node
/* var node: HashNode[Object] */;
296 val
* var1
/* : nullable HashNode[Object] */;
297 val
* var2
/* : null */;
298 short int var3
/* : Bool */;
299 val
* var4
/* : nullable HashNode[Object] */;
300 val
* var5
/* : nullable HashNode[Object] */;
301 val
* var6
/* : null */;
302 val
* var7
/* : nullable NativeArray[nullable HashNode[Object]] */;
303 val
* var8
/* : nullable Object */;
304 val
* var_next
/* var next: nullable HashNode[Object] */;
305 val
* var9
/* : nullable NativeArray[nullable HashNode[Object]] */;
306 val
* var10
/* : null */;
307 short int var11
/* : Bool */;
308 val
* var12
/* : Object */;
309 short int var13
/* : Bool */;
312 const struct type
* type_struct16
;
313 const char* var_class_name17
;
314 long var18
/* : Int */;
315 long var_l
/* var l: Int */;
316 long var19
/* : Int */;
317 long var20
/* : Int */;
318 long var22
/* : Int */;
319 long var23
/* : Int */;
320 long var24
/* : Int */;
321 long var26
/* : Int */;
322 long var27
/* : Int */;
323 long var28
/* : Int */;
324 long var30
/* : Int */;
325 long var31
/* : Int */;
326 long var32
/* : Int */;
327 long var34
/* : Int */;
328 long var35
/* : Int */;
329 short int var36
/* : Bool */;
330 short int var38
/* : Bool */;
333 const char* var_class_name41
;
334 short int var42
/* : Bool */;
335 long var43
/* : Int */;
336 long var44
/* : Int */;
337 long var46
/* : Int */;
338 /* Covariant cast for argument 1 (node) <p1:HashNode[Object]> isa HashCollection#1 */
339 /* <p1:HashNode[Object]> isa HashCollection#1 */
340 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashCollection_FT1
];
341 cltype
= type_struct
->color
;
342 idtype
= type_struct
->id
;
343 if(cltype
>= p1
->type
->table_size
) {
346 var
= p1
->type
->type_table
[cltype
] == idtype
;
349 var_class_name
= p1
== NULL ?
"null" : p1
->type
->name
;
350 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#1", var_class_name
);
351 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 69);
356 var1
= self
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
359 var3
= 1; /* is null */
361 var3
= 0; /* arg is null but recv is not */
364 self
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
= var_node
; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
366 var4
= self
->attrs
[COLOR_hash_collection__HashCollection___last_item
].val
; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
368 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
369 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 76);
372 var4
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
= var_node
; /* _next_item on <var4:nullable HashNode[Object]> */
374 var5
= self
->attrs
[COLOR_hash_collection__HashCollection___last_item
].val
; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
375 var_node
->attrs
[COLOR_hash_collection__HashNode___prev_item
].val
= var5
; /* _prev_item on <var_node:HashNode[Object]> */
377 var_node
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
= var6
; /* _next_item on <var_node:HashNode[Object]> */
378 self
->attrs
[COLOR_hash_collection__HashCollection___last_item
].val
= var_node
; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
379 var7
= self
->attrs
[COLOR_hash_collection__HashCollection___array
].val
; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
381 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
382 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 83);
385 var8
= ((val
* (*)(val
*, long))(var7
->class->vft
[COLOR_array__NativeArray___91d_93d
]))(var7
, var_index
) /* [] on <var7:nullable NativeArray[nullable HashNode[Object]]>*/;
388 var9
= self
->attrs
[COLOR_hash_collection__HashCollection___array
].val
; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
390 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
391 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 84);
394 ((void (*)(val
*, long, val
*))(var9
->class->vft
[COLOR_array__NativeArray___91d_93d_61d
]))(var9
, var_index
, var_node
) /* []= on <var9:nullable NativeArray[nullable HashNode[Object]]>*/;
396 var_node
->attrs
[COLOR_hash_collection__HashNode___next_in_bucklet
].val
= var_next
; /* _next_in_bucklet on <var_node:HashNode[Object]> */
398 if (var_next
== NULL
) {
399 var11
= 0; /* is null */
401 var11
= 1; /* arg is null and recv is not */
404 var_next
->attrs
[COLOR_hash_collection__HashNode___prev_in_bucklet
].val
= var_node
; /* _prev_in_bucklet on <var_next:nullable HashNode[Object](HashNode[Object])> */
407 var12
= var_node
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var_node:HashNode[Object]> */
409 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
410 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 88);
413 /* <var12:Object> isa nullable HashCollection#0 */
414 type_struct16
= self
->type
->resolution_table
->types
[COLOR_nullable_hash_collection__HashCollection_FT0
];
415 cltype14
= type_struct16
->color
;
416 idtype15
= type_struct16
->id
;
417 if(cltype14
>= var12
->type
->table_size
) {
420 var13
= var12
->type
->type_table
[cltype14
] == idtype15
;
423 var_class_name17
= var12
== NULL ?
"null" : var12
->type
->name
;
424 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#0", var_class_name17
);
425 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 88);
428 self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_key
].val
= var12
; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
429 self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_node
].val
= var_node
; /* _last_accessed_node on <self:HashCollection[Object, HashNode[Object]]> */
430 var18
= self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
433 { /* Inline kernel#Int#+ (var_l,var19) */
434 var22
= var_l
+ var19
;
439 self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
= var20
; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
441 { /* Inline kernel#Int#+ (var_l,var23) */
442 var26
= var_l
+ var23
;
448 { /* Inline kernel#Int#* (var24,var27) */
449 var30
= var24
* var27
;
455 { /* Inline kernel#Int#/ (var28,var31) */
456 var34
= var28
/ var31
;
462 var35
= self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
463 { /* Inline kernel#Int#>= (var_l,var35) */
464 /* Covariant cast for argument 0 (i) <var35:Int> isa OTHER */
465 /* <var35:Int> isa OTHER */
466 var38
= 1; /* easy <var35:Int> isa OTHER*/
468 var_class_name41
= type_kernel__Int
.name
;
469 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name41
);
470 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 266);
473 var42
= var_l
>= var35
;
480 { /* Inline kernel#Int#* (var_l,var43) */
481 var46
= var_l
* var43
;
486 ((void (*)(val
*, long))(self
->class->vft
[COLOR_hash_collection__HashCollection__enlarge
]))(self
, var44
) /* enlarge on <self:HashCollection[Object, HashNode[Object]]>*/;
491 /* method hash_collection#HashCollection#store for (self: Object, Int, HashNode[Object]) */
492 void VIRTUAL_hash_collection__HashCollection__store(val
* self
, long p0
, val
* p1
) {
493 hash_collection__HashCollection__store(self
, p0
, p1
);
496 /* method hash_collection#HashCollection#remove_node for (self: HashCollection[Object, HashNode[Object]], Object) */
497 void hash_collection__HashCollection__remove_node(val
* self
, val
* p0
) {
498 short int var
/* : Bool */;
501 const struct type
* type_struct
;
502 const char* var_class_name
;
503 val
* var_k
/* var k: Object */;
504 long var1
/* : Int */;
505 long var_i
/* var i: Int */;
506 val
* var2
/* : nullable HashNode[Object] */;
507 val
* var_node
/* var node: nullable HashNode[Object] */;
508 val
* var3
/* : null */;
509 short int var4
/* : Bool */;
510 val
* var5
/* : nullable HashNode[Object] */;
511 val
* var_prev
/* var prev: nullable HashNode[Object] */;
512 val
* var6
/* : nullable HashNode[Object] */;
513 val
* var_next
/* var next: nullable HashNode[Object] */;
514 val
* var7
/* : null */;
515 short int var8
/* : Bool */;
516 short int var9
/* : Bool */;
519 const struct type
* type_struct12
;
520 const char* var_class_name13
;
521 val
* var14
/* : null */;
522 short int var15
/* : Bool */;
523 short int var16
/* : Bool */;
526 const struct type
* type_struct19
;
527 const char* var_class_name20
;
528 val
* var_
/* var : HashCollection[Object, HashNode[Object]] */;
529 long var21
/* : Int */;
530 long var22
/* : Int */;
531 long var23
/* : Int */;
532 long var25
/* : Int */;
533 val
* var26
/* : nullable HashNode[Object] */;
534 val
* var27
/* : nullable HashNode[Object] */;
535 val
* var28
/* : null */;
536 short int var29
/* : Bool */;
537 val
* var30
/* : nullable NativeArray[nullable HashNode[Object]] */;
538 short int var31
/* : Bool */;
541 const struct type
* type_struct34
;
542 const char* var_class_name35
;
543 val
* var36
/* : null */;
544 short int var37
/* : Bool */;
545 val
* var38
/* : null */;
546 /* Covariant cast for argument 0 (k) <p0:Object> isa HashCollection#0 */
547 /* <p0:Object> isa HashCollection#0 */
548 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashCollection_FT0
];
549 cltype
= type_struct
->color
;
550 idtype
= type_struct
->id
;
551 if(cltype
>= p0
->type
->table_size
) {
554 var
= p0
->type
->type_table
[cltype
] == idtype
;
557 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
558 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name
);
559 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 100);
563 var1
= ((long (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__index_at
]))(self
, var_k
) /* index_at on <self:HashCollection[Object, HashNode[Object]]>*/;
565 var2
= ((val
* (*)(val
*, long, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__node_at_idx
]))(self
, var_i
, var_k
) /* node_at_idx on <self:HashCollection[Object, HashNode[Object]]>*/;
568 if (var_node
== NULL
) {
569 var4
= 1; /* is null */
571 var4
= 0; /* arg is null but recv is not */
577 var5
= var_node
->attrs
[COLOR_hash_collection__HashNode___prev_item
].val
; /* _prev_item on <var_node:nullable HashNode[Object](HashNode[Object])> */
579 var6
= var_node
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var_node:nullable HashNode[Object](HashNode[Object])> */
582 if (var_prev
== NULL
) {
583 var8
= 0; /* is null */
585 var8
= 1; /* arg is null and recv is not */
588 var_prev
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
= var_next
; /* _next_item on <var_prev:nullable HashNode[Object](HashNode[Object])> */
590 /* <var_next:nullable HashNode[Object]> isa nullable HashCollection#1 */
591 type_struct12
= self
->type
->resolution_table
->types
[COLOR_nullable_hash_collection__HashCollection_FT1
];
592 cltype10
= type_struct12
->color
;
593 idtype11
= type_struct12
->id
;
594 if(var_next
== NULL
) {
597 if(cltype10
>= var_next
->type
->table_size
) {
600 var9
= var_next
->type
->type_table
[cltype10
] == idtype11
;
604 var_class_name13
= var_next
== NULL ?
"null" : var_next
->type
->name
;
605 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name13
);
606 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 113);
609 self
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
= var_next
; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
612 if (var_next
== NULL
) {
613 var15
= 0; /* is null */
615 var15
= 1; /* arg is null and recv is not */
618 var_next
->attrs
[COLOR_hash_collection__HashNode___prev_item
].val
= var_prev
; /* _prev_item on <var_next:nullable HashNode[Object](HashNode[Object])> */
620 /* <var_prev:nullable HashNode[Object]> isa nullable HashCollection#1 */
621 type_struct19
= self
->type
->resolution_table
->types
[COLOR_nullable_hash_collection__HashCollection_FT1
];
622 cltype17
= type_struct19
->color
;
623 idtype18
= type_struct19
->id
;
624 if(var_prev
== NULL
) {
627 if(cltype17
>= var_prev
->type
->table_size
) {
630 var16
= var_prev
->type
->type_table
[cltype17
] == idtype18
;
634 var_class_name20
= var_prev
== NULL ?
"null" : var_prev
->type
->name
;
635 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name20
);
636 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 118);
639 self
->attrs
[COLOR_hash_collection__HashCollection___last_item
].val
= var_prev
; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
642 var21
= var_
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <var_:HashCollection[Object, HashNode[Object]]> */
644 { /* Inline kernel#Int#- (var21,var22) */
645 var25
= var21
- var22
;
650 var_
->attrs
[COLOR_hash_collection__HashCollection___length
].l
= var23
; /* _length on <var_:HashCollection[Object, HashNode[Object]]> */
651 var26
= var_node
->attrs
[COLOR_hash_collection__HashNode___prev_in_bucklet
].val
; /* _prev_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
653 var27
= var_node
->attrs
[COLOR_hash_collection__HashNode___next_in_bucklet
].val
; /* _next_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
656 if (var_prev
== NULL
) {
657 var29
= 0; /* is null */
659 var29
= 1; /* arg is null and recv is not */
662 var_prev
->attrs
[COLOR_hash_collection__HashNode___next_in_bucklet
].val
= var_next
; /* _next_in_bucklet on <var_prev:nullable HashNode[Object](HashNode[Object])> */
664 var30
= self
->attrs
[COLOR_hash_collection__HashCollection___array
].val
; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
665 /* <var_next:nullable HashNode[Object]> isa nullable HashCollection#1 */
666 type_struct34
= self
->type
->resolution_table
->types
[COLOR_nullable_hash_collection__HashCollection_FT1
];
667 cltype32
= type_struct34
->color
;
668 idtype33
= type_struct34
->id
;
669 if(var_next
== NULL
) {
672 if(cltype32
>= var_next
->type
->table_size
) {
675 var31
= var_next
->type
->type_table
[cltype32
] == idtype33
;
679 var_class_name35
= var_next
== NULL ?
"null" : var_next
->type
->name
;
680 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name35
);
681 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 128);
685 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
686 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 128);
689 ((void (*)(val
*, long, val
*))(var30
->class->vft
[COLOR_array__NativeArray___91d_93d_61d
]))(var30
, var_i
, var_next
) /* []= on <var30:nullable NativeArray[nullable HashNode[Object]]>*/;
693 if (var_next
== NULL
) {
694 var37
= 0; /* is null */
696 var37
= 1; /* arg is null and recv is not */
699 var_next
->attrs
[COLOR_hash_collection__HashNode___prev_in_bucklet
].val
= var_prev
; /* _prev_in_bucklet on <var_next:nullable HashNode[Object](HashNode[Object])> */
703 self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_key
].val
= var38
; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
706 /* method hash_collection#HashCollection#remove_node for (self: Object, Object) */
707 void VIRTUAL_hash_collection__HashCollection__remove_node(val
* self
, val
* p0
) {
708 hash_collection__HashCollection__remove_node(self
, p0
);
711 /* method hash_collection#HashCollection#raz for (self: HashCollection[Object, HashNode[Object]]) */
712 void hash_collection__HashCollection__raz(val
* self
) {
713 long var
/* : Int */;
714 long var1
/* : Int */;
715 long var2
/* : Int */;
716 long var4
/* : Int */;
717 long var_i
/* var i: Int */;
718 long var5
/* : Int */;
719 short int var6
/* : Bool */;
720 short int var8
/* : Bool */;
723 const char* var_class_name
;
724 short int var9
/* : Bool */;
725 val
* var10
/* : nullable NativeArray[nullable HashNode[Object]] */;
726 val
* var11
/* : null */;
727 long var12
/* : Int */;
728 long var13
/* : Int */;
729 long var15
/* : Int */;
730 long var16
/* : Int */;
731 val
* var17
/* : null */;
732 val
* var18
/* : null */;
733 val
* var19
/* : null */;
734 var
= self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
736 { /* Inline kernel#Int#- (var,var1) */
745 { /* Inline kernel#Int#>= (var_i,var5) */
746 /* Covariant cast for argument 0 (i) <var5:Int> isa OTHER */
747 /* <var5:Int> isa OTHER */
748 var8
= 1; /* easy <var5:Int> isa OTHER*/
750 var_class_name
= type_kernel__Int
.name
;
751 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name
);
752 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 266);
755 var9
= var_i
>= var5
;
761 var10
= self
->attrs
[COLOR_hash_collection__HashCollection___array
].val
; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
764 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
765 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 142);
768 ((void (*)(val
*, long, val
*))(var10
->class->vft
[COLOR_array__NativeArray___91d_93d_61d
]))(var10
, var_i
, var11
) /* []= on <var10:nullable NativeArray[nullable HashNode[Object]]>*/;
771 { /* Inline kernel#Int#- (var_i,var12) */
772 var15
= var_i
- var12
;
778 CONTINUE_label
: (void)0;
780 BREAK_label
: (void)0;
782 self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
= var16
; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
784 self
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
= var17
; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
786 self
->attrs
[COLOR_hash_collection__HashCollection___last_item
].val
= var18
; /* _last_item on <self:HashCollection[Object, HashNode[Object]]> */
788 self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_key
].val
= var19
; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
791 /* method hash_collection#HashCollection#raz for (self: Object) */
792 void VIRTUAL_hash_collection__HashCollection__raz(val
* self
) {
793 hash_collection__HashCollection__raz(self
);
796 /* method hash_collection#HashCollection#enlarge for (self: HashCollection[Object, HashNode[Object]], Int) */
797 void hash_collection__HashCollection__enlarge(val
* self
, long p0
) {
798 long var_cap
/* var cap: Int */;
799 long var
/* : Int */;
800 long var_old_cap
/* var old_cap: Int */;
801 long var1
/* : Int */;
802 long var2
/* : Int */;
803 long var3
/* : Int */;
804 long var5
/* : Int */;
805 short int var6
/* : Bool */;
806 short int var8
/* : Bool */;
809 const char* var_class_name
;
810 short int var9
/* : Bool */;
811 long var10
/* : Int */;
812 long var11
/* : Int */;
813 long var12
/* : Int */;
814 long var14
/* : Int */;
815 long var15
/* : Int */;
816 short int var16
/* : Bool */;
817 short int var18
/* : Bool */;
820 const char* var_class_name21
;
821 short int var22
/* : Bool */;
822 val
* var23
/* : null */;
823 val
* var24
/* : NativeArray[nullable Object] */;
824 val
* var_new_array
/* var new_array: NativeArray[nullable HashNode[Object]] */;
825 long var25
/* : Int */;
826 long var26
/* : Int */;
827 long var28
/* : Int */;
828 long var_i
/* var i: Int */;
829 long var29
/* : Int */;
830 short int var30
/* : Bool */;
831 short int var32
/* : Bool */;
834 const char* var_class_name35
;
835 short int var36
/* : Bool */;
836 val
* var37
/* : null */;
837 long var38
/* : Int */;
838 long var39
/* : Int */;
839 long var41
/* : Int */;
840 long var42
/* : Int */;
841 short int var43
/* : Bool */;
842 short int var45
/* : Bool */;
845 const char* var_class_name48
;
846 short int var49
/* : Bool */;
847 val
* var50
/* : nullable HashNode[Object] */;
848 val
* var_node
/* var node: nullable HashNode[Object] */;
849 val
* var51
/* : null */;
850 short int var52
/* : Bool */;
851 val
* var53
/* : Object */;
852 short int var54
/* : Bool */;
855 const struct type
* type_struct
;
856 const char* var_class_name57
;
857 long var58
/* : Int */;
858 long var_index
/* var index: Int */;
859 val
* var59
/* : nullable Object */;
860 val
* var_next
/* var next: nullable HashNode[Object] */;
861 val
* var60
/* : null */;
862 val
* var61
/* : null */;
863 short int var62
/* : Bool */;
864 val
* var63
/* : nullable HashNode[Object] */;
865 short int var64
/* : Bool */;
868 const struct type
* type_struct67
;
869 const char* var_class_name68
;
871 var
= self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
873 var1
= self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
875 { /* Inline kernel#Int#+ (var1,var2) */
881 { /* Inline kernel#Int#< (var_cap,var3) */
882 /* Covariant cast for argument 0 (i) <var3:Int> isa OTHER */
883 /* <var3:Int> isa OTHER */
884 var8
= 1; /* easy <var3:Int> isa OTHER*/
886 var_class_name
= type_kernel__Int
.name
;
887 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name
);
888 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 265);
891 var9
= var_cap
< var3
;
897 var10
= self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <self:HashCollection[Object, HashNode[Object]]> */
899 { /* Inline kernel#Int#+ (var10,var11) */
900 var14
= var10
+ var11
;
908 var15
= self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
909 { /* Inline kernel#Int#<= (var_cap,var15) */
910 /* Covariant cast for argument 0 (i) <var15:Int> isa OTHER */
911 /* <var15:Int> isa OTHER */
912 var18
= 1; /* easy <var15:Int> isa OTHER*/
914 var_class_name21
= type_kernel__Int
.name
;
915 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name21
);
916 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 264);
919 var22
= var_cap
<= var15
;
928 self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
= var_cap
; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
930 self
->attrs
[COLOR_hash_collection__HashCollection___last_accessed_key
].val
= var23
; /* _last_accessed_key on <self:HashCollection[Object, HashNode[Object]]> */
931 var24
= ((val
* (*)(val
*, long))(self
->class->vft
[COLOR_array__ArrayCapable__calloc_array
]))(self
, var_cap
) /* calloc_array on <self:HashCollection[Object, HashNode[Object]]>*/;
932 var_new_array
= var24
;
933 self
->attrs
[COLOR_hash_collection__HashCollection___array
].val
= var_new_array
; /* _array on <self:HashCollection[Object, HashNode[Object]]> */
935 { /* Inline kernel#Int#- (var_cap,var25) */
936 var28
= var_cap
- var25
;
944 { /* Inline kernel#Int#>= (var_i,var29) */
945 /* Covariant cast for argument 0 (i) <var29:Int> isa OTHER */
946 /* <var29:Int> isa OTHER */
947 var32
= 1; /* easy <var29:Int> isa OTHER*/
949 var_class_name35
= type_kernel__Int
.name
;
950 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name35
);
951 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 266);
954 var36
= var_i
>= var29
;
961 ((void (*)(val
*, long, val
*))(var_new_array
->class->vft
[COLOR_array__NativeArray___91d_93d_61d
]))(var_new_array
, var_i
, var37
) /* []= on <var_new_array:NativeArray[nullable HashNode[Object]]>*/;
963 { /* Inline kernel#Int#- (var_i,var38) */
964 var41
= var_i
- var38
;
970 CONTINUE_label
: (void)0;
972 BREAK_label
: (void)0;
973 var42
= self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
; /* _capacity on <self:HashCollection[Object, HashNode[Object]]> */
974 { /* Inline kernel#Int#<= (var42,var_old_cap) */
975 /* Covariant cast for argument 0 (i) <var_old_cap:Int> isa OTHER */
976 /* <var_old_cap:Int> isa OTHER */
977 var45
= 1; /* easy <var_old_cap:Int> isa OTHER*/
979 var_class_name48
= type_kernel__Int
.name
;
980 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name48
);
981 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 264);
984 var49
= var42
<= var_old_cap
;
993 var50
= self
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <self:HashCollection[Object, HashNode[Object]]> */
997 if (var_node
== NULL
) {
998 var52
= 0; /* is null */
1000 var52
= 1; /* arg is null and recv is not */
1003 var53
= var_node
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var_node:nullable HashNode[Object](HashNode[Object])> */
1004 if (var53
== NULL
) {
1005 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
1006 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 177);
1009 /* <var53:Object> isa HashCollection#0 */
1010 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashCollection_FT0
];
1011 cltype55
= type_struct
->color
;
1012 idtype56
= type_struct
->id
;
1013 if(cltype55
>= var53
->type
->table_size
) {
1016 var54
= var53
->type
->type_table
[cltype55
] == idtype56
;
1019 var_class_name57
= var53
== NULL ?
"null" : var53
->type
->name
;
1020 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashCollection#0", var_class_name57
);
1021 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 177);
1024 var58
= ((long (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__index_at
]))(self
, var53
) /* index_at on <self:HashCollection[Object, HashNode[Object]]>*/;
1026 var59
= ((val
* (*)(val
*, long))(var_new_array
->class->vft
[COLOR_array__NativeArray___91d_93d
]))(var_new_array
, var_index
) /* [] on <var_new_array:NativeArray[nullable HashNode[Object]]>*/;
1028 ((void (*)(val
*, long, val
*))(var_new_array
->class->vft
[COLOR_array__NativeArray___91d_93d_61d
]))(var_new_array
, var_index
, var_node
) /* []= on <var_new_array:NativeArray[nullable HashNode[Object]]>*/;
1030 var_node
->attrs
[COLOR_hash_collection__HashNode___prev_in_bucklet
].val
= var60
; /* _prev_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
1031 var_node
->attrs
[COLOR_hash_collection__HashNode___next_in_bucklet
].val
= var_next
; /* _next_in_bucklet on <var_node:nullable HashNode[Object](HashNode[Object])> */
1033 if (var_next
== NULL
) {
1034 var62
= 0; /* is null */
1036 var62
= 1; /* arg is null and recv is not */
1039 var_next
->attrs
[COLOR_hash_collection__HashNode___prev_in_bucklet
].val
= var_node
; /* _prev_in_bucklet on <var_next:nullable HashNode[Object](HashNode[Object])> */
1042 var63
= var_node
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var_node:nullable HashNode[Object](HashNode[Object])> */
1043 /* <var63:nullable HashNode[Object]> isa nullable HashCollection#1 */
1044 type_struct67
= self
->type
->resolution_table
->types
[COLOR_nullable_hash_collection__HashCollection_FT1
];
1045 cltype65
= type_struct67
->color
;
1046 idtype66
= type_struct67
->id
;
1050 if(cltype65
>= var63
->type
->table_size
) {
1053 var64
= var63
->type
->type_table
[cltype65
] == idtype66
;
1057 var_class_name68
= var63
== NULL ?
"null" : var63
->type
->name
;
1058 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable HashCollection#1", var_class_name68
);
1059 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 184);
1063 CONTINUE_label69
: (void)0;
1065 BREAK_label69
: (void)0;
1068 /* method hash_collection#HashCollection#enlarge for (self: Object, Int) */
1069 void VIRTUAL_hash_collection__HashCollection__enlarge(val
* self
, long p0
) {
1070 hash_collection__HashCollection__enlarge(self
, p0
);
1073 /* method hash_collection#HashCollection#init for (self: HashCollection[Object, HashNode[Object]]) */
1074 void hash_collection__HashCollection__init(val
* self
) {
1077 /* method hash_collection#HashCollection#init for (self: Object) */
1078 void VIRTUAL_hash_collection__HashCollection__init(val
* self
) {
1079 hash_collection__HashCollection__init(self
);
1082 /* method hash_collection#HashNode#next_item for (self: HashNode[Object]): nullable HashNode[Object] */
1083 val
* hash_collection__HashNode__next_item(val
* self
) {
1084 val
* var
/* : nullable HashNode[Object] */;
1085 val
* var1
/* : nullable HashNode[Object] */;
1086 var1
= self
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <self:HashNode[Object]> */
1091 /* method hash_collection#HashNode#next_item for (self: Object): nullable HashNode[Object] */
1092 val
* VIRTUAL_hash_collection__HashNode__next_item(val
* self
) {
1093 val
* var
/* : nullable HashNode[Object] */;
1094 val
* var1
/* : nullable HashNode[Object] */;
1095 var1
= hash_collection__HashNode__next_item(self
);
1100 /* method hash_collection#HashNode#next_item= for (self: HashNode[Object], nullable HashNode[Object]) */
1101 void hash_collection__HashNode__next_item_61d(val
* self
, val
* p0
) {
1102 short int var
/* : Bool */;
1105 const struct type
* type_struct
;
1106 const char* var_class_name
;
1107 /* Covariant cast for argument 0 (next_item) <p0:nullable HashNode[Object]> isa nullable N */
1108 /* <p0:nullable HashNode[Object]> isa nullable N */
1109 type_struct
= self
->type
->resolution_table
->types
[COLOR_nullable_hash_collection__HashNode_VTN
];
1110 cltype
= type_struct
->color
;
1111 idtype
= type_struct
->id
;
1115 if(cltype
>= p0
->type
->table_size
) {
1118 var
= p0
->type
->type_table
[cltype
] == idtype
;
1122 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1123 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name
);
1124 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 192);
1127 self
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
= p0
; /* _next_item on <self:HashNode[Object]> */
1130 /* method hash_collection#HashNode#next_item= for (self: Object, nullable HashNode[Object]) */
1131 void VIRTUAL_hash_collection__HashNode__next_item_61d(val
* self
, val
* p0
) {
1132 hash_collection__HashNode__next_item_61d(self
, p0
);
1135 /* method hash_collection#HashNode#prev_item for (self: HashNode[Object]): nullable HashNode[Object] */
1136 val
* hash_collection__HashNode__prev_item(val
* self
) {
1137 val
* var
/* : nullable HashNode[Object] */;
1138 val
* var1
/* : nullable HashNode[Object] */;
1139 var1
= self
->attrs
[COLOR_hash_collection__HashNode___prev_item
].val
; /* _prev_item on <self:HashNode[Object]> */
1144 /* method hash_collection#HashNode#prev_item for (self: Object): nullable HashNode[Object] */
1145 val
* VIRTUAL_hash_collection__HashNode__prev_item(val
* self
) {
1146 val
* var
/* : nullable HashNode[Object] */;
1147 val
* var1
/* : nullable HashNode[Object] */;
1148 var1
= hash_collection__HashNode__prev_item(self
);
1153 /* method hash_collection#HashNode#prev_item= for (self: HashNode[Object], nullable HashNode[Object]) */
1154 void hash_collection__HashNode__prev_item_61d(val
* self
, val
* p0
) {
1155 short int var
/* : Bool */;
1158 const struct type
* type_struct
;
1159 const char* var_class_name
;
1160 /* Covariant cast for argument 0 (prev_item) <p0:nullable HashNode[Object]> isa nullable N */
1161 /* <p0:nullable HashNode[Object]> isa nullable N */
1162 type_struct
= self
->type
->resolution_table
->types
[COLOR_nullable_hash_collection__HashNode_VTN
];
1163 cltype
= type_struct
->color
;
1164 idtype
= type_struct
->id
;
1168 if(cltype
>= p0
->type
->table_size
) {
1171 var
= p0
->type
->type_table
[cltype
] == idtype
;
1175 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1176 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "nullable N", var_class_name
);
1177 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 193);
1180 self
->attrs
[COLOR_hash_collection__HashNode___prev_item
].val
= p0
; /* _prev_item on <self:HashNode[Object]> */
1183 /* method hash_collection#HashNode#prev_item= for (self: Object, nullable HashNode[Object]) */
1184 void VIRTUAL_hash_collection__HashNode__prev_item_61d(val
* self
, val
* p0
) {
1185 hash_collection__HashNode__prev_item_61d(self
, p0
);
1188 /* method hash_collection#HashNode#init for (self: HashNode[Object], Object) */
1189 void hash_collection__HashNode__init(val
* self
, val
* p0
) {
1190 short int var
/* : Bool */;
1193 const struct type
* type_struct
;
1194 const char* var_class_name
;
1195 val
* var_k
/* var k: Object */;
1196 /* Covariant cast for argument 0 (k) <p0:Object> isa HashNode#0 */
1197 /* <p0:Object> isa HashNode#0 */
1198 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashNode_FT0
];
1199 cltype
= type_struct
->color
;
1200 idtype
= type_struct
->id
;
1201 if(cltype
>= p0
->type
->table_size
) {
1204 var
= p0
->type
->type_table
[cltype
] == idtype
;
1207 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1208 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashNode#0", var_class_name
);
1209 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 196);
1213 self
->attrs
[COLOR_hash_collection__HashNode___key
].val
= var_k
; /* _key on <self:HashNode[Object]> */
1216 /* method hash_collection#HashNode#init for (self: Object, Object) */
1217 void VIRTUAL_hash_collection__HashNode__init(val
* self
, val
* p0
) {
1218 hash_collection__HashNode__init(self
, p0
);
1221 /* method hash_collection#HashMap#[] for (self: HashMap[Object, nullable Object], Object): nullable Object */
1222 val
* hash_collection__HashMap___91d_93d(val
* self
, val
* p0
) {
1223 val
* var
/* : nullable Object */;
1224 short int var1
/* : Bool */;
1227 const struct type
* type_struct
;
1228 const char* var_class_name
;
1229 val
* var_key
/* var key: Object */;
1230 val
* var2
/* : nullable HashNode[Object] */;
1231 val
* var_c
/* var c: nullable HashMapNode[Object, nullable Object] */;
1232 val
* var3
/* : null */;
1233 short int var4
/* : Bool */;
1234 val
* var5
/* : nullable Object */;
1235 val
* var6
/* : nullable Object */;
1236 /* Covariant cast for argument 0 (key) <p0:Object> isa MapRead#0 */
1237 /* <p0:Object> isa MapRead#0 */
1238 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__MapRead_FT0
];
1239 cltype
= type_struct
->color
;
1240 idtype
= type_struct
->id
;
1241 if(cltype
>= p0
->type
->table_size
) {
1244 var1
= p0
->type
->type_table
[cltype
] == idtype
;
1247 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1248 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "MapRead#0", var_class_name
);
1249 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 208);
1253 var2
= ((val
* (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__node_at
]))(self
, var_key
) /* node_at on <self:HashMap[Object, nullable Object]>*/;
1256 if (var_c
== NULL
) {
1257 var4
= 1; /* is null */
1259 var4
= 0; /* arg is null but recv is not */
1262 var5
= ((val
* (*)(val
*, val
*))(self
->class->vft
[COLOR_abstract_collection__MapRead__provide_default_value
]))(self
, var_key
) /* provide_default_value on <self:HashMap[Object, nullable Object]>*/;
1266 var6
= var_c
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1273 /* method hash_collection#HashMap#[] for (self: Object, Object): nullable Object */
1274 val
* VIRTUAL_hash_collection__HashMap___91d_93d(val
* self
, val
* p0
) {
1275 val
* var
/* : nullable Object */;
1276 val
* var1
/* : nullable Object */;
1277 var1
= hash_collection__HashMap___91d_93d(self
, p0
);
1282 /* method hash_collection#HashMap#iterator for (self: HashMap[Object, nullable Object]): HashMapIterator[Object, nullable Object] */
1283 val
* hash_collection__HashMap__iterator(val
* self
) {
1284 val
* var
/* : HashMapIterator[Object, nullable Object] */;
1285 val
* var1
/* : HashMapIterator[Object, nullable Object] */;
1286 var1
= NEW_hash_collection__HashMapIterator(self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMapIteratorhash_collection__HashMap_FT0hash_collection__HashMap_FT1
]);
1287 ((void (*)(val
*, val
*))(var1
->class->vft
[COLOR_hash_collection__HashMapIterator__init
]))(var1
, self
) /* init on <var1:HashMapIterator[Object, nullable Object]>*/;
1293 /* method hash_collection#HashMap#iterator for (self: Object): MapIterator[Object, nullable Object] */
1294 val
* VIRTUAL_hash_collection__HashMap__iterator(val
* self
) {
1295 val
* var
/* : MapIterator[Object, nullable Object] */;
1296 val
* var1
/* : HashMapIterator[Object, nullable Object] */;
1297 var1
= hash_collection__HashMap__iterator(self
);
1302 /* method hash_collection#HashMap#length for (self: HashMap[Object, nullable Object]): Int */
1303 long hash_collection__HashMap__length(val
* self
) {
1304 long var
/* : Int */;
1305 long var1
/* : Int */;
1306 var1
= self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <self:HashMap[Object, nullable Object]> */
1312 /* method hash_collection#HashMap#length for (self: Object): Int */
1313 long VIRTUAL_hash_collection__HashMap__length(val
* self
) {
1314 long var
/* : Int */;
1315 long var1
/* : Int */;
1316 var1
= hash_collection__HashMap__length(self
);
1321 /* method hash_collection#HashMap#is_empty for (self: HashMap[Object, nullable Object]): Bool */
1322 short int hash_collection__HashMap__is_empty(val
* self
) {
1323 short int var
/* : Bool */;
1324 long var1
/* : Int */;
1325 long var2
/* : Int */;
1326 short int var3
/* : Bool */;
1327 short int var5
/* : Bool */;
1328 var1
= self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <self:HashMap[Object, nullable Object]> */
1330 { /* Inline kernel#Int#== (var1,var2) */
1331 var5
= var1
== var2
;
1341 /* method hash_collection#HashMap#is_empty for (self: Object): Bool */
1342 short int VIRTUAL_hash_collection__HashMap__is_empty(val
* self
) {
1343 short int var
/* : Bool */;
1344 short int var1
/* : Bool */;
1345 var1
= hash_collection__HashMap__is_empty(self
);
1350 /* method hash_collection#HashMap#[]= for (self: HashMap[Object, nullable Object], Object, nullable Object) */
1351 void hash_collection__HashMap___91d_93d_61d(val
* self
, val
* p0
, val
* p1
) {
1352 short int var
/* : Bool */;
1355 const struct type
* type_struct
;
1356 const char* var_class_name
;
1357 short int var1
/* : Bool */;
1360 const struct type
* type_struct4
;
1361 short int is_nullable
;
1362 const char* var_class_name5
;
1363 val
* var_key
/* var key: Object */;
1364 val
* var_v
/* var v: nullable Object */;
1365 long var6
/* : Int */;
1366 long var_i
/* var i: Int */;
1367 val
* var7
/* : nullable HashNode[Object] */;
1368 val
* var_c
/* var c: nullable HashMapNode[Object, nullable Object] */;
1369 val
* var8
/* : null */;
1370 short int var9
/* : Bool */;
1371 val
* var10
/* : HashMapNode[Object, nullable Object] */;
1372 /* Covariant cast for argument 0 (key) <p0:Object> isa Map#0 */
1373 /* <p0:Object> isa Map#0 */
1374 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Map_FT0
];
1375 cltype
= type_struct
->color
;
1376 idtype
= type_struct
->id
;
1377 if(cltype
>= p0
->type
->table_size
) {
1380 var
= p0
->type
->type_table
[cltype
] == idtype
;
1383 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1384 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Map#0", var_class_name
);
1385 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 224);
1388 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa Map#1 */
1389 /* <p1:nullable Object> isa Map#1 */
1390 type_struct4
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Map_FT1
];
1391 cltype2
= type_struct4
->color
;
1392 idtype3
= type_struct4
->id
;
1393 is_nullable
= type_struct4
->is_nullable
;
1397 if(cltype2
>= p1
->type
->table_size
) {
1400 var1
= p1
->type
->type_table
[cltype2
] == idtype3
;
1404 var_class_name5
= p1
== NULL ?
"null" : p1
->type
->name
;
1405 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Map#1", var_class_name5
);
1406 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 224);
1411 var6
= ((long (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__index_at
]))(self
, var_key
) /* index_at on <self:HashMap[Object, nullable Object]>*/;
1413 var7
= ((val
* (*)(val
*, long, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__node_at_idx
]))(self
, var_i
, var_key
) /* node_at_idx on <self:HashMap[Object, nullable Object]>*/;
1416 if (var_c
== NULL
) {
1417 var9
= 0; /* is null */
1419 var9
= 1; /* arg is null and recv is not */
1422 var_c
->attrs
[COLOR_hash_collection__HashNode___key
].val
= var_key
; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1423 var_c
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
= var_v
; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
1425 var10
= NEW_hash_collection__HashMapNode(self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMapNodehash_collection__HashMap_FT0hash_collection__HashMap_FT1
]);
1426 ((void (*)(val
*, val
*, val
*))(var10
->class->vft
[COLOR_hash_collection__HashMapNode__init
]))(var10
, var_key
, var_v
) /* init on <var10:HashMapNode[Object, nullable Object]>*/;
1427 ((void (*)(val
*, long, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__store
]))(self
, var_i
, var10
) /* store on <self:HashMap[Object, nullable Object]>*/;
1431 /* method hash_collection#HashMap#[]= for (self: Object, Object, nullable Object) */
1432 void VIRTUAL_hash_collection__HashMap___91d_93d_61d(val
* self
, val
* p0
, val
* p1
) {
1433 hash_collection__HashMap___91d_93d_61d(self
, p0
, p1
);
1436 /* method hash_collection#HashMap#clear for (self: HashMap[Object, nullable Object]) */
1437 void hash_collection__HashMap__clear(val
* self
) {
1438 ((void (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__raz
]))(self
) /* raz on <self:HashMap[Object, nullable Object]>*/;
1441 /* method hash_collection#HashMap#clear for (self: Object) */
1442 void VIRTUAL_hash_collection__HashMap__clear(val
* self
) {
1443 hash_collection__HashMap__clear(self
);
1446 /* method hash_collection#HashMap#init for (self: HashMap[Object, nullable Object]) */
1447 void hash_collection__HashMap__init(val
* self
) {
1448 long var
/* : Int */;
1449 long var1
/* : Int */;
1450 long var2
/* : Int */;
1451 ((void (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__init
]))(self
) /* init on <self:HashMap[Object, nullable Object]>*/;
1453 self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
= var
; /* _capacity on <self:HashMap[Object, nullable Object]> */
1455 self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
= var1
; /* _length on <self:HashMap[Object, nullable Object]> */
1457 ((void (*)(val
*, long))(self
->class->vft
[COLOR_hash_collection__HashCollection__enlarge
]))(self
, var2
) /* enlarge on <self:HashMap[Object, nullable Object]>*/;
1460 /* method hash_collection#HashMap#init for (self: Object) */
1461 void VIRTUAL_hash_collection__HashMap__init(val
* self
) {
1462 hash_collection__HashMap__init(self
);
1465 /* method hash_collection#HashMap#keys for (self: HashMap[Object, nullable Object]): HashMapKeys[Object, nullable Object] */
1466 val
* hash_collection__HashMap__keys(val
* self
) {
1467 val
* var
/* : HashMapKeys[Object, nullable Object] */;
1468 val
* var1
/* : HashMapKeys[Object, nullable Object] */;
1469 var1
= self
->attrs
[COLOR_hash_collection__HashMap___64dkeys
].val
; /* @keys on <self:HashMap[Object, nullable Object]> */
1471 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @keys");
1472 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 245);
1479 /* method hash_collection#HashMap#keys for (self: Object): Collection[Object] */
1480 val
* VIRTUAL_hash_collection__HashMap__keys(val
* self
) {
1481 val
* var
/* : Collection[Object] */;
1482 val
* var1
/* : HashMapKeys[Object, nullable Object] */;
1483 var1
= hash_collection__HashMap__keys(self
);
1488 /* method hash_collection#HashMap#keys= for (self: HashMap[Object, nullable Object], HashMapKeys[Object, nullable Object]) */
1489 void hash_collection__HashMap__keys_61d(val
* self
, val
* p0
) {
1490 short int var
/* : Bool */;
1493 const struct type
* type_struct
;
1494 const char* var_class_name
;
1495 /* Covariant cast for argument 0 (keys) <p0:HashMapKeys[Object, nullable Object]> isa HashMapKeys[HashMap#0, HashMap#1] */
1496 /* <p0:HashMapKeys[Object, nullable Object]> isa HashMapKeys[HashMap#0, HashMap#1] */
1497 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMapKeyshash_collection__HashMap_FT0hash_collection__HashMap_FT1
];
1498 cltype
= type_struct
->color
;
1499 idtype
= type_struct
->id
;
1500 if(cltype
>= p0
->type
->table_size
) {
1503 var
= p0
->type
->type_table
[cltype
] == idtype
;
1506 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1507 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapKeys[HashMap#0, HashMap#1]", var_class_name
);
1508 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 245);
1511 self
->attrs
[COLOR_hash_collection__HashMap___64dkeys
].val
= p0
; /* @keys on <self:HashMap[Object, nullable Object]> */
1514 /* method hash_collection#HashMap#keys= for (self: Object, HashMapKeys[Object, nullable Object]) */
1515 void VIRTUAL_hash_collection__HashMap__keys_61d(val
* self
, val
* p0
) {
1516 hash_collection__HashMap__keys_61d(self
, p0
);
1519 /* method hash_collection#HashMap#values for (self: HashMap[Object, nullable Object]): HashMapValues[Object, nullable Object] */
1520 val
* hash_collection__HashMap__values(val
* self
) {
1521 val
* var
/* : HashMapValues[Object, nullable Object] */;
1522 val
* var1
/* : HashMapValues[Object, nullable Object] */;
1523 var1
= self
->attrs
[COLOR_hash_collection__HashMap___64dvalues
].val
; /* @values on <self:HashMap[Object, nullable Object]> */
1525 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @values");
1526 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 246);
1533 /* method hash_collection#HashMap#values for (self: Object): Collection[nullable Object] */
1534 val
* VIRTUAL_hash_collection__HashMap__values(val
* self
) {
1535 val
* var
/* : Collection[nullable Object] */;
1536 val
* var1
/* : HashMapValues[Object, nullable Object] */;
1537 var1
= hash_collection__HashMap__values(self
);
1542 /* method hash_collection#HashMap#values= for (self: HashMap[Object, nullable Object], HashMapValues[Object, nullable Object]) */
1543 void hash_collection__HashMap__values_61d(val
* self
, val
* p0
) {
1544 short int var
/* : Bool */;
1547 const struct type
* type_struct
;
1548 const char* var_class_name
;
1549 /* Covariant cast for argument 0 (values) <p0:HashMapValues[Object, nullable Object]> isa HashMapValues[HashMap#0, HashMap#1] */
1550 /* <p0:HashMapValues[Object, nullable Object]> isa HashMapValues[HashMap#0, HashMap#1] */
1551 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMapValueshash_collection__HashMap_FT0hash_collection__HashMap_FT1
];
1552 cltype
= type_struct
->color
;
1553 idtype
= type_struct
->id
;
1554 if(cltype
>= p0
->type
->table_size
) {
1557 var
= p0
->type
->type_table
[cltype
] == idtype
;
1560 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1561 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapValues[HashMap#0, HashMap#1]", var_class_name
);
1562 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 246);
1565 self
->attrs
[COLOR_hash_collection__HashMap___64dvalues
].val
= p0
; /* @values on <self:HashMap[Object, nullable Object]> */
1568 /* method hash_collection#HashMap#values= for (self: Object, HashMapValues[Object, nullable Object]) */
1569 void VIRTUAL_hash_collection__HashMap__values_61d(val
* self
, val
* p0
) {
1570 hash_collection__HashMap__values_61d(self
, p0
);
1573 /* method hash_collection#HashMapKeys#map for (self: HashMapKeys[Object, nullable Object]): HashMap[Object, nullable Object] */
1574 val
* hash_collection__HashMapKeys__map(val
* self
) {
1575 val
* var
/* : HashMap[Object, nullable Object] */;
1576 val
* var1
/* : HashMap[Object, nullable Object] */;
1577 var1
= self
->attrs
[COLOR_hash_collection__HashMapKeys___64dmap
].val
; /* @map on <self:HashMapKeys[Object, nullable Object]> */
1579 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @map");
1580 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 252);
1587 /* method hash_collection#HashMapKeys#map for (self: Object): HashMap[Object, nullable Object] */
1588 val
* VIRTUAL_hash_collection__HashMapKeys__map(val
* self
) {
1589 val
* var
/* : HashMap[Object, nullable Object] */;
1590 val
* var1
/* : HashMap[Object, nullable Object] */;
1591 var1
= hash_collection__HashMapKeys__map(self
);
1596 /* method hash_collection#HashMapKeys#map= for (self: HashMapKeys[Object, nullable Object], HashMap[Object, nullable Object]) */
1597 void hash_collection__HashMapKeys__map_61d(val
* self
, val
* p0
) {
1598 short int var
/* : Bool */;
1601 const struct type
* type_struct
;
1602 const char* var_class_name
;
1603 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1604 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1605 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMaphash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1
];
1606 cltype
= type_struct
->color
;
1607 idtype
= type_struct
->id
;
1608 if(cltype
>= p0
->type
->table_size
) {
1611 var
= p0
->type
->type_table
[cltype
] == idtype
;
1614 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1615 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapKeys#0, HashMapKeys#1]", var_class_name
);
1616 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 252);
1619 self
->attrs
[COLOR_hash_collection__HashMapKeys___64dmap
].val
= p0
; /* @map on <self:HashMapKeys[Object, nullable Object]> */
1622 /* method hash_collection#HashMapKeys#map= for (self: Object, HashMap[Object, nullable Object]) */
1623 void VIRTUAL_hash_collection__HashMapKeys__map_61d(val
* self
, val
* p0
) {
1624 hash_collection__HashMapKeys__map_61d(self
, p0
);
1627 /* method hash_collection#HashMapKeys#count for (self: HashMapKeys[Object, nullable Object], Object): Int */
1628 long hash_collection__HashMapKeys__count(val
* self
, val
* p0
) {
1629 long var
/* : Int */;
1630 short int var1
/* : Bool */;
1633 const struct type
* type_struct
;
1634 const char* var_class_name
;
1635 val
* var_k
/* var k: Object */;
1636 short int var2
/* : Bool */;
1637 long var3
/* : Int */;
1638 long var4
/* : Int */;
1639 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1640 /* <p0:Object> isa Collection#0 */
1641 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Collection_FT0
];
1642 cltype
= type_struct
->color
;
1643 idtype
= type_struct
->id
;
1644 if(cltype
>= p0
->type
->table_size
) {
1647 var1
= p0
->type
->type_table
[cltype
] == idtype
;
1650 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1651 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name
);
1652 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 255);
1656 var2
= ((short int (*)(val
*, val
*))(self
->class->vft
[COLOR_abstract_collection__Collection__has
]))(self
, var_k
) /* has on <self:HashMapKeys[Object, nullable Object]>*/;
1669 /* method hash_collection#HashMapKeys#count for (self: Object, nullable Object): Int */
1670 long VIRTUAL_hash_collection__HashMapKeys__count(val
* self
, val
* p0
) {
1671 long var
/* : Int */;
1672 long var1
/* : Int */;
1673 var1
= hash_collection__HashMapKeys__count(self
, p0
);
1678 /* method hash_collection#HashMapKeys#first for (self: HashMapKeys[Object, nullable Object]): Object */
1679 val
* hash_collection__HashMapKeys__first(val
* self
) {
1680 val
* var
/* : Object */;
1681 val
* var1
/* : HashMap[Object, nullable Object] */;
1682 val
* var2
/* : nullable HashNode[Object] */;
1683 val
* var3
/* : Object */;
1684 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapKeys__map
]))(self
) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1685 var2
= var1
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <var1:HashMap[Object, nullable Object]> */
1687 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
1688 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 256);
1691 var3
= var2
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var2:nullable HashNode[Object](nullable HashMapNode[Object, nullable Object])> */
1693 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
1694 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 256);
1702 /* method hash_collection#HashMapKeys#first for (self: Object): nullable Object */
1703 val
* VIRTUAL_hash_collection__HashMapKeys__first(val
* self
) {
1704 val
* var
/* : nullable Object */;
1705 val
* var1
/* : Object */;
1706 var1
= hash_collection__HashMapKeys__first(self
);
1711 /* method hash_collection#HashMapKeys#has for (self: HashMapKeys[Object, nullable Object], Object): Bool */
1712 short int hash_collection__HashMapKeys__has(val
* self
, val
* p0
) {
1713 short int var
/* : Bool */;
1714 short int var1
/* : Bool */;
1717 const struct type
* type_struct
;
1718 const char* var_class_name
;
1719 val
* var_k
/* var k: Object */;
1720 val
* var2
/* : HashMap[Object, nullable Object] */;
1721 val
* var3
/* : nullable HashNode[Object] */;
1722 val
* var4
/* : null */;
1723 short int var5
/* : Bool */;
1724 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1725 /* <p0:Object> isa Collection#0 */
1726 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Collection_FT0
];
1727 cltype
= type_struct
->color
;
1728 idtype
= type_struct
->id
;
1729 if(cltype
>= p0
->type
->table_size
) {
1732 var1
= p0
->type
->type_table
[cltype
] == idtype
;
1735 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1736 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name
);
1737 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 257);
1741 var2
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapKeys__map
]))(self
) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1742 var3
= ((val
* (*)(val
*, val
*))(var2
->class->vft
[COLOR_hash_collection__HashCollection__node_at
]))(var2
, var_k
) /* node_at on <var2:HashMap[Object, nullable Object]>*/;
1745 var5
= 0; /* is null */
1747 var5
= 1; /* arg is null and recv is not */
1754 /* method hash_collection#HashMapKeys#has for (self: Object, nullable Object): Bool */
1755 short int VIRTUAL_hash_collection__HashMapKeys__has(val
* self
, val
* p0
) {
1756 short int var
/* : Bool */;
1757 short int var1
/* : Bool */;
1758 var1
= hash_collection__HashMapKeys__has(self
, p0
);
1763 /* method hash_collection#HashMapKeys#has_only for (self: HashMapKeys[Object, nullable Object], Object): Bool */
1764 short int hash_collection__HashMapKeys__has_only(val
* self
, val
* p0
) {
1765 short int var
/* : Bool */;
1766 short int var1
/* : Bool */;
1769 const struct type
* type_struct
;
1770 const char* var_class_name
;
1771 val
* var_k
/* var k: Object */;
1772 short int var2
/* : Bool */;
1773 short int var3
/* : Bool */;
1774 short int var4
/* : Bool */;
1775 short int var_
/* var : Bool */;
1776 long var5
/* : Int */;
1777 long var6
/* : Int */;
1778 short int var7
/* : Bool */;
1779 short int var9
/* : Bool */;
1780 short int var_10
/* var : Bool */;
1781 short int var11
/* : Bool */;
1782 /* Covariant cast for argument 0 (k) <p0:Object> isa Collection#0 */
1783 /* <p0:Object> isa Collection#0 */
1784 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Collection_FT0
];
1785 cltype
= type_struct
->color
;
1786 idtype
= type_struct
->id
;
1787 if(cltype
>= p0
->type
->table_size
) {
1790 var1
= p0
->type
->type_table
[cltype
] == idtype
;
1793 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1794 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name
);
1795 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 258);
1799 var4
= ((short int (*)(val
*, val
*))(self
->class->vft
[COLOR_abstract_collection__Collection__has
]))(self
, var_k
) /* has on <self:HashMapKeys[Object, nullable Object]>*/;
1802 var5
= ((long (*)(val
*))(self
->class->vft
[COLOR_abstract_collection__Collection__length
]))(self
) /* length on <self:HashMapKeys[Object, nullable Object]>*/;
1804 { /* Inline kernel#Int#== (var5,var6) */
1805 var9
= var5
== var6
;
1818 var11
= ((short int (*)(val
*))(self
->class->vft
[COLOR_abstract_collection__Collection__is_empty
]))(self
) /* is_empty on <self:HashMapKeys[Object, nullable Object]>*/;
1826 /* method hash_collection#HashMapKeys#has_only for (self: Object, nullable Object): Bool */
1827 short int VIRTUAL_hash_collection__HashMapKeys__has_only(val
* self
, val
* p0
) {
1828 short int var
/* : Bool */;
1829 short int var1
/* : Bool */;
1830 var1
= hash_collection__HashMapKeys__has_only(self
, p0
);
1835 /* method hash_collection#HashMapKeys#is_empty for (self: HashMapKeys[Object, nullable Object]): Bool */
1836 short int hash_collection__HashMapKeys__is_empty(val
* self
) {
1837 short int var
/* : Bool */;
1838 val
* var1
/* : HashMap[Object, nullable Object] */;
1839 short int var2
/* : Bool */;
1840 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapKeys__map
]))(self
) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1841 var2
= ((short int (*)(val
*))(var1
->class->vft
[COLOR_abstract_collection__MapRead__is_empty
]))(var1
) /* is_empty on <var1:HashMap[Object, nullable Object]>*/;
1847 /* method hash_collection#HashMapKeys#is_empty for (self: Object): Bool */
1848 short int VIRTUAL_hash_collection__HashMapKeys__is_empty(val
* self
) {
1849 short int var
/* : Bool */;
1850 short int var1
/* : Bool */;
1851 var1
= hash_collection__HashMapKeys__is_empty(self
);
1856 /* method hash_collection#HashMapKeys#length for (self: HashMapKeys[Object, nullable Object]): Int */
1857 long hash_collection__HashMapKeys__length(val
* self
) {
1858 long var
/* : Int */;
1859 val
* var1
/* : HashMap[Object, nullable Object] */;
1860 long var2
/* : Int */;
1861 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapKeys__map
]))(self
) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1862 var2
= ((long (*)(val
*))(var1
->class->vft
[COLOR_abstract_collection__MapRead__length
]))(var1
) /* length on <var1:HashMap[Object, nullable Object]>*/;
1868 /* method hash_collection#HashMapKeys#length for (self: Object): Int */
1869 long VIRTUAL_hash_collection__HashMapKeys__length(val
* self
) {
1870 long var
/* : Int */;
1871 long var1
/* : Int */;
1872 var1
= hash_collection__HashMapKeys__length(self
);
1877 /* method hash_collection#HashMapKeys#iterator for (self: HashMapKeys[Object, nullable Object]): Iterator[Object] */
1878 val
* hash_collection__HashMapKeys__iterator(val
* self
) {
1879 val
* var
/* : Iterator[Object] */;
1880 val
* var1
/* : MapKeysIterator[Object, nullable Object] */;
1881 val
* var2
/* : HashMap[Object, nullable Object] */;
1882 val
* var3
/* : MapIterator[Object, nullable Object] */;
1883 var1
= NEW_abstract_collection__MapKeysIterator(self
->type
->resolution_table
->types
[COLOR_abstract_collection__MapKeysIteratorhash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1
]);
1884 var2
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapKeys__map
]))(self
) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1885 var3
= ((val
* (*)(val
*))(var2
->class->vft
[COLOR_abstract_collection__MapRead__iterator
]))(var2
) /* iterator on <var2:HashMap[Object, nullable Object]>*/;
1886 ((void (*)(val
*, val
*))(var1
->class->vft
[COLOR_abstract_collection__MapKeysIterator__init
]))(var1
, var3
) /* init on <var1:MapKeysIterator[Object, nullable Object]>*/;
1892 /* method hash_collection#HashMapKeys#iterator for (self: Object): Iterator[nullable Object] */
1893 val
* VIRTUAL_hash_collection__HashMapKeys__iterator(val
* self
) {
1894 val
* var
/* : Iterator[nullable Object] */;
1895 val
* var1
/* : Iterator[Object] */;
1896 var1
= hash_collection__HashMapKeys__iterator(self
);
1901 /* method hash_collection#HashMapKeys#clear for (self: HashMapKeys[Object, nullable Object]) */
1902 void hash_collection__HashMapKeys__clear(val
* self
) {
1903 val
* var
/* : HashMap[Object, nullable Object] */;
1904 var
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapKeys__map
]))(self
) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1905 ((void (*)(val
*))(var
->class->vft
[COLOR_abstract_collection__Map__clear
]))(var
) /* clear on <var:HashMap[Object, nullable Object]>*/;
1908 /* method hash_collection#HashMapKeys#clear for (self: Object) */
1909 void VIRTUAL_hash_collection__HashMapKeys__clear(val
* self
) {
1910 hash_collection__HashMapKeys__clear(self
);
1913 /* method hash_collection#HashMapKeys#remove for (self: HashMapKeys[Object, nullable Object], Object) */
1914 void hash_collection__HashMapKeys__remove(val
* self
, val
* p0
) {
1915 short int var
/* : Bool */;
1918 const struct type
* type_struct
;
1919 const char* var_class_name
;
1920 val
* var_key
/* var key: Object */;
1921 val
* var1
/* : HashMap[Object, nullable Object] */;
1922 /* Covariant cast for argument 0 (key) <p0:Object> isa RemovableCollection#0 */
1923 /* <p0:Object> isa RemovableCollection#0 */
1924 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__RemovableCollection_FT0
];
1925 cltype
= type_struct
->color
;
1926 idtype
= type_struct
->id
;
1927 if(cltype
>= p0
->type
->table_size
) {
1930 var
= p0
->type
->type_table
[cltype
] == idtype
;
1933 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1934 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name
);
1935 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 266);
1939 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapKeys__map
]))(self
) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1940 ((void (*)(val
*, val
*))(var1
->class->vft
[COLOR_hash_collection__HashCollection__remove_node
]))(var1
, var_key
) /* remove_node on <var1:HashMap[Object, nullable Object]>*/;
1943 /* method hash_collection#HashMapKeys#remove for (self: Object, nullable Object) */
1944 void VIRTUAL_hash_collection__HashMapKeys__remove(val
* self
, val
* p0
) {
1945 hash_collection__HashMapKeys__remove(self
, p0
);
1948 /* method hash_collection#HashMapKeys#remove_all for (self: HashMapKeys[Object, nullable Object], Object) */
1949 void hash_collection__HashMapKeys__remove_all(val
* self
, val
* p0
) {
1950 short int var
/* : Bool */;
1953 const struct type
* type_struct
;
1954 const char* var_class_name
;
1955 val
* var_key
/* var key: Object */;
1956 val
* var1
/* : HashMap[Object, nullable Object] */;
1957 /* Covariant cast for argument 0 (key) <p0:Object> isa RemovableCollection#0 */
1958 /* <p0:Object> isa RemovableCollection#0 */
1959 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__RemovableCollection_FT0
];
1960 cltype
= type_struct
->color
;
1961 idtype
= type_struct
->id
;
1962 if(cltype
>= p0
->type
->table_size
) {
1965 var
= p0
->type
->type_table
[cltype
] == idtype
;
1968 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
1969 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name
);
1970 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 267);
1974 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapKeys__map
]))(self
) /* map on <self:HashMapKeys[Object, nullable Object]>*/;
1975 ((void (*)(val
*, val
*))(var1
->class->vft
[COLOR_hash_collection__HashCollection__remove_node
]))(var1
, var_key
) /* remove_node on <var1:HashMap[Object, nullable Object]>*/;
1978 /* method hash_collection#HashMapKeys#remove_all for (self: Object, nullable Object) */
1979 void VIRTUAL_hash_collection__HashMapKeys__remove_all(val
* self
, val
* p0
) {
1980 hash_collection__HashMapKeys__remove_all(self
, p0
);
1983 /* method hash_collection#HashMapKeys#init for (self: HashMapKeys[Object, nullable Object], HashMap[Object, nullable Object]) */
1984 void hash_collection__HashMapKeys__init(val
* self
, val
* p0
) {
1985 short int var
/* : Bool */;
1988 const struct type
* type_struct
;
1989 const char* var_class_name
;
1990 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1991 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapKeys#0, HashMapKeys#1] */
1992 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMaphash_collection__HashMapKeys_FT0hash_collection__HashMapKeys_FT1
];
1993 cltype
= type_struct
->color
;
1994 idtype
= type_struct
->id
;
1995 if(cltype
>= p0
->type
->table_size
) {
1998 var
= p0
->type
->type_table
[cltype
] == idtype
;
2001 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2002 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapKeys#0, HashMapKeys#1]", var_class_name
);
2003 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 249);
2006 self
->attrs
[COLOR_hash_collection__HashMapKeys___64dmap
].val
= p0
; /* @map on <self:HashMapKeys[Object, nullable Object]> */
2009 /* method hash_collection#HashMapKeys#init for (self: Object, HashMap[Object, nullable Object]) */
2010 void VIRTUAL_hash_collection__HashMapKeys__init(val
* self
, val
* p0
) {
2011 hash_collection__HashMapKeys__init(self
, p0
);
2014 /* method hash_collection#HashMapValues#map for (self: HashMapValues[Object, nullable Object]): HashMap[Object, nullable Object] */
2015 val
* hash_collection__HashMapValues__map(val
* self
) {
2016 val
* var
/* : HashMap[Object, nullable Object] */;
2017 val
* var1
/* : HashMap[Object, nullable Object] */;
2018 var1
= self
->attrs
[COLOR_hash_collection__HashMapValues___64dmap
].val
; /* @map on <self:HashMapValues[Object, nullable Object]> */
2020 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute @map");
2021 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 273);
2028 /* method hash_collection#HashMapValues#map for (self: Object): HashMap[Object, nullable Object] */
2029 val
* VIRTUAL_hash_collection__HashMapValues__map(val
* self
) {
2030 val
* var
/* : HashMap[Object, nullable Object] */;
2031 val
* var1
/* : HashMap[Object, nullable Object] */;
2032 var1
= hash_collection__HashMapValues__map(self
);
2037 /* method hash_collection#HashMapValues#map= for (self: HashMapValues[Object, nullable Object], HashMap[Object, nullable Object]) */
2038 void hash_collection__HashMapValues__map_61d(val
* self
, val
* p0
) {
2039 short int var
/* : Bool */;
2042 const struct type
* type_struct
;
2043 const char* var_class_name
;
2044 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2045 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2046 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMaphash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1
];
2047 cltype
= type_struct
->color
;
2048 idtype
= type_struct
->id
;
2049 if(cltype
>= p0
->type
->table_size
) {
2052 var
= p0
->type
->type_table
[cltype
] == idtype
;
2055 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2056 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapValues#0, HashMapValues#1]", var_class_name
);
2057 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 273);
2060 self
->attrs
[COLOR_hash_collection__HashMapValues___64dmap
].val
= p0
; /* @map on <self:HashMapValues[Object, nullable Object]> */
2063 /* method hash_collection#HashMapValues#map= for (self: Object, HashMap[Object, nullable Object]) */
2064 void VIRTUAL_hash_collection__HashMapValues__map_61d(val
* self
, val
* p0
) {
2065 hash_collection__HashMapValues__map_61d(self
, p0
);
2068 /* method hash_collection#HashMapValues#count for (self: HashMapValues[Object, nullable Object], nullable Object): Int */
2069 long hash_collection__HashMapValues__count(val
* self
, val
* p0
) {
2070 long var
/* : Int */;
2071 short int var1
/* : Bool */;
2074 const struct type
* type_struct
;
2075 short int is_nullable
;
2076 const char* var_class_name
;
2077 val
* var_item
/* var item: nullable Object */;
2078 long var2
/* : Int */;
2079 long var_nb
/* var nb: Int */;
2080 val
* var3
/* : HashMap[Object, nullable Object] */;
2081 val
* var4
/* : nullable HashNode[Object] */;
2082 val
* var_c
/* var c: nullable HashMapNode[Object, nullable Object] */;
2083 val
* var5
/* : null */;
2084 short int var6
/* : Bool */;
2085 val
* var7
/* : nullable Object */;
2086 short int var8
/* : Bool */;
2087 long var9
/* : Int */;
2088 long var10
/* : Int */;
2089 long var12
/* : Int */;
2090 val
* var13
/* : nullable HashNode[Object] */;
2091 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2092 /* <p0:nullable Object> isa Collection#0 */
2093 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Collection_FT0
];
2094 cltype
= type_struct
->color
;
2095 idtype
= type_struct
->id
;
2096 is_nullable
= type_struct
->is_nullable
;
2100 if(cltype
>= p0
->type
->table_size
) {
2103 var1
= p0
->type
->type_table
[cltype
] == idtype
;
2107 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2108 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name
);
2109 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 276);
2115 var3
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2116 var4
= var3
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <var3:HashMap[Object, nullable Object]> */
2120 if (var_c
== NULL
) {
2121 var6
= 0; /* is null */
2123 var6
= 1; /* arg is null and recv is not */
2126 var7
= var_c
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2128 var8
= (var_item
== NULL
);
2130 var8
= ((short int (*)(val
*, val
*))(var7
->class->vft
[COLOR_kernel__Object___61d_61d
]))(var7
, var_item
) /* == on <var7:nullable Object>*/;
2134 { /* Inline kernel#Int#+ (var_nb,var9) */
2135 var12
= var_nb
+ var9
;
2138 RET_LABEL11
:(void)0;
2143 var13
= var_c
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2145 CONTINUE_label
: (void)0;
2147 BREAK_label
: (void)0;
2153 /* method hash_collection#HashMapValues#count for (self: Object, nullable Object): Int */
2154 long VIRTUAL_hash_collection__HashMapValues__count(val
* self
, val
* p0
) {
2155 long var
/* : Int */;
2156 long var1
/* : Int */;
2157 var1
= hash_collection__HashMapValues__count(self
, p0
);
2162 /* method hash_collection#HashMapValues#first for (self: HashMapValues[Object, nullable Object]): nullable Object */
2163 val
* hash_collection__HashMapValues__first(val
* self
) {
2164 val
* var
/* : nullable Object */;
2165 val
* var1
/* : HashMap[Object, nullable Object] */;
2166 val
* var2
/* : nullable HashNode[Object] */;
2167 val
* var3
/* : nullable Object */;
2168 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2169 var2
= var1
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <var1:HashMap[Object, nullable Object]> */
2171 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
2172 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 286);
2175 var3
= var2
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
; /* _value on <var2:nullable HashNode[Object](nullable HashMapNode[Object, nullable Object])> */
2181 /* method hash_collection#HashMapValues#first for (self: Object): nullable Object */
2182 val
* VIRTUAL_hash_collection__HashMapValues__first(val
* self
) {
2183 val
* var
/* : nullable Object */;
2184 val
* var1
/* : nullable Object */;
2185 var1
= hash_collection__HashMapValues__first(self
);
2190 /* method hash_collection#HashMapValues#has for (self: HashMapValues[Object, nullable Object], nullable Object): Bool */
2191 short int hash_collection__HashMapValues__has(val
* self
, val
* p0
) {
2192 short int var
/* : Bool */;
2193 short int var1
/* : Bool */;
2196 const struct type
* type_struct
;
2197 short int is_nullable
;
2198 const char* var_class_name
;
2199 val
* var_item
/* var item: nullable Object */;
2200 val
* var2
/* : HashMap[Object, nullable Object] */;
2201 val
* var3
/* : nullable HashNode[Object] */;
2202 val
* var_c
/* var c: nullable HashMapNode[Object, nullable Object] */;
2203 val
* var4
/* : null */;
2204 short int var5
/* : Bool */;
2205 val
* var6
/* : nullable Object */;
2206 short int var7
/* : Bool */;
2207 short int var8
/* : Bool */;
2208 val
* var9
/* : nullable HashNode[Object] */;
2209 short int var10
/* : Bool */;
2210 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2211 /* <p0:nullable Object> isa Collection#0 */
2212 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Collection_FT0
];
2213 cltype
= type_struct
->color
;
2214 idtype
= type_struct
->id
;
2215 is_nullable
= type_struct
->is_nullable
;
2219 if(cltype
>= p0
->type
->table_size
) {
2222 var1
= p0
->type
->type_table
[cltype
] == idtype
;
2226 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2227 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name
);
2228 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 288);
2232 var2
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2233 var3
= var2
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <var2:HashMap[Object, nullable Object]> */
2237 if (var_c
== NULL
) {
2238 var5
= 0; /* is null */
2240 var5
= 1; /* arg is null and recv is not */
2243 var6
= var_c
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2245 var7
= (var_item
== NULL
);
2247 var7
= ((short int (*)(val
*, val
*))(var6
->class->vft
[COLOR_kernel__Object___61d_61d
]))(var6
, var_item
) /* == on <var6:nullable Object>*/;
2255 var9
= var_c
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2257 CONTINUE_label
: (void)0;
2259 BREAK_label
: (void)0;
2266 /* method hash_collection#HashMapValues#has for (self: Object, nullable Object): Bool */
2267 short int VIRTUAL_hash_collection__HashMapValues__has(val
* self
, val
* p0
) {
2268 short int var
/* : Bool */;
2269 short int var1
/* : Bool */;
2270 var1
= hash_collection__HashMapValues__has(self
, p0
);
2275 /* method hash_collection#HashMapValues#has_only for (self: HashMapValues[Object, nullable Object], nullable Object): Bool */
2276 short int hash_collection__HashMapValues__has_only(val
* self
, val
* p0
) {
2277 short int var
/* : Bool */;
2278 short int var1
/* : Bool */;
2281 const struct type
* type_struct
;
2282 short int is_nullable
;
2283 const char* var_class_name
;
2284 val
* var_item
/* var item: nullable Object */;
2285 val
* var2
/* : HashMap[Object, nullable Object] */;
2286 val
* var3
/* : nullable HashNode[Object] */;
2287 val
* var_c
/* var c: nullable HashMapNode[Object, nullable Object] */;
2288 val
* var4
/* : null */;
2289 short int var5
/* : Bool */;
2290 val
* var6
/* : nullable Object */;
2291 short int var7
/* : Bool */;
2292 short int var8
/* : Bool */;
2293 val
* var9
/* : nullable HashNode[Object] */;
2294 short int var10
/* : Bool */;
2295 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa Collection#0 */
2296 /* <p0:nullable Object> isa Collection#0 */
2297 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Collection_FT0
];
2298 cltype
= type_struct
->color
;
2299 idtype
= type_struct
->id
;
2300 is_nullable
= type_struct
->is_nullable
;
2304 if(cltype
>= p0
->type
->table_size
) {
2307 var1
= p0
->type
->type_table
[cltype
] == idtype
;
2311 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2312 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name
);
2313 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 298);
2317 var2
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2318 var3
= var2
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <var2:HashMap[Object, nullable Object]> */
2322 if (var_c
== NULL
) {
2323 var5
= 0; /* is null */
2325 var5
= 1; /* arg is null and recv is not */
2328 var6
= var_c
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2330 var7
= (var_item
!= NULL
);
2332 var7
= ((short int (*)(val
*, val
*))(var6
->class->vft
[COLOR_kernel__Object___33d_61d
]))(var6
, var_item
) /* != on <var6:nullable Object>*/;
2340 var9
= var_c
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2342 CONTINUE_label
: (void)0;
2344 BREAK_label
: (void)0;
2351 /* method hash_collection#HashMapValues#has_only for (self: Object, nullable Object): Bool */
2352 short int VIRTUAL_hash_collection__HashMapValues__has_only(val
* self
, val
* p0
) {
2353 short int var
/* : Bool */;
2354 short int var1
/* : Bool */;
2355 var1
= hash_collection__HashMapValues__has_only(self
, p0
);
2360 /* method hash_collection#HashMapValues#is_empty for (self: HashMapValues[Object, nullable Object]): Bool */
2361 short int hash_collection__HashMapValues__is_empty(val
* self
) {
2362 short int var
/* : Bool */;
2363 val
* var1
/* : HashMap[Object, nullable Object] */;
2364 short int var2
/* : Bool */;
2365 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2366 var2
= ((short int (*)(val
*))(var1
->class->vft
[COLOR_abstract_collection__MapRead__is_empty
]))(var1
) /* is_empty on <var1:HashMap[Object, nullable Object]>*/;
2372 /* method hash_collection#HashMapValues#is_empty for (self: Object): Bool */
2373 short int VIRTUAL_hash_collection__HashMapValues__is_empty(val
* self
) {
2374 short int var
/* : Bool */;
2375 short int var1
/* : Bool */;
2376 var1
= hash_collection__HashMapValues__is_empty(self
);
2381 /* method hash_collection#HashMapValues#length for (self: HashMapValues[Object, nullable Object]): Int */
2382 long hash_collection__HashMapValues__length(val
* self
) {
2383 long var
/* : Int */;
2384 val
* var1
/* : HashMap[Object, nullable Object] */;
2385 long var2
/* : Int */;
2386 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2387 var2
= ((long (*)(val
*))(var1
->class->vft
[COLOR_abstract_collection__MapRead__length
]))(var1
) /* length on <var1:HashMap[Object, nullable Object]>*/;
2393 /* method hash_collection#HashMapValues#length for (self: Object): Int */
2394 long VIRTUAL_hash_collection__HashMapValues__length(val
* self
) {
2395 long var
/* : Int */;
2396 long var1
/* : Int */;
2397 var1
= hash_collection__HashMapValues__length(self
);
2402 /* method hash_collection#HashMapValues#iterator for (self: HashMapValues[Object, nullable Object]): Iterator[nullable Object] */
2403 val
* hash_collection__HashMapValues__iterator(val
* self
) {
2404 val
* var
/* : Iterator[nullable Object] */;
2405 val
* var1
/* : MapValuesIterator[Object, nullable Object] */;
2406 val
* var2
/* : HashMap[Object, nullable Object] */;
2407 val
* var3
/* : MapIterator[Object, nullable Object] */;
2408 var1
= NEW_abstract_collection__MapValuesIterator(self
->type
->resolution_table
->types
[COLOR_abstract_collection__MapValuesIteratorhash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1
]);
2409 var2
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2410 var3
= ((val
* (*)(val
*))(var2
->class->vft
[COLOR_abstract_collection__MapRead__iterator
]))(var2
) /* iterator on <var2:HashMap[Object, nullable Object]>*/;
2411 ((void (*)(val
*, val
*))(var1
->class->vft
[COLOR_abstract_collection__MapValuesIterator__init
]))(var1
, var3
) /* init on <var1:MapValuesIterator[Object, nullable Object]>*/;
2417 /* method hash_collection#HashMapValues#iterator for (self: Object): Iterator[nullable Object] */
2418 val
* VIRTUAL_hash_collection__HashMapValues__iterator(val
* self
) {
2419 val
* var
/* : Iterator[nullable Object] */;
2420 val
* var1
/* : Iterator[nullable Object] */;
2421 var1
= hash_collection__HashMapValues__iterator(self
);
2426 /* method hash_collection#HashMapValues#clear for (self: HashMapValues[Object, nullable Object]) */
2427 void hash_collection__HashMapValues__clear(val
* self
) {
2428 val
* var
/* : HashMap[Object, nullable Object] */;
2429 var
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2430 ((void (*)(val
*))(var
->class->vft
[COLOR_abstract_collection__Map__clear
]))(var
) /* clear on <var:HashMap[Object, nullable Object]>*/;
2433 /* method hash_collection#HashMapValues#clear for (self: Object) */
2434 void VIRTUAL_hash_collection__HashMapValues__clear(val
* self
) {
2435 hash_collection__HashMapValues__clear(self
);
2438 /* method hash_collection#HashMapValues#remove for (self: HashMapValues[Object, nullable Object], nullable Object) */
2439 void hash_collection__HashMapValues__remove(val
* self
, val
* p0
) {
2440 short int var
/* : Bool */;
2443 const struct type
* type_struct
;
2444 short int is_nullable
;
2445 const char* var_class_name
;
2446 val
* var_item
/* var item: nullable Object */;
2447 val
* var1
/* : HashMap[Object, nullable Object] */;
2448 val
* var_map
/* var map: HashMap[Object, nullable Object] */;
2449 val
* var2
/* : nullable HashNode[Object] */;
2450 val
* var_c
/* var c: nullable HashMapNode[Object, nullable Object] */;
2451 val
* var3
/* : null */;
2452 short int var4
/* : Bool */;
2453 val
* var5
/* : nullable Object */;
2454 short int var6
/* : Bool */;
2455 val
* var7
/* : Object */;
2456 val
* var8
/* : nullable HashNode[Object] */;
2457 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa RemovableCollection#0 */
2458 /* <p0:nullable Object> isa RemovableCollection#0 */
2459 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__RemovableCollection_FT0
];
2460 cltype
= type_struct
->color
;
2461 idtype
= type_struct
->id
;
2462 is_nullable
= type_struct
->is_nullable
;
2466 if(cltype
>= p0
->type
->table_size
) {
2469 var
= p0
->type
->type_table
[cltype
] == idtype
;
2473 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2474 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name
);
2475 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 315);
2479 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2481 var2
= var_map
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <var_map:HashMap[Object, nullable Object]> */
2485 if (var_c
== NULL
) {
2486 var4
= 0; /* is null */
2488 var4
= 1; /* arg is null and recv is not */
2491 var5
= var_c
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2493 var6
= (var_item
== NULL
);
2495 var6
= ((short int (*)(val
*, val
*))(var5
->class->vft
[COLOR_kernel__Object___61d_61d
]))(var5
, var_item
) /* == on <var5:nullable Object>*/;
2498 var7
= var_c
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2500 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
2501 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 321);
2504 ((void (*)(val
*, val
*))(var_map
->class->vft
[COLOR_hash_collection__HashCollection__remove_node
]))(var_map
, var7
) /* remove_node on <var_map:HashMap[Object, nullable Object]>*/;
2508 var8
= var_c
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2510 CONTINUE_label
: (void)0;
2512 BREAK_label
: (void)0;
2515 /* method hash_collection#HashMapValues#remove for (self: Object, nullable Object) */
2516 void VIRTUAL_hash_collection__HashMapValues__remove(val
* self
, val
* p0
) {
2517 hash_collection__HashMapValues__remove(self
, p0
);
2520 /* method hash_collection#HashMapValues#remove_all for (self: HashMapValues[Object, nullable Object], nullable Object) */
2521 void hash_collection__HashMapValues__remove_all(val
* self
, val
* p0
) {
2522 short int var
/* : Bool */;
2525 const struct type
* type_struct
;
2526 short int is_nullable
;
2527 const char* var_class_name
;
2528 val
* var_item
/* var item: nullable Object */;
2529 val
* var1
/* : HashMap[Object, nullable Object] */;
2530 val
* var_map
/* var map: HashMap[Object, nullable Object] */;
2531 val
* var2
/* : nullable HashNode[Object] */;
2532 val
* var_c
/* var c: nullable HashMapNode[Object, nullable Object] */;
2533 val
* var3
/* : null */;
2534 short int var4
/* : Bool */;
2535 val
* var5
/* : nullable Object */;
2536 short int var6
/* : Bool */;
2537 val
* var7
/* : Object */;
2538 val
* var8
/* : nullable HashNode[Object] */;
2539 /* Covariant cast for argument 0 (item) <p0:nullable Object> isa RemovableCollection#0 */
2540 /* <p0:nullable Object> isa RemovableCollection#0 */
2541 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__RemovableCollection_FT0
];
2542 cltype
= type_struct
->color
;
2543 idtype
= type_struct
->id
;
2544 is_nullable
= type_struct
->is_nullable
;
2548 if(cltype
>= p0
->type
->table_size
) {
2551 var
= p0
->type
->type_table
[cltype
] == idtype
;
2555 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2556 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name
);
2557 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 328);
2561 var1
= ((val
* (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashMapValues__map
]))(self
) /* map on <self:HashMapValues[Object, nullable Object]>*/;
2563 var2
= var_map
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <var_map:HashMap[Object, nullable Object]> */
2567 if (var_c
== NULL
) {
2568 var4
= 0; /* is null */
2570 var4
= 1; /* arg is null and recv is not */
2573 var5
= var_c
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
; /* _value on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2575 var6
= (var_item
== NULL
);
2577 var6
= ((short int (*)(val
*, val
*))(var5
->class->vft
[COLOR_kernel__Object___61d_61d
]))(var5
, var_item
) /* == on <var5:nullable Object>*/;
2580 var7
= var_c
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2582 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
2583 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 334);
2586 ((void (*)(val
*, val
*))(var_map
->class->vft
[COLOR_hash_collection__HashCollection__remove_node
]))(var_map
, var7
) /* remove_node on <var_map:HashMap[Object, nullable Object]>*/;
2589 var8
= var_c
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var_c:nullable HashMapNode[Object, nullable Object](HashMapNode[Object, nullable Object])> */
2591 CONTINUE_label
: (void)0;
2593 BREAK_label
: (void)0;
2596 /* method hash_collection#HashMapValues#remove_all for (self: Object, nullable Object) */
2597 void VIRTUAL_hash_collection__HashMapValues__remove_all(val
* self
, val
* p0
) {
2598 hash_collection__HashMapValues__remove_all(self
, p0
);
2601 /* method hash_collection#HashMapValues#init for (self: HashMapValues[Object, nullable Object], HashMap[Object, nullable Object]) */
2602 void hash_collection__HashMapValues__init(val
* self
, val
* p0
) {
2603 short int var
/* : Bool */;
2606 const struct type
* type_struct
;
2607 const char* var_class_name
;
2608 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2609 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapValues#0, HashMapValues#1] */
2610 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMaphash_collection__HashMapValues_FT0hash_collection__HashMapValues_FT1
];
2611 cltype
= type_struct
->color
;
2612 idtype
= type_struct
->id
;
2613 if(cltype
>= p0
->type
->table_size
) {
2616 var
= p0
->type
->type_table
[cltype
] == idtype
;
2619 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2620 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapValues#0, HashMapValues#1]", var_class_name
);
2621 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 270);
2624 self
->attrs
[COLOR_hash_collection__HashMapValues___64dmap
].val
= p0
; /* @map on <self:HashMapValues[Object, nullable Object]> */
2627 /* method hash_collection#HashMapValues#init for (self: Object, HashMap[Object, nullable Object]) */
2628 void VIRTUAL_hash_collection__HashMapValues__init(val
* self
, val
* p0
) {
2629 hash_collection__HashMapValues__init(self
, p0
);
2632 /* method hash_collection#HashMapNode#init for (self: HashMapNode[Object, nullable Object], Object, nullable Object) */
2633 void hash_collection__HashMapNode__init(val
* self
, val
* p0
, val
* p1
) {
2634 short int var
/* : Bool */;
2637 const struct type
* type_struct
;
2638 const char* var_class_name
;
2639 short int var1
/* : Bool */;
2642 const struct type
* type_struct4
;
2643 short int is_nullable
;
2644 const char* var_class_name5
;
2645 val
* var_k
/* var k: Object */;
2646 val
* var_v
/* var v: nullable Object */;
2647 /* Covariant cast for argument 0 (k) <p0:Object> isa HashMapNode#0 */
2648 /* <p0:Object> isa HashMapNode#0 */
2649 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMapNode_FT0
];
2650 cltype
= type_struct
->color
;
2651 idtype
= type_struct
->id
;
2652 if(cltype
>= p0
->type
->table_size
) {
2655 var
= p0
->type
->type_table
[cltype
] == idtype
;
2658 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2659 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapNode#0", var_class_name
);
2660 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 346);
2663 /* Covariant cast for argument 1 (v) <p1:nullable Object> isa HashMapNode#1 */
2664 /* <p1:nullable Object> isa HashMapNode#1 */
2665 type_struct4
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMapNode_FT1
];
2666 cltype2
= type_struct4
->color
;
2667 idtype3
= type_struct4
->id
;
2668 is_nullable
= type_struct4
->is_nullable
;
2672 if(cltype2
>= p1
->type
->table_size
) {
2675 var1
= p1
->type
->type_table
[cltype2
] == idtype3
;
2679 var_class_name5
= p1
== NULL ?
"null" : p1
->type
->name
;
2680 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMapNode#1", var_class_name5
);
2681 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 346);
2686 ((void (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashNode__init
]))(self
, var_k
) /* init on <self:HashMapNode[Object, nullable Object]>*/;
2687 self
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
= var_v
; /* _value on <self:HashMapNode[Object, nullable Object]> */
2690 /* method hash_collection#HashMapNode#init for (self: Object, Object, nullable Object) */
2691 void VIRTUAL_hash_collection__HashMapNode__init(val
* self
, val
* p0
, val
* p1
) {
2692 hash_collection__HashMapNode__init(self
, p0
, p1
);
2695 /* method hash_collection#HashMapIterator#is_ok for (self: HashMapIterator[Object, nullable Object]): Bool */
2696 short int hash_collection__HashMapIterator__is_ok(val
* self
) {
2697 short int var
/* : Bool */;
2698 val
* var1
/* : nullable HashMapNode[Object, nullable Object] */;
2699 val
* var2
/* : null */;
2700 short int var3
/* : Bool */;
2701 var1
= self
->attrs
[COLOR_hash_collection__HashMapIterator___node
].val
; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2704 var3
= 0; /* is null */
2706 var3
= 1; /* arg is null and recv is not */
2713 /* method hash_collection#HashMapIterator#is_ok for (self: Object): Bool */
2714 short int VIRTUAL_hash_collection__HashMapIterator__is_ok(val
* self
) {
2715 short int var
/* : Bool */;
2716 short int var1
/* : Bool */;
2717 var1
= hash_collection__HashMapIterator__is_ok(self
);
2722 /* method hash_collection#HashMapIterator#item for (self: HashMapIterator[Object, nullable Object]): nullable Object */
2723 val
* hash_collection__HashMapIterator__item(val
* self
) {
2724 val
* var
/* : nullable Object */;
2725 short int var1
/* : Bool */;
2726 val
* var2
/* : nullable HashMapNode[Object, nullable Object] */;
2727 val
* var3
/* : nullable Object */;
2728 var1
= ((short int (*)(val
*))(self
->class->vft
[COLOR_abstract_collection__MapIterator__is_ok
]))(self
) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2730 fprintf(stderr
, "Runtime error: %s", "Assert failed");
2731 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 359);
2734 var2
= self
->attrs
[COLOR_hash_collection__HashMapIterator___node
].val
; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2736 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
2737 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 360);
2740 var3
= var2
->attrs
[COLOR_hash_collection__HashMapNode___value
].val
; /* _value on <var2:nullable HashMapNode[Object, nullable Object]> */
2746 /* method hash_collection#HashMapIterator#item for (self: Object): nullable Object */
2747 val
* VIRTUAL_hash_collection__HashMapIterator__item(val
* self
) {
2748 val
* var
/* : nullable Object */;
2749 val
* var1
/* : nullable Object */;
2750 var1
= hash_collection__HashMapIterator__item(self
);
2755 /* method hash_collection#HashMapIterator#key for (self: HashMapIterator[Object, nullable Object]): Object */
2756 val
* hash_collection__HashMapIterator__key(val
* self
) {
2757 val
* var
/* : Object */;
2758 short int var1
/* : Bool */;
2759 val
* var2
/* : nullable HashMapNode[Object, nullable Object] */;
2760 val
* var3
/* : Object */;
2761 var1
= ((short int (*)(val
*))(self
->class->vft
[COLOR_abstract_collection__MapIterator__is_ok
]))(self
) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2763 fprintf(stderr
, "Runtime error: %s", "Assert failed");
2764 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 371);
2767 var2
= self
->attrs
[COLOR_hash_collection__HashMapIterator___node
].val
; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2769 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
2770 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 372);
2773 var3
= var2
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var2:nullable HashMapNode[Object, nullable Object]> */
2775 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
2776 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 372);
2784 /* method hash_collection#HashMapIterator#key for (self: Object): Object */
2785 val
* VIRTUAL_hash_collection__HashMapIterator__key(val
* self
) {
2786 val
* var
/* : Object */;
2787 val
* var1
/* : Object */;
2788 var1
= hash_collection__HashMapIterator__key(self
);
2793 /* method hash_collection#HashMapIterator#next for (self: HashMapIterator[Object, nullable Object]) */
2794 void hash_collection__HashMapIterator__next(val
* self
) {
2795 short int var
/* : Bool */;
2796 val
* var1
/* : nullable HashMapNode[Object, nullable Object] */;
2797 val
* var2
/* : nullable HashNode[Object] */;
2798 var
= ((short int (*)(val
*))(self
->class->vft
[COLOR_abstract_collection__MapIterator__is_ok
]))(self
) /* is_ok on <self:HashMapIterator[Object, nullable Object]>*/;
2800 fprintf(stderr
, "Runtime error: %s", "Assert failed");
2801 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 377);
2804 var1
= self
->attrs
[COLOR_hash_collection__HashMapIterator___node
].val
; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2806 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
2807 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 378);
2810 var2
= var1
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var1:nullable HashMapNode[Object, nullable Object]> */
2811 self
->attrs
[COLOR_hash_collection__HashMapIterator___node
].val
= var2
; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2814 /* method hash_collection#HashMapIterator#next for (self: Object) */
2815 void VIRTUAL_hash_collection__HashMapIterator__next(val
* self
) {
2816 hash_collection__HashMapIterator__next(self
);
2819 /* method hash_collection#HashMapIterator#init for (self: HashMapIterator[Object, nullable Object], HashMap[Object, nullable Object]) */
2820 void hash_collection__HashMapIterator__init(val
* self
, val
* p0
) {
2821 short int var
/* : Bool */;
2824 const struct type
* type_struct
;
2825 const char* var_class_name
;
2826 val
* var_map
/* var map: HashMap[Object, nullable Object] */;
2827 val
* var1
/* : nullable HashNode[Object] */;
2828 /* Covariant cast for argument 0 (map) <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapIterator#0, HashMapIterator#1] */
2829 /* <p0:HashMap[Object, nullable Object]> isa HashMap[HashMapIterator#0, HashMapIterator#1] */
2830 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashMaphash_collection__HashMapIterator_FT0hash_collection__HashMapIterator_FT1
];
2831 cltype
= type_struct
->color
;
2832 idtype
= type_struct
->id
;
2833 if(cltype
>= p0
->type
->table_size
) {
2836 var
= p0
->type
->type_table
[cltype
] == idtype
;
2839 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2840 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashMap[HashMapIterator#0, HashMapIterator#1]", var_class_name
);
2841 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 387);
2845 self
->attrs
[COLOR_hash_collection__HashMapIterator___map
].val
= var_map
; /* _map on <self:HashMapIterator[Object, nullable Object]> */
2846 var1
= ((val
* (*)(val
*))(var_map
->class->vft
[COLOR_hash_collection__HashCollection__first_item
]))(var_map
) /* first_item on <var_map:HashMap[Object, nullable Object]>*/;
2847 self
->attrs
[COLOR_hash_collection__HashMapIterator___node
].val
= var1
; /* _node on <self:HashMapIterator[Object, nullable Object]> */
2850 /* method hash_collection#HashMapIterator#init for (self: Object, HashMap[Object, nullable Object]) */
2851 void VIRTUAL_hash_collection__HashMapIterator__init(val
* self
, val
* p0
) {
2852 hash_collection__HashMapIterator__init(self
, p0
);
2855 /* method hash_collection#HashSet#length for (self: HashSet[Object]): Int */
2856 long hash_collection__HashSet__length(val
* self
) {
2857 long var
/* : Int */;
2858 long var1
/* : Int */;
2859 var1
= self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <self:HashSet[Object]> */
2865 /* method hash_collection#HashSet#length for (self: Object): Int */
2866 long VIRTUAL_hash_collection__HashSet__length(val
* self
) {
2867 long var
/* : Int */;
2868 long var1
/* : Int */;
2869 var1
= hash_collection__HashSet__length(self
);
2874 /* method hash_collection#HashSet#is_empty for (self: HashSet[Object]): Bool */
2875 short int hash_collection__HashSet__is_empty(val
* self
) {
2876 short int var
/* : Bool */;
2877 long var1
/* : Int */;
2878 long var2
/* : Int */;
2879 short int var3
/* : Bool */;
2880 short int var5
/* : Bool */;
2881 var1
= self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <self:HashSet[Object]> */
2883 { /* Inline kernel#Int#== (var1,var2) */
2884 var5
= var1
== var2
;
2894 /* method hash_collection#HashSet#is_empty for (self: Object): Bool */
2895 short int VIRTUAL_hash_collection__HashSet__is_empty(val
* self
) {
2896 short int var
/* : Bool */;
2897 short int var1
/* : Bool */;
2898 var1
= hash_collection__HashSet__is_empty(self
);
2903 /* method hash_collection#HashSet#first for (self: HashSet[Object]): Object */
2904 val
* hash_collection__HashSet__first(val
* self
) {
2905 val
* var
/* : Object */;
2906 long var1
/* : Int */;
2907 long var2
/* : Int */;
2908 short int var3
/* : Bool */;
2909 short int var5
/* : Bool */;
2912 const char* var_class_name
;
2913 short int var6
/* : Bool */;
2914 val
* var7
/* : nullable HashNode[Object] */;
2915 val
* var8
/* : Object */;
2916 var1
= self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
; /* _length on <self:HashSet[Object]> */
2918 { /* Inline kernel#Int#> (var1,var2) */
2919 /* Covariant cast for argument 0 (i) <var2:Int> isa OTHER */
2920 /* <var2:Int> isa OTHER */
2921 var5
= 1; /* easy <var2:Int> isa OTHER*/
2923 var_class_name
= type_kernel__Int
.name
;
2924 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name
);
2925 fprintf(stderr
, " (%s:%d)\n", "lib/standard/kernel.nit", 267);
2934 fprintf(stderr
, "Runtime error: %s", "Assert failed");
2935 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 406);
2938 var7
= self
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <self:HashSet[Object]> */
2940 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
2941 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 407);
2944 var8
= var7
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var7:nullable HashNode[Object](nullable HashSetNode[Object])> */
2946 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
2947 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 407);
2955 /* method hash_collection#HashSet#first for (self: Object): nullable Object */
2956 val
* VIRTUAL_hash_collection__HashSet__first(val
* self
) {
2957 val
* var
/* : nullable Object */;
2958 val
* var1
/* : Object */;
2959 var1
= hash_collection__HashSet__first(self
);
2964 /* method hash_collection#HashSet#has for (self: HashSet[Object], Object): Bool */
2965 short int hash_collection__HashSet__has(val
* self
, val
* p0
) {
2966 short int var
/* : Bool */;
2967 short int var1
/* : Bool */;
2970 const struct type
* type_struct
;
2971 const char* var_class_name
;
2972 val
* var_item
/* var item: Object */;
2973 val
* var2
/* : nullable HashNode[Object] */;
2974 val
* var3
/* : null */;
2975 short int var4
/* : Bool */;
2976 /* Covariant cast for argument 0 (item) <p0:Object> isa Collection#0 */
2977 /* <p0:Object> isa Collection#0 */
2978 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Collection_FT0
];
2979 cltype
= type_struct
->color
;
2980 idtype
= type_struct
->id
;
2981 if(cltype
>= p0
->type
->table_size
) {
2984 var1
= p0
->type
->type_table
[cltype
] == idtype
;
2987 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
2988 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection#0", var_class_name
);
2989 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 410);
2993 var2
= ((val
* (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__node_at
]))(self
, var_item
) /* node_at on <self:HashSet[Object]>*/;
2996 var4
= 0; /* is null */
2998 var4
= 1; /* arg is null and recv is not */
3005 /* method hash_collection#HashSet#has for (self: Object, nullable Object): Bool */
3006 short int VIRTUAL_hash_collection__HashSet__has(val
* self
, val
* p0
) {
3007 short int var
/* : Bool */;
3008 short int var1
/* : Bool */;
3009 var1
= hash_collection__HashSet__has(self
, p0
);
3014 /* method hash_collection#HashSet#add for (self: HashSet[Object], Object) */
3015 void hash_collection__HashSet__add(val
* self
, val
* p0
) {
3016 short int var
/* : Bool */;
3019 const struct type
* type_struct
;
3020 const char* var_class_name
;
3021 val
* var_item
/* var item: Object */;
3022 long var1
/* : Int */;
3023 long var_i
/* var i: Int */;
3024 val
* var2
/* : nullable HashNode[Object] */;
3025 val
* var_c
/* var c: nullable HashSetNode[Object] */;
3026 val
* var3
/* : null */;
3027 short int var4
/* : Bool */;
3028 val
* var5
/* : HashSetNode[Object] */;
3029 /* Covariant cast for argument 0 (item) <p0:Object> isa SimpleCollection#0 */
3030 /* <p0:Object> isa SimpleCollection#0 */
3031 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__SimpleCollection_FT0
];
3032 cltype
= type_struct
->color
;
3033 idtype
= type_struct
->id
;
3034 if(cltype
>= p0
->type
->table_size
) {
3037 var
= p0
->type
->type_table
[cltype
] == idtype
;
3040 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
3041 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "SimpleCollection#0", var_class_name
);
3042 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 415);
3046 var1
= ((long (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__index_at
]))(self
, var_item
) /* index_at on <self:HashSet[Object]>*/;
3048 var2
= ((val
* (*)(val
*, long, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__node_at_idx
]))(self
, var_i
, var_item
) /* node_at_idx on <self:HashSet[Object]>*/;
3051 if (var_c
== NULL
) {
3052 var4
= 0; /* is null */
3054 var4
= 1; /* arg is null and recv is not */
3057 var_c
->attrs
[COLOR_hash_collection__HashNode___key
].val
= var_item
; /* _key on <var_c:nullable HashSetNode[Object](HashSetNode[Object])> */
3059 var5
= NEW_hash_collection__HashSetNode(self
->type
->resolution_table
->types
[COLOR_hash_collection__HashSetNodehash_collection__HashSet_FT0
]);
3060 ((void (*)(val
*, val
*))(var5
->class->vft
[COLOR_hash_collection__HashSetNode__init
]))(var5
, var_item
) /* init on <var5:HashSetNode[Object]>*/;
3061 ((void (*)(val
*, long, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__store
]))(self
, var_i
, var5
) /* store on <self:HashSet[Object]>*/;
3065 /* method hash_collection#HashSet#add for (self: Object, nullable Object) */
3066 void VIRTUAL_hash_collection__HashSet__add(val
* self
, val
* p0
) {
3067 hash_collection__HashSet__add(self
, p0
);
3070 /* method hash_collection#HashSet#remove for (self: HashSet[Object], Object) */
3071 void hash_collection__HashSet__remove(val
* self
, val
* p0
) {
3072 short int var
/* : Bool */;
3075 const struct type
* type_struct
;
3076 const char* var_class_name
;
3077 val
* var_item
/* var item: Object */;
3078 /* Covariant cast for argument 0 (item) <p0:Object> isa RemovableCollection#0 */
3079 /* <p0:Object> isa RemovableCollection#0 */
3080 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__RemovableCollection_FT0
];
3081 cltype
= type_struct
->color
;
3082 idtype
= type_struct
->id
;
3083 if(cltype
>= p0
->type
->table_size
) {
3086 var
= p0
->type
->type_table
[cltype
] == idtype
;
3089 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
3090 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "RemovableCollection#0", var_class_name
);
3091 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 426);
3095 ((void (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__remove_node
]))(self
, var_item
) /* remove_node on <self:HashSet[Object]>*/;
3098 /* method hash_collection#HashSet#remove for (self: Object, nullable Object) */
3099 void VIRTUAL_hash_collection__HashSet__remove(val
* self
, val
* p0
) {
3100 hash_collection__HashSet__remove(self
, p0
);
3103 /* method hash_collection#HashSet#clear for (self: HashSet[Object]) */
3104 void hash_collection__HashSet__clear(val
* self
) {
3105 ((void (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__raz
]))(self
) /* raz on <self:HashSet[Object]>*/;
3108 /* method hash_collection#HashSet#clear for (self: Object) */
3109 void VIRTUAL_hash_collection__HashSet__clear(val
* self
) {
3110 hash_collection__HashSet__clear(self
);
3113 /* method hash_collection#HashSet#iterator for (self: HashSet[Object]): Iterator[Object] */
3114 val
* hash_collection__HashSet__iterator(val
* self
) {
3115 val
* var
/* : Iterator[Object] */;
3116 val
* var1
/* : HashSetIterator[Object] */;
3117 var1
= NEW_hash_collection__HashSetIterator(self
->type
->resolution_table
->types
[COLOR_hash_collection__HashSetIteratorhash_collection__HashSet_FT0
]);
3118 ((void (*)(val
*, val
*))(var1
->class->vft
[COLOR_hash_collection__HashSetIterator__init
]))(var1
, self
) /* init on <var1:HashSetIterator[Object]>*/;
3124 /* method hash_collection#HashSet#iterator for (self: Object): Iterator[nullable Object] */
3125 val
* VIRTUAL_hash_collection__HashSet__iterator(val
* self
) {
3126 val
* var
/* : Iterator[nullable Object] */;
3127 val
* var1
/* : Iterator[Object] */;
3128 var1
= hash_collection__HashSet__iterator(self
);
3133 /* method hash_collection#HashSet#init for (self: HashSet[Object]) */
3134 void hash_collection__HashSet__init(val
* self
) {
3135 long var
/* : Int */;
3136 long var1
/* : Int */;
3137 long var2
/* : Int */;
3138 ((void (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashCollection__init
]))(self
) /* init on <self:HashSet[Object]>*/;
3140 self
->attrs
[COLOR_hash_collection__HashCollection___capacity
].l
= var
; /* _capacity on <self:HashSet[Object]> */
3142 self
->attrs
[COLOR_hash_collection__HashCollection___length
].l
= var1
; /* _length on <self:HashSet[Object]> */
3144 ((void (*)(val
*, long))(self
->class->vft
[COLOR_hash_collection__HashCollection__enlarge
]))(self
, var2
) /* enlarge on <self:HashSet[Object]>*/;
3147 /* method hash_collection#HashSet#init for (self: Object) */
3148 void VIRTUAL_hash_collection__HashSet__init(val
* self
) {
3149 hash_collection__HashSet__init(self
);
3152 /* method hash_collection#HashSet#from for (self: HashSet[Object], Collection[Object]) */
3153 void hash_collection__HashSet__from(val
* self
, val
* p0
) {
3154 short int var
/* : Bool */;
3157 const struct type
* type_struct
;
3158 const char* var_class_name
;
3159 val
* var_coll
/* var coll: Collection[Object] */;
3160 /* Covariant cast for argument 0 (coll) <p0:Collection[Object]> isa Collection[HashSet#0] */
3161 /* <p0:Collection[Object]> isa Collection[HashSet#0] */
3162 type_struct
= self
->type
->resolution_table
->types
[COLOR_abstract_collection__Collectionhash_collection__HashSet_FT0
];
3163 cltype
= type_struct
->color
;
3164 idtype
= type_struct
->id
;
3165 if(cltype
>= p0
->type
->table_size
) {
3168 var
= p0
->type
->type_table
[cltype
] == idtype
;
3171 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
3172 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection[HashSet#0]", var_class_name
);
3173 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 439);
3177 ((void (*)(val
*))(self
->class->vft
[COLOR_hash_collection__HashSet__init
]))(self
) /* init on <self:HashSet[Object]>*/;
3178 ((void (*)(val
*, val
*))(self
->class->vft
[COLOR_abstract_collection__SimpleCollection__add_all
]))(self
, var_coll
) /* add_all on <self:HashSet[Object]>*/;
3181 /* method hash_collection#HashSet#from for (self: Object, Collection[Object]) */
3182 void VIRTUAL_hash_collection__HashSet__from(val
* self
, val
* p0
) {
3183 hash_collection__HashSet__from(self
, p0
);
3186 /* method hash_collection#HashSetNode#init for (self: HashSetNode[Object], Object) */
3187 void hash_collection__HashSetNode__init(val
* self
, val
* p0
) {
3188 short int var
/* : Bool */;
3191 const struct type
* type_struct
;
3192 const char* var_class_name
;
3193 val
* var_e
/* var e: Object */;
3194 /* Covariant cast for argument 0 (e) <p0:Object> isa HashSetNode#0 */
3195 /* <p0:Object> isa HashSetNode#0 */
3196 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashSetNode_FT0
];
3197 cltype
= type_struct
->color
;
3198 idtype
= type_struct
->id
;
3199 if(cltype
>= p0
->type
->table_size
) {
3202 var
= p0
->type
->type_table
[cltype
] == idtype
;
3205 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
3206 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashSetNode#0", var_class_name
);
3207 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 450);
3211 ((void (*)(val
*, val
*))(self
->class->vft
[COLOR_hash_collection__HashNode__init
]))(self
, p0
) /* init on <self:HashSetNode[Object]>*/;
3212 self
->attrs
[COLOR_hash_collection__HashNode___key
].val
= var_e
; /* _key on <self:HashSetNode[Object]> */
3215 /* method hash_collection#HashSetNode#init for (self: Object, Object) */
3216 void VIRTUAL_hash_collection__HashSetNode__init(val
* self
, val
* p0
) {
3217 hash_collection__HashSetNode__init(self
, p0
);
3220 /* method hash_collection#HashSetIterator#is_ok for (self: HashSetIterator[Object]): Bool */
3221 short int hash_collection__HashSetIterator__is_ok(val
* self
) {
3222 short int var
/* : Bool */;
3223 val
* var1
/* : nullable HashSetNode[Object] */;
3224 val
* var2
/* : null */;
3225 short int var3
/* : Bool */;
3226 var1
= self
->attrs
[COLOR_hash_collection__HashSetIterator___node
].val
; /* _node on <self:HashSetIterator[Object]> */
3229 var3
= 0; /* is null */
3231 var3
= 1; /* arg is null and recv is not */
3238 /* method hash_collection#HashSetIterator#is_ok for (self: Object): Bool */
3239 short int VIRTUAL_hash_collection__HashSetIterator__is_ok(val
* self
) {
3240 short int var
/* : Bool */;
3241 short int var1
/* : Bool */;
3242 var1
= hash_collection__HashSetIterator__is_ok(self
);
3247 /* method hash_collection#HashSetIterator#item for (self: HashSetIterator[Object]): Object */
3248 val
* hash_collection__HashSetIterator__item(val
* self
) {
3249 val
* var
/* : Object */;
3250 short int var1
/* : Bool */;
3251 val
* var2
/* : nullable HashSetNode[Object] */;
3252 val
* var3
/* : Object */;
3253 var1
= ((short int (*)(val
*))(self
->class->vft
[COLOR_abstract_collection__Iterator__is_ok
]))(self
) /* is_ok on <self:HashSetIterator[Object]>*/;
3255 fprintf(stderr
, "Runtime error: %s", "Assert failed");
3256 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 462);
3259 var2
= self
->attrs
[COLOR_hash_collection__HashSetIterator___node
].val
; /* _node on <self:HashSetIterator[Object]> */
3261 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
3262 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 463);
3265 var3
= var2
->attrs
[COLOR_hash_collection__HashNode___key
].val
; /* _key on <var2:nullable HashSetNode[Object]> */
3267 fprintf(stderr
, "Runtime error: %s", "Uninitialized attribute _key");
3268 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 463);
3276 /* method hash_collection#HashSetIterator#item for (self: Object): nullable Object */
3277 val
* VIRTUAL_hash_collection__HashSetIterator__item(val
* self
) {
3278 val
* var
/* : nullable Object */;
3279 val
* var1
/* : Object */;
3280 var1
= hash_collection__HashSetIterator__item(self
);
3285 /* method hash_collection#HashSetIterator#next for (self: HashSetIterator[Object]) */
3286 void hash_collection__HashSetIterator__next(val
* self
) {
3287 short int var
/* : Bool */;
3288 val
* var1
/* : nullable HashSetNode[Object] */;
3289 val
* var2
/* : nullable HashNode[Object] */;
3290 var
= ((short int (*)(val
*))(self
->class->vft
[COLOR_abstract_collection__Iterator__is_ok
]))(self
) /* is_ok on <self:HashSetIterator[Object]>*/;
3292 fprintf(stderr
, "Runtime error: %s", "Assert failed");
3293 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 468);
3296 var1
= self
->attrs
[COLOR_hash_collection__HashSetIterator___node
].val
; /* _node on <self:HashSetIterator[Object]> */
3298 fprintf(stderr
, "Runtime error: %s", "Receiver is null");
3299 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 469);
3302 var2
= var1
->attrs
[COLOR_hash_collection__HashNode___next_item
].val
; /* _next_item on <var1:nullable HashSetNode[Object]> */
3303 self
->attrs
[COLOR_hash_collection__HashSetIterator___node
].val
= var2
; /* _node on <self:HashSetIterator[Object]> */
3306 /* method hash_collection#HashSetIterator#next for (self: Object) */
3307 void VIRTUAL_hash_collection__HashSetIterator__next(val
* self
) {
3308 hash_collection__HashSetIterator__next(self
);
3311 /* method hash_collection#HashSetIterator#init for (self: HashSetIterator[Object], HashSet[Object]) */
3312 void hash_collection__HashSetIterator__init(val
* self
, val
* p0
) {
3313 short int var
/* : Bool */;
3316 const struct type
* type_struct
;
3317 const char* var_class_name
;
3318 val
* var_set
/* var set: HashSet[Object] */;
3319 val
* var1
/* : nullable HashNode[Object] */;
3320 /* Covariant cast for argument 0 (set) <p0:HashSet[Object]> isa HashSet[HashSetIterator#0] */
3321 /* <p0:HashSet[Object]> isa HashSet[HashSetIterator#0] */
3322 type_struct
= self
->type
->resolution_table
->types
[COLOR_hash_collection__HashSethash_collection__HashSetIterator_FT0
];
3323 cltype
= type_struct
->color
;
3324 idtype
= type_struct
->id
;
3325 if(cltype
>= p0
->type
->table_size
) {
3328 var
= p0
->type
->type_table
[cltype
] == idtype
;
3331 var_class_name
= p0
== NULL ?
"null" : p0
->type
->name
;
3332 fprintf(stderr
, "Runtime error: Cast failed. Expected `%s`, got `%s`", "HashSet[HashSetIterator#0]", var_class_name
);
3333 fprintf(stderr
, " (%s:%d)\n", "lib/standard/collection/hash_collection.nit", 478);
3337 self
->attrs
[COLOR_hash_collection__HashSetIterator___set
].val
= var_set
; /* _set on <self:HashSetIterator[Object]> */
3338 var1
= var_set
->attrs
[COLOR_hash_collection__HashCollection___first_item
].val
; /* _first_item on <var_set:HashSet[Object]> */
3339 self
->attrs
[COLOR_hash_collection__HashSetIterator___node
].val
= var1
; /* _node on <self:HashSetIterator[Object]> */
3342 /* method hash_collection#HashSetIterator#init for (self: Object, HashSet[Object]) */
3343 void VIRTUAL_hash_collection__HashSetIterator__init(val
* self
, val
* p0
) {
3344 hash_collection__HashSetIterator__init(self
, p0
);