X-Git-Url: http://nitlanguage.org diff --git a/c_src/core__bytes.sep.1.c b/c_src/core__bytes.sep.1.c index 311de57..8f11435 100644 --- a/c_src/core__bytes.sep.1.c +++ b/c_src/core__bytes.sep.1.c @@ -1,19 +1,19 @@ #include "core__bytes.sep.0.h" -/* method bytes#Bytes#items for (self: Bytes): NativeString */ +/* method bytes$Bytes$items for (self: Bytes): CString */ char* core___core__Bytes___items(val* self) { -char* var /* : NativeString */; -char* var1 /* : NativeString */; +char* var /* : CString */; +char* var1 /* : CString */; var1 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var = var1; RET_LABEL:; return var; } -/* method bytes#Bytes#items= for (self: Bytes, NativeString) */ +/* method bytes$Bytes$items= for (self: Bytes, CString) */ void core___core__Bytes___items_61d(val* self, char* p0) { self->attrs[COLOR_core__bytes__Bytes___items].str = p0; /* _items on */ RET_LABEL:; } -/* method bytes#Bytes#length for (self: Bytes): Int */ +/* method bytes$Bytes$length for (self: Bytes): Int */ long core___core__Bytes___core__abstract_collection__Collection__length(val* self) { long var /* : Int */; long var1 /* : Int */; @@ -22,12 +22,12 @@ var = var1; RET_LABEL:; return var; } -/* method bytes#Bytes#length= for (self: Bytes, Int) */ +/* method bytes$Bytes$length= for (self: Bytes, Int) */ void core___core__Bytes___core__array__AbstractArrayRead__length_61d(val* self, long p0) { self->attrs[COLOR_core__bytes__Bytes___length].l = p0; /* _length on */ RET_LABEL:; } -/* method bytes#Bytes#capacity for (self: Bytes): Int */ +/* method bytes$Bytes$capacity for (self: Bytes): Int */ long core___core__Bytes___capacity(val* self) { long var /* : Int */; long var1 /* : Int */; @@ -36,12 +36,12 @@ var = var1; RET_LABEL:; return var; } -/* method bytes#Bytes#capacity= for (self: Bytes, Int) */ +/* method bytes$Bytes$capacity= for (self: Bytes, Int) */ void core___core__Bytes___capacity_61d(val* self, long p0) { self->attrs[COLOR_core__bytes__Bytes___capacity].l = p0; /* _capacity on */ RET_LABEL:; } -/* method bytes#Bytes#persisted for (self: Bytes): Bool */ +/* method bytes$Bytes$persisted for (self: Bytes): Bool */ short int core___core__Bytes___persisted(val* self) { short int var /* : Bool */; short int var1 /* : Bool */; @@ -50,27 +50,37 @@ var = var1; RET_LABEL:; return var; } -/* method bytes#Bytes#persisted= for (self: Bytes, Bool) */ +/* method bytes$Bytes$persisted= for (self: Bytes, Bool) */ void core___core__Bytes___persisted_61d(val* self, short int p0) { self->attrs[COLOR_core__bytes__Bytes___persisted].s = p0; /* _persisted on */ RET_LABEL:; } -/* method bytes#Bytes#empty for (self: Bytes) */ +/* method bytes$Bytes$empty for (self: Bytes) */ void core___core__Bytes___empty(val* self) { -char* var /* : NativeString */; -char* var1 /* : NativeString */; -char* var3 /* : NativeString */; -char* var_ns /* var ns: NativeString */; -var = NULL/*special!*/; -{ -{ /* Inline native#NativeString#new (var,0l) on */ -var3 = (char*)nit_alloc(0l); -var1 = var3; -goto RET_LABEL2; -RET_LABEL2:(void)0; +static char* varoncenew; +static int varoncenew_guard; +char* var /* : CString */; +char* var1 /* : CString */; +char* var2 /* : CString */; +char* var4 /* : CString */; +char* var_ns /* var ns: CString */; +if (likely(varoncenew_guard)) { +var = varoncenew; +} else { +var1 = NULL/*special!*/; +var = var1; +varoncenew = var; +varoncenew_guard = 1; } +{ +{ /* Inline native$CString$new (var,0l) on */ +var4 = (char*)nit_alloc(0l); +var2 = var4; +goto RET_LABEL3; +RET_LABEL3:(void)0; } -var_ns = var1; +} +var_ns = var2; { ((void(*)(val* self, char* p0))(self->class->vft[COLOR_core__bytes__Bytes__items_61d]))(self, var_ns); /* items= on */ } @@ -85,24 +95,34 @@ var_ns = var1; } RET_LABEL:; } -/* method bytes#Bytes#with_capacity for (self: Bytes, Int) */ +/* method bytes$Bytes$with_capacity for (self: Bytes, Int) */ void core___core__Bytes___with_capacity(val* self, long p0) { long var_cap /* var cap: Int */; -char* var /* : NativeString */; -char* var1 /* : NativeString */; -char* var3 /* : NativeString */; -char* var_ns /* var ns: NativeString */; +static char* varoncenew; +static int varoncenew_guard; +char* var /* : CString */; +char* var1 /* : CString */; +char* var2 /* : CString */; +char* var4 /* : CString */; +char* var_ns /* var ns: CString */; var_cap = p0; -var = NULL/*special!*/; +if (likely(varoncenew_guard)) { +var = varoncenew; +} else { +var1 = NULL/*special!*/; +var = var1; +varoncenew = var; +varoncenew_guard = 1; +} { -{ /* Inline native#NativeString#new (var,var_cap) on */ -var3 = (char*)nit_alloc(var_cap); -var1 = var3; -goto RET_LABEL2; -RET_LABEL2:(void)0; +{ /* Inline native$CString$new (var,var_cap) on */ +var4 = (char*)nit_alloc(var_cap); +var2 = var4; +goto RET_LABEL3; +RET_LABEL3:(void)0; } } -var_ns = var1; +var_ns = var2; { ((void(*)(val* self, char* p0))(self->class->vft[COLOR_core__bytes__Bytes__items_61d]))(self, var_ns); /* items= on */ } @@ -117,7 +137,7 @@ var_ns = var1; } RET_LABEL:; } -/* method bytes#Bytes#is_empty for (self: Bytes): Bool */ +/* method bytes$Bytes$is_empty for (self: Bytes): Bool */ short int core___core__Bytes___core__abstract_collection__Collection__is_empty(val* self) { short int var /* : Bool */; long var1 /* : Int */; @@ -125,14 +145,14 @@ long var3 /* : Int */; short int var4 /* : Bool */; short int var6 /* : Bool */; { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var3 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var1 = var3; RET_LABEL2:(void)0; } } { -{ /* Inline kernel#Int#== (var1,0l) on */ +{ /* Inline kernel$Int$== (var1,0l) on */ var6 = var1 == 0l; var4 = var6; goto RET_LABEL5; @@ -144,7 +164,7 @@ goto RET_LABEL; RET_LABEL:; return var; } -/* method bytes#Bytes#[] for (self: Bytes, Int): Byte */ +/* method bytes$Bytes$[] for (self: Bytes, Int): Byte */ unsigned char core___core__Bytes___core__abstract_collection__SequenceRead___91d_93d(val* self, long p0) { unsigned char var /* : Byte */; long var_i /* var i: Int */; @@ -162,20 +182,20 @@ int cltype11; int idtype12; const char* var_class_name13; short int var14 /* : Bool */; -char* var15 /* : NativeString */; -char* var17 /* : NativeString */; +char* var15 /* : CString */; +char* var17 /* : CString */; unsigned char var18 /* : Byte */; unsigned char var20 /* : Byte */; var_i = p0; { -{ /* Inline kernel#Int#>= (var_i,0l) on */ +{ /* Inline kernel$Int$>= (var_i,0l) on */ /* Covariant cast for argument 0 (i) <0l:Int> isa OTHER */ /* <0l:Int> isa OTHER */ var3 = 1; /* easy <0l:Int> isa OTHER*/ if (unlikely(!var3)) { var_class_name = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 729); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726); fatal_exit(1); } var4 = var_i >= 0l; @@ -185,26 +205,29 @@ RET_LABEL2:(void)0; } } if (unlikely(!var1)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Assert failed"); PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 184); fatal_exit(1); } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var7 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var5 = var7; RET_LABEL6:(void)0; } } { -{ /* Inline kernel#Int#< (var_i,var5) on */ +{ /* Inline kernel$Int$< (var_i,var5) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var10 = 1; /* easy isa OTHER*/ if (unlikely(!var10)) { var_class_name13 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name13); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 725); fatal_exit(1); } var14 = var_i < var5; @@ -214,19 +237,22 @@ RET_LABEL9:(void)0; } } if (unlikely(!var8)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Assert failed"); PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 185); fatal_exit(1); } { -{ /* Inline bytes#Bytes#items (self) on */ +{ /* Inline bytes$Bytes$items (self) on */ var17 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var15 = var17; RET_LABEL16:(void)0; } } { -{ /* Inline native#NativeString#[] (var15,var_i) on */ +{ /* Inline native$CString$[] (var15,var_i) on */ var20 = (unsigned char)((int)var15[var_i]); var18 = var20; goto RET_LABEL19; @@ -238,7 +264,7 @@ goto RET_LABEL; RET_LABEL:; return var; } -/* method bytes#Bytes#[] for (self: SequenceRead[nullable Object], Int): nullable Object */ +/* method bytes$Bytes$[] for (self: SequenceRead[nullable Object], Int): nullable Object */ val* VIRTUAL_core___core__Bytes___core__abstract_collection__SequenceRead___91d_93d(val* self, long p0) { val* var /* : nullable Object */; unsigned char var1 /* : Byte */; @@ -249,7 +275,7 @@ var = var2; RET_LABEL:; return var; } -/* method bytes#Bytes#[]= for (self: Bytes, Int, Byte) */ +/* method bytes$Bytes$[]= for (self: Bytes, Int, Byte) */ void core___core__Bytes___core__abstract_collection__Sequence___91d_93d_61d(val* self, long p0, unsigned char p1) { short int var /* : Bool */; int cltype; @@ -277,21 +303,21 @@ long var21 /* : Int */; long var23 /* : Int */; short int var24 /* : Bool */; short int var26 /* : Bool */; -char* var27 /* : NativeString */; -char* var29 /* : NativeString */; +char* var27 /* : CString */; +char* var29 /* : CString */; /* Covariant cast for argument 1 (v) isa Byte */ /* isa Byte */ var = 1; /* easy isa Byte*/ if (unlikely(!var)) { var_class_name = type_core__Byte.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "Byte", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 268); +PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 370); fatal_exit(1); } var_i = p0; var_v = p1; { -{ /* Inline bytes#Bytes#persisted (self) on */ +{ /* Inline bytes$Bytes$persisted (self) on */ var3 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on */ var1 = var3; RET_LABEL2:(void)0; @@ -299,19 +325,19 @@ RET_LABEL2:(void)0; } if (var1){ { -core___core__Bytes___regen(self); /* Direct call bytes#Bytes#regen on */ +core___core__Bytes___regen(self); /* Direct call bytes$Bytes$regen on */ } } else { } { -{ /* Inline kernel#Int#>= (var_i,0l) on */ +{ /* Inline kernel$Int$>= (var_i,0l) on */ /* Covariant cast for argument 0 (i) <0l:Int> isa OTHER */ /* <0l:Int> isa OTHER */ var6 = 1; /* easy <0l:Int> isa OTHER*/ if (unlikely(!var6)) { var_class_name9 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name9); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 729); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726); fatal_exit(1); } var10 = var_i >= 0l; @@ -321,26 +347,29 @@ RET_LABEL5:(void)0; } } if (unlikely(!var4)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Assert failed"); -PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 273); +PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 375); fatal_exit(1); } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var13 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var11 = var13; RET_LABEL12:(void)0; } } { -{ /* Inline kernel#Int#<= (var_i,var11) on */ +{ /* Inline kernel$Int$<= (var_i,var11) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var16 = 1; /* easy isa OTHER*/ if (unlikely(!var16)) { var_class_name19 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name19); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 727); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 724); fatal_exit(1); } var20 = var_i <= var11; @@ -350,19 +379,22 @@ RET_LABEL15:(void)0; } } if (unlikely(!var14)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Assert failed"); -PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 274); +PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 376); fatal_exit(1); } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var23 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var21 = var23; RET_LABEL22:(void)0; } } { -{ /* Inline kernel#Int#== (var_i,var21) on */ +{ /* Inline kernel$Int$== (var_i,var21) on */ var26 = var_i == var21; var24 = var26; goto RET_LABEL25; @@ -371,33 +403,33 @@ RET_LABEL25:(void)0; } if (var24){ { -core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var_v); /* Direct call bytes#Bytes#add on */ +core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var_v); /* Direct call bytes$Bytes$add on */ } } else { } { -{ /* Inline bytes#Bytes#items (self) on */ +{ /* Inline bytes$Bytes$items (self) on */ var29 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var27 = var29; RET_LABEL28:(void)0; } } { -{ /* Inline native#NativeString#[]= (var27,var_i,var_v) on */ +{ /* Inline native$CString$[]= (var27,var_i,var_v) on */ var27[var_i]=(unsigned char)var_v; RET_LABEL30:(void)0; } } RET_LABEL:; } -/* method bytes#Bytes#[]= for (self: Sequence[nullable Object], Int, nullable Object) */ +/* method bytes$Bytes$[]= for (self: Sequence[nullable Object], Int, nullable Object) */ void VIRTUAL_core___core__Bytes___core__abstract_collection__Sequence___91d_93d_61d(val* self, long p0, val* p1) { unsigned char var /* : Byte */; var = ((struct instance_core__Byte*)p1)->value; /* autounbox from nullable Object to Byte */; -core___core__Bytes___core__abstract_collection__Sequence___91d_93d_61d(self, p0, var); /* Direct call bytes#Bytes#[]= on */ +core___core__Bytes___core__abstract_collection__Sequence___91d_93d_61d(self, p0, var); /* Direct call bytes$Bytes$[]= on */ RET_LABEL:; } -/* method bytes#Bytes#add for (self: Bytes, Byte) */ +/* method bytes$Bytes$add for (self: Bytes, Byte) */ void core___core__Bytes___core__abstract_collection__SimpleCollection__add(val* self, unsigned char p0) { short int var /* : Bool */; int cltype; @@ -418,8 +450,8 @@ const char* var_class_name15; short int var16 /* : Bool */; long var17 /* : Int */; long var19 /* : Int */; -char* var20 /* : NativeString */; -char* var22 /* : NativeString */; +char* var20 /* : CString */; +char* var22 /* : CString */; long var23 /* : Int */; long var25 /* : Int */; val* var_ /* var : Bytes */; @@ -437,12 +469,12 @@ var = 1; /* easy isa Byte*/ if (unlikely(!var)) { var_class_name = type_core__Byte.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "Byte", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 279); +PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 381); fatal_exit(1); } var_c = p0; { -{ /* Inline bytes#Bytes#persisted (self) on */ +{ /* Inline bytes$Bytes$persisted (self) on */ var3 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on */ var1 = var3; RET_LABEL2:(void)0; @@ -450,33 +482,33 @@ RET_LABEL2:(void)0; } if (var1){ { -core___core__Bytes___regen(self); /* Direct call bytes#Bytes#regen on */ +core___core__Bytes___regen(self); /* Direct call bytes$Bytes$regen on */ } } else { } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var6 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var4 = var6; RET_LABEL5:(void)0; } } { -{ /* Inline bytes#Bytes#capacity (self) on */ +{ /* Inline bytes$Bytes$capacity (self) on */ var9 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ var7 = var9; RET_LABEL8:(void)0; } } { -{ /* Inline kernel#Int#>= (var4,var7) on */ +{ /* Inline kernel$Int$>= (var4,var7) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var12 = 1; /* easy isa OTHER*/ if (unlikely(!var12)) { var_class_name15 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name15); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 729); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726); fatal_exit(1); } var16 = var4 >= var7; @@ -487,54 +519,54 @@ RET_LABEL11:(void)0; } if (var10){ { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var19 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var17 = var19; RET_LABEL18:(void)0; } } { -core___core__Bytes___core__array__AbstractArray__enlarge(self, var17); /* Direct call bytes#Bytes#enlarge on */ +core___core__Bytes___core__array__AbstractArray__enlarge(self, var17); /* Direct call bytes$Bytes$enlarge on */ } } else { } { -{ /* Inline bytes#Bytes#items (self) on */ +{ /* Inline bytes$Bytes$items (self) on */ var22 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var20 = var22; RET_LABEL21:(void)0; } } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var25 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var23 = var25; RET_LABEL24:(void)0; } } { -{ /* Inline native#NativeString#[]= (var20,var23,var_c) on */ +{ /* Inline native$CString$[]= (var20,var23,var_c) on */ var20[var23]=(unsigned char)var_c; RET_LABEL26:(void)0; } } var_ = self; { -{ /* Inline bytes#Bytes#length (var_) on */ +{ /* Inline bytes$Bytes$length (var_) on */ var29 = var_->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var27 = var29; RET_LABEL28:(void)0; } } { -{ /* Inline kernel#Int#+ (var27,1l) on */ +{ /* Inline kernel$Int$+ (var27,1l) on */ /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */ /* <1l:Int> isa OTHER */ var32 = 1; /* easy <1l:Int> isa OTHER*/ if (unlikely(!var32)) { var_class_name35 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name35); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); fatal_exit(1); } var36 = var27 + 1l; @@ -544,21 +576,146 @@ RET_LABEL31:(void)0; } } { -{ /* Inline bytes#Bytes#length= (var_,var30) on */ +{ /* Inline bytes$Bytes$length= (var_,var30) on */ var_->attrs[COLOR_core__bytes__Bytes___length].l = var30; /* _length on */ RET_LABEL37:(void)0; } } RET_LABEL:; } -/* method bytes#Bytes#add for (self: SimpleCollection[nullable Object], nullable Object) */ +/* method bytes$Bytes$add for (self: SimpleCollection[nullable Object], nullable Object) */ void VIRTUAL_core___core__Bytes___core__abstract_collection__SimpleCollection__add(val* self, val* p0) { unsigned char var /* : Byte */; var = ((struct instance_core__Byte*)p0)->value; /* autounbox from nullable Object to Byte */; -core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var); /* Direct call bytes#Bytes#add on */ +core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var); /* Direct call bytes$Bytes$add on */ RET_LABEL:; } -/* method bytes#Bytes#append for (self: Bytes, Collection[Byte]) */ +/* method bytes$Bytes$add_char for (self: Bytes, Char) */ +void core___core__Bytes___add_char(val* self, uint32_t p0) { +uint32_t var_c /* var c: Char */; +short int var /* : Bool */; +short int var2 /* : Bool */; +long var3 /* : Int */; +long var_cln /* var cln: Int */; +long var4 /* : Int */; +long var6 /* : Int */; +long var_ln /* var ln: Int */; +long var7 /* : Int */; +short int var9 /* : Bool */; +int cltype; +int idtype; +const char* var_class_name; +long var10 /* : Int */; +char* var11 /* : CString */; +char* var13 /* : CString */; +long var14 /* : Int */; +long var16 /* : Int */; +val* var_ /* var : Bytes */; +long var17 /* : Int */; +long var19 /* : Int */; +long var20 /* : Int */; +short int var22 /* : Bool */; +int cltype23; +int idtype24; +const char* var_class_name25; +long var26 /* : Int */; +var_c = p0; +{ +{ /* Inline bytes$Bytes$persisted (self) on */ +var2 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on */ +var = var2; +RET_LABEL1:(void)0; +} +} +if (var){ +{ +core___core__Bytes___regen(self); /* Direct call bytes$Bytes$regen on */ +} +} else { +} +{ +var3 = core__abstract_text___Char___u8char_len(var_c); +} +var_cln = var3; +{ +{ /* Inline bytes$Bytes$length (self) on */ +var6 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ +var4 = var6; +RET_LABEL5:(void)0; +} +} +var_ln = var4; +{ +{ /* Inline kernel$Int$+ (var_ln,var_cln) on */ +/* Covariant cast for argument 0 (i) isa OTHER */ +/* isa OTHER */ +var9 = 1; /* easy isa OTHER*/ +if (unlikely(!var9)) { +var_class_name = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +fatal_exit(1); +} +var10 = var_ln + var_cln; +var7 = var10; +goto RET_LABEL8; +RET_LABEL8:(void)0; +} +} +{ +core___core__Bytes___core__array__AbstractArray__enlarge(self, var7); /* Direct call bytes$Bytes$enlarge on */ +} +{ +{ /* Inline bytes$Bytes$items (self) on */ +var13 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ +var11 = var13; +RET_LABEL12:(void)0; +} +} +{ +{ /* Inline bytes$Bytes$length (self) on */ +var16 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ +var14 = var16; +RET_LABEL15:(void)0; +} +} +{ +core__flat___CString___set_char_at(var11, var14, var_c); /* Direct call flat$CString$set_char_at on */ +} +var_ = self; +{ +{ /* Inline bytes$Bytes$length (var_) on */ +var19 = var_->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ +var17 = var19; +RET_LABEL18:(void)0; +} +} +{ +{ /* Inline kernel$Int$+ (var17,var_cln) on */ +/* Covariant cast for argument 0 (i) isa OTHER */ +/* isa OTHER */ +var22 = 1; /* easy isa OTHER*/ +if (unlikely(!var22)) { +var_class_name25 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name25); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +fatal_exit(1); +} +var26 = var17 + var_cln; +var20 = var26; +goto RET_LABEL21; +RET_LABEL21:(void)0; +} +} +{ +{ /* Inline bytes$Bytes$length= (var_,var20) on */ +var_->attrs[COLOR_core__bytes__Bytes___length].l = var20; /* _length on */ +RET_LABEL27:(void)0; +} +} +RET_LABEL:; +} +/* method bytes$Bytes$append for (self: Bytes, Collection[Byte]) */ void core___core__Bytes___core__abstract_collection__Sequence__append(val* self, val* p0) { short int var /* : Bool */; int cltype; @@ -568,8 +725,8 @@ val* var_arr /* var arr: Collection[Byte] */; short int var1 /* : Bool */; int cltype2; int idtype3; -char* var4 /* : NativeString */; -char* var6 /* : NativeString */; +char* var4 /* : CString */; +char* var6 /* : CString */; long var7 /* : Int */; long var9 /* : Int */; val* var_ /* var : Collection[Byte] */; @@ -585,7 +742,7 @@ var = 1; /* easy isa Collection[Byte]*/ if (unlikely(!var)) { var_class_name = p0 == NULL ? "null" : (((long)p0&3)?type_info[((long)p0&3)]:p0->type)->name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "Collection[Byte]", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 306); +PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 408); fatal_exit(1); } var_arr = p0; @@ -599,21 +756,21 @@ var1 = (((long)var_arr&3)?type_info[((long)var_arr&3)]:var_arr->type)->type_tabl } if (var1){ { -{ /* Inline bytes#Bytes#items (var_arr) on */ +{ /* Inline bytes$Bytes$items (var_arr) on */ var6 = var_arr->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var4 = var6; RET_LABEL5:(void)0; } } { -{ /* Inline bytes#Bytes#length (var_arr) on */ +{ /* Inline bytes$Bytes$length (var_arr) on */ var9 = var_arr->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var7 = var9; RET_LABEL8:(void)0; } } { -core___core__Bytes___append_ns(self, var4, var7); /* Direct call bytes#Bytes#append_ns on */ +core___core__Bytes___append_ns(self, var4, var7); /* Direct call bytes$Bytes$append_ns on */ } } else { var_ = var_arr; @@ -635,7 +792,7 @@ var13 = ((val*(*)(val* self))((((long)var_11&3)?class_info[((long)var_11&3)]:var var14 = ((struct instance_core__Byte*)var13)->value; /* autounbox from nullable Object to Byte */; var_i = var14; { -core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var_i); /* Direct call bytes#Bytes#add on */ +core___core__Bytes___core__abstract_collection__SimpleCollection__add(self, var_i); /* Direct call bytes$Bytes$add on */ } { ((void(*)(val* self))((((long)var_11&3)?class_info[((long)var_11&3)]:var_11->class)->vft[COLOR_core__abstract_collection__Iterator__next]))(var_11); /* next on */ @@ -648,7 +805,7 @@ BREAK_label: (void)0; } RET_LABEL:; } -/* method bytes#Bytes#pop for (self: Bytes): Byte */ +/* method bytes$Bytes$pop for (self: Bytes): Byte */ unsigned char core___core__Bytes___core__abstract_collection__Sequence__pop(val* self) { unsigned char var /* : Byte */; long var1 /* : Int */; @@ -668,28 +825,28 @@ int cltype14; int idtype15; const char* var_class_name16; long var17 /* : Int */; -char* var19 /* : NativeString */; -char* var21 /* : NativeString */; +char* var19 /* : CString */; +char* var21 /* : CString */; long var22 /* : Int */; long var24 /* : Int */; unsigned char var25 /* : Byte */; unsigned char var27 /* : Byte */; { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var3 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var1 = var3; RET_LABEL2:(void)0; } } { -{ /* Inline kernel#Int#>= (var1,1l) on */ +{ /* Inline kernel$Int$>= (var1,1l) on */ /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */ /* <1l:Int> isa OTHER */ var6 = 1; /* easy <1l:Int> isa OTHER*/ if (unlikely(!var6)) { var_class_name = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 729); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726); fatal_exit(1); } var7 = var1 >= 1l; @@ -699,27 +856,30 @@ RET_LABEL5:(void)0; } } if (unlikely(!var4)) { +if(catchStack.cursor >= 0){ +longjmp(catchStack.envs[catchStack.cursor], 1); +} PRINT_ERROR("Runtime error: %s", "Assert failed"); -PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 322); +PRINT_ERROR(" (%s:%d)\n", FILE_core__bytes, 424); fatal_exit(1); } var_ = self; { -{ /* Inline bytes#Bytes#length (var_) on */ +{ /* Inline bytes$Bytes$length (var_) on */ var10 = var_->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var8 = var10; RET_LABEL9:(void)0; } } { -{ /* Inline kernel#Int#- (var8,1l) on */ +{ /* Inline kernel$Int$- (var8,1l) on */ /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */ /* <1l:Int> isa OTHER */ var13 = 1; /* easy <1l:Int> isa OTHER*/ if (unlikely(!var13)) { var_class_name16 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name16); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 734); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731); fatal_exit(1); } var17 = var8 - 1l; @@ -729,27 +889,27 @@ RET_LABEL12:(void)0; } } { -{ /* Inline bytes#Bytes#length= (var_,var11) on */ +{ /* Inline bytes$Bytes$length= (var_,var11) on */ var_->attrs[COLOR_core__bytes__Bytes___length].l = var11; /* _length on */ RET_LABEL18:(void)0; } } { -{ /* Inline bytes#Bytes#items (self) on */ +{ /* Inline bytes$Bytes$items (self) on */ var21 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var19 = var21; RET_LABEL20:(void)0; } } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var24 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var22 = var24; RET_LABEL23:(void)0; } } { -{ /* Inline native#NativeString#[] (var19,var22) on */ +{ /* Inline native$CString$[] (var19,var22) on */ var27 = (unsigned char)((int)var19[var22]); var25 = var27; goto RET_LABEL26; @@ -761,7 +921,7 @@ goto RET_LABEL; RET_LABEL:; return var; } -/* method bytes#Bytes#pop for (self: Sequence[nullable Object]): nullable Object */ +/* method bytes$Bytes$pop for (self: Sequence[nullable Object]): nullable Object */ val* VIRTUAL_core___core__Bytes___core__abstract_collection__Sequence__pop(val* self) { val* var /* : nullable Object */; unsigned char var1 /* : Byte */; @@ -772,76 +932,86 @@ var = var2; RET_LABEL:; return var; } -/* method bytes#Bytes#clear for (self: Bytes) */ +/* method bytes$Bytes$clear for (self: Bytes) */ void core___core__Bytes___core__abstract_collection__RemovableCollection__clear(val* self) { { -{ /* Inline bytes#Bytes#length= (self,0l) on */ +{ /* Inline bytes$Bytes$length= (self,0l) on */ self->attrs[COLOR_core__bytes__Bytes___length].l = 0l; /* _length on */ RET_LABEL1:(void)0; } } RET_LABEL:; } -/* method bytes#Bytes#regen for (self: Bytes) */ +/* method bytes$Bytes$regen for (self: Bytes) */ void core___core__Bytes___regen(val* self) { -char* var /* : NativeString */; -long var1 /* : Int */; -long var3 /* : Int */; -char* var4 /* : NativeString */; -char* var6 /* : NativeString */; -char* var_nns /* var nns: NativeString */; -char* var7 /* : NativeString */; -char* var9 /* : NativeString */; -long var10 /* : Int */; -long var12 /* : Int */; -var = NULL/*special!*/; +static char* varoncenew; +static int varoncenew_guard; +char* var /* : CString */; +char* var1 /* : CString */; +long var2 /* : Int */; +long var4 /* : Int */; +char* var5 /* : CString */; +char* var7 /* : CString */; +char* var_nns /* var nns: CString */; +char* var8 /* : CString */; +char* var10 /* : CString */; +long var11 /* : Int */; +long var13 /* : Int */; +if (likely(varoncenew_guard)) { +var = varoncenew; +} else { +var1 = NULL/*special!*/; +var = var1; +varoncenew = var; +varoncenew_guard = 1; +} { -{ /* Inline bytes#Bytes#capacity (self) on */ -var3 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ -var1 = var3; -RET_LABEL2:(void)0; +{ /* Inline bytes$Bytes$capacity (self) on */ +var4 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ +var2 = var4; +RET_LABEL3:(void)0; } } { -{ /* Inline native#NativeString#new (var,var1) on */ -var6 = (char*)nit_alloc(var1); -var4 = var6; -goto RET_LABEL5; -RET_LABEL5:(void)0; +{ /* Inline native$CString$new (var,var2) on */ +var7 = (char*)nit_alloc(var2); +var5 = var7; +goto RET_LABEL6; +RET_LABEL6:(void)0; } } -var_nns = var4; +var_nns = var5; { -{ /* Inline bytes#Bytes#items (self) on */ -var9 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ -var7 = var9; -RET_LABEL8:(void)0; +{ /* Inline bytes$Bytes$items (self) on */ +var10 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ +var8 = var10; +RET_LABEL9:(void)0; } } { -{ /* Inline bytes#Bytes#length (self) on */ -var12 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ -var10 = var12; -RET_LABEL11:(void)0; +{ /* Inline bytes$Bytes$length (self) on */ +var13 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ +var11 = var13; +RET_LABEL12:(void)0; } } { -{ /* Inline native#NativeString#copy_to (var7,var_nns,var10,0l,0l) on */ -memmove(var_nns+0l,var7+0l,var10); -RET_LABEL13:(void)0; +{ /* Inline native$CString$copy_to (var8,var_nns,var11,0l,0l) on */ +memmove(var_nns+0l,var8+0l,var11); +RET_LABEL14:(void)0; } } { -{ /* Inline bytes#Bytes#persisted= (self,0) on */ +{ /* Inline bytes$Bytes$persisted= (self,0) on */ self->attrs[COLOR_core__bytes__Bytes___persisted].s = 0; /* _persisted on */ -RET_LABEL14:(void)0; +RET_LABEL15:(void)0; } } RET_LABEL:; } -/* method bytes#Bytes#append_ns for (self: Bytes, NativeString, Int) */ +/* method bytes$Bytes$append_ns for (self: Bytes, CString, Int) */ void core___core__Bytes___append_ns(val* self, char* p0, long p1) { -char* var_ns /* var ns: NativeString */; +char* var_ns /* var ns: CString */; long var_ln /* var ln: Int */; short int var /* : Bool */; short int var2 /* : Bool */; @@ -862,8 +1032,8 @@ int cltype16; int idtype17; const char* var_class_name18; short int var19 /* : Bool */; -char* var20 /* : NativeString */; -char* var22 /* : NativeString */; +char* var20 /* : CString */; +char* var22 /* : CString */; long var23 /* : Int */; long var25 /* : Int */; val* var_ /* var : Bytes */; @@ -878,7 +1048,7 @@ long var36 /* : Int */; var_ns = p0; var_ln = p1; { -{ /* Inline bytes#Bytes#persisted (self) on */ +{ /* Inline bytes$Bytes$persisted (self) on */ var2 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on */ var = var2; RET_LABEL1:(void)0; @@ -886,26 +1056,26 @@ RET_LABEL1:(void)0; } if (var){ { -core___core__Bytes___regen(self); /* Direct call bytes#Bytes#regen on */ +core___core__Bytes___regen(self); /* Direct call bytes$Bytes$regen on */ } } else { } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var5 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var3 = var5; RET_LABEL4:(void)0; } } { -{ /* Inline kernel#Int#+ (var3,var_ln) on */ +{ /* Inline kernel$Int$+ (var3,var_ln) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var8 = 1; /* easy isa OTHER*/ if (unlikely(!var8)) { var_class_name = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); fatal_exit(1); } var9 = var3 + var_ln; @@ -916,21 +1086,21 @@ RET_LABEL7:(void)0; } var_nlen = var6; { -{ /* Inline bytes#Bytes#capacity (self) on */ +{ /* Inline bytes$Bytes$capacity (self) on */ var12 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ var10 = var12; RET_LABEL11:(void)0; } } { -{ /* Inline kernel#Int#> (var_nlen,var10) on */ +{ /* Inline kernel$Int$> (var_nlen,var10) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var15 = 1; /* easy isa OTHER*/ if (unlikely(!var15)) { var_class_name18 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name18); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 730); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 727); fatal_exit(1); } var19 = var_nlen > var10; @@ -941,47 +1111,47 @@ RET_LABEL14:(void)0; } if (var13){ { -core___core__Bytes___core__array__AbstractArray__enlarge(self, var_nlen); /* Direct call bytes#Bytes#enlarge on */ +core___core__Bytes___core__array__AbstractArray__enlarge(self, var_nlen); /* Direct call bytes$Bytes$enlarge on */ } } else { } { -{ /* Inline bytes#Bytes#items (self) on */ +{ /* Inline bytes$Bytes$items (self) on */ var22 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var20 = var22; RET_LABEL21:(void)0; } } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var25 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var23 = var25; RET_LABEL24:(void)0; } } { -{ /* Inline native#NativeString#copy_to (var_ns,var20,var_ln,0l,var23) on */ +{ /* Inline native$CString$copy_to (var_ns,var20,var_ln,0l,var23) on */ memmove(var20+var23,var_ns+0l,var_ln); RET_LABEL26:(void)0; } } var_ = self; { -{ /* Inline bytes#Bytes#length (var_) on */ +{ /* Inline bytes$Bytes$length (var_) on */ var29 = var_->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var27 = var29; RET_LABEL28:(void)0; } } { -{ /* Inline kernel#Int#+ (var27,var_ln) on */ +{ /* Inline kernel$Int$+ (var27,var_ln) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var32 = 1; /* easy isa OTHER*/ if (unlikely(!var32)) { var_class_name35 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name35); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); fatal_exit(1); } var36 = var27 + var_ln; @@ -991,16 +1161,16 @@ RET_LABEL31:(void)0; } } { -{ /* Inline bytes#Bytes#length= (var_,var30) on */ +{ /* Inline bytes$Bytes$length= (var_,var30) on */ var_->attrs[COLOR_core__bytes__Bytes___length].l = var30; /* _length on */ RET_LABEL37:(void)0; } } RET_LABEL:; } -/* method bytes#Bytes#append_ns_from for (self: Bytes, NativeString, Int, Int) */ +/* method bytes$Bytes$append_ns_from for (self: Bytes, CString, Int, Int) */ void core___core__Bytes___append_ns_from(val* self, char* p0, long p1, long p2) { -char* var_ns /* var ns: NativeString */; +char* var_ns /* var ns: CString */; long var_ln /* var ln: Int */; long var_from /* var from: Int */; short int var /* : Bool */; @@ -1022,8 +1192,8 @@ int cltype16; int idtype17; const char* var_class_name18; short int var19 /* : Bool */; -char* var20 /* : NativeString */; -char* var22 /* : NativeString */; +char* var20 /* : CString */; +char* var22 /* : CString */; long var23 /* : Int */; long var25 /* : Int */; val* var_ /* var : Bytes */; @@ -1039,7 +1209,7 @@ var_ns = p0; var_ln = p1; var_from = p2; { -{ /* Inline bytes#Bytes#persisted (self) on */ +{ /* Inline bytes$Bytes$persisted (self) on */ var2 = self->attrs[COLOR_core__bytes__Bytes___persisted].s; /* _persisted on */ var = var2; RET_LABEL1:(void)0; @@ -1047,26 +1217,26 @@ RET_LABEL1:(void)0; } if (var){ { -core___core__Bytes___regen(self); /* Direct call bytes#Bytes#regen on */ +core___core__Bytes___regen(self); /* Direct call bytes$Bytes$regen on */ } } else { } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var5 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var3 = var5; RET_LABEL4:(void)0; } } { -{ /* Inline kernel#Int#+ (var3,var_ln) on */ +{ /* Inline kernel$Int$+ (var3,var_ln) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var8 = 1; /* easy isa OTHER*/ if (unlikely(!var8)) { var_class_name = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); fatal_exit(1); } var9 = var3 + var_ln; @@ -1077,21 +1247,21 @@ RET_LABEL7:(void)0; } var_nlen = var6; { -{ /* Inline bytes#Bytes#capacity (self) on */ +{ /* Inline bytes$Bytes$capacity (self) on */ var12 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ var10 = var12; RET_LABEL11:(void)0; } } { -{ /* Inline kernel#Int#> (var_nlen,var10) on */ +{ /* Inline kernel$Int$> (var_nlen,var10) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var15 = 1; /* easy isa OTHER*/ if (unlikely(!var15)) { var_class_name18 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name18); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 730); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 727); fatal_exit(1); } var19 = var_nlen > var10; @@ -1102,47 +1272,47 @@ RET_LABEL14:(void)0; } if (var13){ { -core___core__Bytes___core__array__AbstractArray__enlarge(self, var_nlen); /* Direct call bytes#Bytes#enlarge on */ +core___core__Bytes___core__array__AbstractArray__enlarge(self, var_nlen); /* Direct call bytes$Bytes$enlarge on */ } } else { } { -{ /* Inline bytes#Bytes#items (self) on */ +{ /* Inline bytes$Bytes$items (self) on */ var22 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var20 = var22; RET_LABEL21:(void)0; } } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var25 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var23 = var25; RET_LABEL24:(void)0; } } { -{ /* Inline native#NativeString#copy_to (var_ns,var20,var_ln,var_from,var23) on */ +{ /* Inline native$CString$copy_to (var_ns,var20,var_ln,var_from,var23) on */ memmove(var20+var23,var_ns+var_from,var_ln); RET_LABEL26:(void)0; } } var_ = self; { -{ /* Inline bytes#Bytes#length (var_) on */ +{ /* Inline bytes$Bytes$length (var_) on */ var29 = var_->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var27 = var29; RET_LABEL28:(void)0; } } { -{ /* Inline kernel#Int#+ (var27,var_ln) on */ +{ /* Inline kernel$Int$+ (var27,var_ln) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var32 = 1; /* easy isa OTHER*/ if (unlikely(!var32)) { var_class_name35 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name35); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); fatal_exit(1); } var36 = var27 + var_ln; @@ -1152,14 +1322,14 @@ RET_LABEL31:(void)0; } } { -{ /* Inline bytes#Bytes#length= (var_,var30) on */ +{ /* Inline bytes$Bytes$length= (var_,var30) on */ var_->attrs[COLOR_core__bytes__Bytes___length].l = var30; /* _length on */ RET_LABEL37:(void)0; } } RET_LABEL:; } -/* method bytes#Bytes#enlarge for (self: Bytes, Int) */ +/* method bytes$Bytes$enlarge for (self: Bytes, Int) */ void core___core__Bytes___core__array__AbstractArray__enlarge(val* self, long p0) { long var_sz /* var sz: Int */; long var /* : Int */; @@ -1192,33 +1362,36 @@ int cltype31; int idtype32; const char* var_class_name33; long var34 /* : Int */; -char* var36 /* : NativeString */; -long var37 /* : Int */; -long var39 /* : Int */; -char* var40 /* : NativeString */; -char* var42 /* : NativeString */; -char* var_ns /* var ns: NativeString */; -char* var43 /* : NativeString */; -char* var45 /* : NativeString */; -long var46 /* : Int */; -long var48 /* : Int */; +static char* varoncenew; +static int varoncenew_guard; +char* var36 /* : CString */; +char* var37 /* : CString */; +long var38 /* : Int */; +long var40 /* : Int */; +char* var41 /* : CString */; +char* var43 /* : CString */; +char* var_ns /* var ns: CString */; +char* var44 /* : CString */; +char* var46 /* : CString */; +long var47 /* : Int */; +long var49 /* : Int */; var_sz = p0; { -{ /* Inline bytes#Bytes#capacity (self) on */ +{ /* Inline bytes$Bytes$capacity (self) on */ var2 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ var = var2; RET_LABEL1:(void)0; } } { -{ /* Inline kernel#Int#>= (var,var_sz) on */ +{ /* Inline kernel$Int$>= (var,var_sz) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var5 = 1; /* easy isa OTHER*/ if (unlikely(!var5)) { var_class_name = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 729); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 726); fatal_exit(1); } var6 = var >= var_sz; @@ -1232,28 +1405,28 @@ goto RET_LABEL; } else { } { -{ /* Inline bytes#Bytes#persisted= (self,0) on */ +{ /* Inline bytes$Bytes$persisted= (self,0) on */ self->attrs[COLOR_core__bytes__Bytes___persisted].s = 0; /* _persisted on */ RET_LABEL7:(void)0; } } for(;;) { { -{ /* Inline bytes#Bytes#capacity (self) on */ +{ /* Inline bytes$Bytes$capacity (self) on */ var10 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ var8 = var10; RET_LABEL9:(void)0; } } { -{ /* Inline kernel#Int#< (var8,var_sz) on */ +{ /* Inline kernel$Int$< (var8,var_sz) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var13 = 1; /* easy isa OTHER*/ if (unlikely(!var13)) { var_class_name16 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name16); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 725); fatal_exit(1); } var17 = var8 < var_sz; @@ -1264,21 +1437,21 @@ RET_LABEL12:(void)0; } if (var11){ { -{ /* Inline bytes#Bytes#capacity (self) on */ +{ /* Inline bytes$Bytes$capacity (self) on */ var20 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ var18 = var20; RET_LABEL19:(void)0; } } { -{ /* Inline kernel#Int#* (var18,2l) on */ +{ /* Inline kernel$Int$* (var18,2l) on */ /* Covariant cast for argument 0 (i) <2l:Int> isa OTHER */ /* <2l:Int> isa OTHER */ var23 = 1; /* easy <2l:Int> isa OTHER*/ if (unlikely(!var23)) { var_class_name26 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name26); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 735); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 732); fatal_exit(1); } var27 = var18 * 2l; @@ -1288,14 +1461,14 @@ RET_LABEL22:(void)0; } } { -{ /* Inline kernel#Int#+ (var21,2l) on */ +{ /* Inline kernel$Int$+ (var21,2l) on */ /* Covariant cast for argument 0 (i) <2l:Int> isa OTHER */ /* <2l:Int> isa OTHER */ var30 = 1; /* easy <2l:Int> isa OTHER*/ if (unlikely(!var30)) { var_class_name33 = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name33); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); fatal_exit(1); } var34 = var21 + 2l; @@ -1305,7 +1478,7 @@ RET_LABEL29:(void)0; } } { -{ /* Inline bytes#Bytes#capacity= (self,var28) on */ +{ /* Inline bytes$Bytes$capacity= (self,var28) on */ self->attrs[COLOR_core__bytes__Bytes___capacity].l = var28; /* _capacity on */ RET_LABEL35:(void)0; } @@ -1315,118 +1488,129 @@ goto BREAK_label; } } BREAK_label: (void)0; -var36 = NULL/*special!*/; +if (likely(varoncenew_guard)) { +var36 = varoncenew; +} else { +var37 = NULL/*special!*/; +var36 = var37; +varoncenew = var36; +varoncenew_guard = 1; +} { -{ /* Inline bytes#Bytes#capacity (self) on */ -var39 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ -var37 = var39; -RET_LABEL38:(void)0; +{ /* Inline bytes$Bytes$capacity (self) on */ +var40 = self->attrs[COLOR_core__bytes__Bytes___capacity].l; /* _capacity on */ +var38 = var40; +RET_LABEL39:(void)0; } } { -{ /* Inline native#NativeString#new (var36,var37) on */ -var42 = (char*)nit_alloc(var37); -var40 = var42; -goto RET_LABEL41; -RET_LABEL41:(void)0; +{ /* Inline native$CString$new (var36,var38) on */ +var43 = (char*)nit_alloc(var38); +var41 = var43; +goto RET_LABEL42; +RET_LABEL42:(void)0; } } -var_ns = var40; +var_ns = var41; { -{ /* Inline bytes#Bytes#items (self) on */ -var45 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ -var43 = var45; -RET_LABEL44:(void)0; +{ /* Inline bytes$Bytes$items (self) on */ +var46 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ +var44 = var46; +RET_LABEL45:(void)0; } } { -{ /* Inline bytes#Bytes#length (self) on */ -var48 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ -var46 = var48; -RET_LABEL47:(void)0; +{ /* Inline bytes$Bytes$length (self) on */ +var49 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ +var47 = var49; +RET_LABEL48:(void)0; } } { -{ /* Inline native#NativeString#copy_to (var43,var_ns,var46,0l,0l) on */ -memmove(var_ns+0l,var43+0l,var46); -RET_LABEL49:(void)0; +{ /* Inline native$CString$copy_to (var44,var_ns,var47,0l,0l) on */ +memmove(var_ns+0l,var44+0l,var47); +RET_LABEL50:(void)0; } } { -{ /* Inline bytes#Bytes#items= (self,var_ns) on */ +{ /* Inline bytes$Bytes$items= (self,var_ns) on */ self->attrs[COLOR_core__bytes__Bytes___items].str = var_ns; /* _items on */ -RET_LABEL50:(void)0; +RET_LABEL51:(void)0; } } RET_LABEL:; } -/* method bytes#Bytes#to_s for (self: Bytes): String */ +/* method bytes$Bytes$to_s for (self: Bytes): String */ val* core___core__Bytes___core__abstract_text__Object__to_s(val* self) { val* var /* : String */; val* var_b /* var b: Bytes */; -char* var2 /* : NativeString */; -char* var4 /* : NativeString */; +char* var2 /* : CString */; +char* var4 /* : CString */; long var5 /* : Int */; long var7 /* : Int */; -val* var8 /* : FlatString */; -val* var_r /* var r: FlatString */; -char* var9 /* : NativeString */; -char* var11 /* : NativeString */; -short int var12 /* : Bool */; +val* var8 /* : String */; +val* var9 /* : nullable Int */; +val* var10 /* : nullable Bool */; +val* var_r /* var r: String */; +char* var11 /* : CString */; +char* var13 /* : CString */; +short int var14 /* : Bool */; val* var_other /* var other: nullable Object */; -val* var14 /* : nullable Object */; -short int var15 /* : Bool */; -short int var16 /* : Bool */; +val* var16 /* : nullable Object */; +short int var17 /* : Bool */; +short int var18 /* : Bool */; { -{ /* Inline bytes#Bytes#persisted= (self,1) on */ +{ /* Inline bytes$Bytes$persisted= (self,1) on */ self->attrs[COLOR_core__bytes__Bytes___persisted].s = 1; /* _persisted on */ RET_LABEL1:(void)0; } } var_b = self; { -{ /* Inline bytes#Bytes#items (var_b) on */ +{ /* Inline bytes$Bytes$items (var_b) on */ var4 = var_b->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var2 = var4; RET_LABEL3:(void)0; } } { -{ /* Inline bytes#Bytes#length (self) on */ +{ /* Inline bytes$Bytes$length (self) on */ var7 = self->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var5 = var7; RET_LABEL6:(void)0; } } { -var8 = core__flat___NativeString___to_s_with_length(var2, var5); +var9 = (val*)(var5<<2|1); +var10 = (val*)((long)(0)<<2|3); +var8 = core__flat___CString___to_s_unsafe(var2, var9, ((val*)NULL), var10, ((val*)NULL)); } var_r = var8; { -{ /* Inline bytes#Bytes#items (self) on */ -var11 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ -var9 = var11; -RET_LABEL10:(void)0; +{ /* Inline bytes$Bytes$items (self) on */ +var13 = self->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ +var11 = var13; +RET_LABEL12:(void)0; } } { -{ /* Inline kernel#Object#!= (var_r,var9) on */ -var14 = BOX_core__NativeString(var9); /* autobox from NativeString to nullable Object */ -var_other = var14; +{ /* Inline kernel$Object$!= (var_r,var11) on */ +var16 = BOX_core__CString(var11); /* autobox from CString to nullable Object */ +var_other = var16; { -var15 = ((short int(*)(val* self, val* p0))(var_r->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_r, var_other); /* == on */ +var17 = ((short int(*)(val* self, val* p0))(var_r->class->vft[COLOR_core__kernel__Object___61d_61d]))(var_r, var_other); /* == on */ } -var16 = !var15; -var12 = var16; -goto RET_LABEL13; -RET_LABEL13:(void)0; +var18 = !var17; +var14 = var18; +goto RET_LABEL15; +RET_LABEL15:(void)0; } } -if (var12){ +if (var14){ { -{ /* Inline bytes#Bytes#persisted= (self,0) on */ +{ /* Inline bytes$Bytes$persisted= (self,0) on */ self->attrs[COLOR_core__bytes__Bytes___persisted].s = 0; /* _persisted on */ -RET_LABEL17:(void)0; +RET_LABEL19:(void)0; } } } else { @@ -1436,41 +1620,41 @@ goto RET_LABEL; RET_LABEL:; return var; } -/* method bytes#Bytes#iterator for (self: Bytes): Iterator[Byte] */ +/* method bytes$Bytes$iterator for (self: Bytes): Iterator[Byte] */ val* core___core__Bytes___core__abstract_collection__Collection__iterator(val* self) { val* var /* : Iterator[Byte] */; val* var1 /* : BytesIterator */; var1 = NEW_core__bytes__BytesIterator(&type_core__bytes__BytesIterator); { -core__bytes___core__bytes__BytesIterator___with_buffer(var1, self); /* Direct call bytes#BytesIterator#with_buffer on */ +core__bytes___core__bytes__BytesIterator___with_buffer(var1, self); /* Direct call bytes$BytesIterator$with_buffer on */ } var = var1; goto RET_LABEL; RET_LABEL:; return var; } -/* method bytes#Bytes#init for (self: Bytes) */ +/* method bytes$Bytes$init for (self: Bytes) */ void core___core__Bytes___core__kernel__Object__init(val* self) { { ((void(*)(val* self))(self->class->vft[COLOR_core___core__Bytes___core__kernel__Object__init]))(self); /* init on */ } RET_LABEL:; } -/* method bytes#BytesIterator#tgt for (self: BytesIterator): NativeString */ +/* method bytes$BytesIterator$tgt for (self: BytesIterator): CString */ char* core__bytes___core__bytes__BytesIterator___tgt(val* self) { -char* var /* : NativeString */; -char* var1 /* : NativeString */; +char* var /* : CString */; +char* var1 /* : CString */; var1 = self->attrs[COLOR_core__bytes__BytesIterator___tgt].str; /* _tgt on */ var = var1; RET_LABEL:; return var; } -/* method bytes#BytesIterator#tgt= for (self: BytesIterator, NativeString) */ +/* method bytes$BytesIterator$tgt= for (self: BytesIterator, CString) */ void core__bytes___core__bytes__BytesIterator___tgt_61d(val* self, char* p0) { self->attrs[COLOR_core__bytes__BytesIterator___tgt].str = p0; /* _tgt on */ RET_LABEL:; } -/* method bytes#BytesIterator#index for (self: BytesIterator): Int */ +/* method bytes$BytesIterator$index for (self: BytesIterator): Int */ long core__bytes___core__bytes__BytesIterator___core__abstract_collection__IndexedIterator__index(val* self) { long var /* : Int */; long var1 /* : Int */; @@ -1479,12 +1663,12 @@ var = var1; RET_LABEL:; return var; } -/* method bytes#BytesIterator#index= for (self: BytesIterator, Int) */ +/* method bytes$BytesIterator$index= for (self: BytesIterator, Int) */ void core__bytes___core__bytes__BytesIterator___index_61d(val* self, long p0) { self->attrs[COLOR_core__bytes__BytesIterator___index].l = p0; /* _index on */ RET_LABEL:; } -/* method bytes#BytesIterator#max for (self: BytesIterator): Int */ +/* method bytes$BytesIterator$max for (self: BytesIterator): Int */ long core__bytes___core__bytes__BytesIterator___max(val* self) { long var /* : Int */; long var1 /* : Int */; @@ -1493,28 +1677,28 @@ var = var1; RET_LABEL:; return var; } -/* method bytes#BytesIterator#max= for (self: BytesIterator, Int) */ +/* method bytes$BytesIterator$max= for (self: BytesIterator, Int) */ void core__bytes___core__bytes__BytesIterator___max_61d(val* self, long p0) { self->attrs[COLOR_core__bytes__BytesIterator___max].l = p0; /* _max on */ RET_LABEL:; } -/* method bytes#BytesIterator#with_buffer for (self: BytesIterator, Bytes) */ +/* method bytes$BytesIterator$with_buffer for (self: BytesIterator, Bytes) */ void core__bytes___core__bytes__BytesIterator___with_buffer(val* self, val* p0) { val* var_b /* var b: Bytes */; -char* var /* : NativeString */; -char* var2 /* : NativeString */; +char* var /* : CString */; +char* var2 /* : CString */; long var3 /* : Int */; long var5 /* : Int */; var_b = p0; { -{ /* Inline bytes#Bytes#items (var_b) on */ +{ /* Inline bytes$Bytes$items (var_b) on */ var2 = var_b->attrs[COLOR_core__bytes__Bytes___items].str; /* _items on */ var = var2; RET_LABEL1:(void)0; } } { -{ /* Inline bytes#Bytes#length (var_b) on */ +{ /* Inline bytes$Bytes$length (var_b) on */ var5 = var_b->attrs[COLOR_core__bytes__Bytes___length].l; /* _length on */ var3 = var5; RET_LABEL4:(void)0; @@ -1534,7 +1718,7 @@ RET_LABEL4:(void)0; } RET_LABEL:; } -/* method bytes#BytesIterator#is_ok for (self: BytesIterator): Bool */ +/* method bytes$BytesIterator$is_ok for (self: BytesIterator): Bool */ short int core__bytes___core__bytes__BytesIterator___core__abstract_collection__Iterator__is_ok(val* self) { short int var /* : Bool */; long var1 /* : Int */; @@ -1548,28 +1732,28 @@ int idtype; const char* var_class_name; short int var10 /* : Bool */; { -{ /* Inline bytes#BytesIterator#index (self) on */ +{ /* Inline bytes$BytesIterator$index (self) on */ var3 = self->attrs[COLOR_core__bytes__BytesIterator___index].l; /* _index on */ var1 = var3; RET_LABEL2:(void)0; } } { -{ /* Inline bytes#BytesIterator#max (self) on */ +{ /* Inline bytes$BytesIterator$max (self) on */ var6 = self->attrs[COLOR_core__bytes__BytesIterator___max].l; /* _max on */ var4 = var6; RET_LABEL5:(void)0; } } { -{ /* Inline kernel#Int#< (var1,var4) on */ +{ /* Inline kernel$Int$< (var1,var4) on */ /* Covariant cast for argument 0 (i) isa OTHER */ /* isa OTHER */ var9 = 1; /* easy isa OTHER*/ if (unlikely(!var9)) { var_class_name = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 725); fatal_exit(1); } var10 = var1 < var4; @@ -1583,7 +1767,7 @@ goto RET_LABEL; RET_LABEL:; return var; } -/* method bytes#BytesIterator#next for (self: BytesIterator) */ +/* method bytes$BytesIterator$next for (self: BytesIterator) */ void core__bytes___core__bytes__BytesIterator___core__abstract_collection__Iterator__next(val* self) { val* var_ /* var : BytesIterator */; long var /* : Int */; @@ -1596,21 +1780,21 @@ const char* var_class_name; long var6 /* : Int */; var_ = self; { -{ /* Inline bytes#BytesIterator#index (var_) on */ +{ /* Inline bytes$BytesIterator$index (var_) on */ var2 = var_->attrs[COLOR_core__bytes__BytesIterator___index].l; /* _index on */ var = var2; RET_LABEL1:(void)0; } } { -{ /* Inline kernel#Int#+ (var,1l) on */ +{ /* Inline kernel$Int$+ (var,1l) on */ /* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */ /* <1l:Int> isa OTHER */ var5 = 1; /* easy <1l:Int> isa OTHER*/ if (unlikely(!var5)) { var_class_name = type_core__Int.name; PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); -PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 731); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); fatal_exit(1); } var6 = var + 1l; @@ -1620,38 +1804,38 @@ RET_LABEL4:(void)0; } } { -{ /* Inline bytes#BytesIterator#index= (var_,var3) on */ +{ /* Inline bytes$BytesIterator$index= (var_,var3) on */ var_->attrs[COLOR_core__bytes__BytesIterator___index].l = var3; /* _index on */ RET_LABEL7:(void)0; } } RET_LABEL:; } -/* method bytes#BytesIterator#item for (self: BytesIterator): Byte */ +/* method bytes$BytesIterator$item for (self: BytesIterator): Byte */ unsigned char core__bytes___core__bytes__BytesIterator___core__abstract_collection__Iterator__item(val* self) { unsigned char var /* : Byte */; -char* var1 /* : NativeString */; -char* var3 /* : NativeString */; +char* var1 /* : CString */; +char* var3 /* : CString */; long var4 /* : Int */; long var6 /* : Int */; unsigned char var7 /* : Byte */; unsigned char var9 /* : Byte */; { -{ /* Inline bytes#BytesIterator#tgt (self) on */ +{ /* Inline bytes$BytesIterator$tgt (self) on */ var3 = self->attrs[COLOR_core__bytes__BytesIterator___tgt].str; /* _tgt on */ var1 = var3; RET_LABEL2:(void)0; } } { -{ /* Inline bytes#BytesIterator#index (self) on */ +{ /* Inline bytes$BytesIterator$index (self) on */ var6 = self->attrs[COLOR_core__bytes__BytesIterator___index].l; /* _index on */ var4 = var6; RET_LABEL5:(void)0; } } { -{ /* Inline native#NativeString#[] (var1,var4) on */ +{ /* Inline native$CString$[] (var1,var4) on */ var9 = (unsigned char)((int)var1[var4]); var7 = var9; goto RET_LABEL8; @@ -1663,7 +1847,7 @@ goto RET_LABEL; RET_LABEL:; return var; } -/* method bytes#BytesIterator#item for (self: Iterator[nullable Object]): nullable Object */ +/* method bytes$BytesIterator$item for (self: Iterator[nullable Object]): nullable Object */ val* VIRTUAL_core__bytes___core__bytes__BytesIterator___core__abstract_collection__Iterator__item(val* self) { val* var /* : nullable Object */; unsigned char var1 /* : Byte */; @@ -1674,10 +1858,602 @@ var = var2; RET_LABEL:; return var; } -/* method bytes#BytesIterator#init for (self: BytesIterator) */ +/* method bytes$BytesIterator$init for (self: BytesIterator) */ void core__bytes___core__bytes__BytesIterator___core__kernel__Object__init(val* self) { { ((void(*)(val* self))(self->class->vft[COLOR_core__bytes___core__bytes__BytesIterator___core__kernel__Object__init]))(self); /* init on */ } RET_LABEL:; } +/* method bytes$Text$to_bytes for (self: Text): Bytes */ +val* core__bytes___Text___to_bytes(val* self) { +val* var /* : Bytes */; +val* var1 /* : Bytes */; +long var2 /* : Int */; +val* var_b /* var b: Bytes */; +var1 = NEW_core__Bytes(&type_core__Bytes); +{ +var2 = ((long(*)(val* self))(self->class->vft[COLOR_core__abstract_text__Text__byte_length]))(self); /* byte_length on */ +} +{ +core___core__Bytes___with_capacity(var1, var2); /* Direct call bytes$Bytes$with_capacity on */ +} +var_b = var1; +{ +((void(*)(val* self, val* p0))(self->class->vft[COLOR_core__bytes__Text__append_to_bytes]))(self, var_b); /* append_to_bytes on */ +} +var = var_b; +goto RET_LABEL; +RET_LABEL:; +return var; +} +/* method bytes$Text$append_to_bytes for (self: Text, Bytes) */ +void core__bytes___Text___append_to_bytes(val* self, val* p0) { +val* var_b /* var b: Bytes */; +val* var /* : Iterator[FlatText] */; +val* var_ /* var : Iterator[FlatText] */; +val* var1 /* : Iterator[nullable Object] */; +val* var_2 /* var : Iterator[FlatText] */; +short int var3 /* : Bool */; +val* var4 /* : nullable Object */; +val* var_s /* var s: FlatText */; +long var5 /* : Int */; +short int var6 /* : Bool */; +int cltype; +int idtype; +long var7 /* : Int */; +long var9 /* : Int */; +long var_from /* var from: Int */; +char* var10 /* : CString */; +char* var12 /* : CString */; +long var13 /* : Int */; +long var15 /* : Int */; +var_b = p0; +{ +var = ((val*(*)(val* self))(self->class->vft[COLOR_core__abstract_text__Text__substrings]))(self); /* substrings on */ +} +var_ = var; +{ +var1 = ((val*(*)(val* self))((((long)var_&3)?class_info[((long)var_&3)]:var_->class)->vft[COLOR_core__abstract_collection__Iterator__iterator]))(var_); /* iterator on */ +} +var_2 = var1; +for(;;) { +{ +var3 = ((short int(*)(val* self))((((long)var_2&3)?class_info[((long)var_2&3)]:var_2->class)->vft[COLOR_core__abstract_collection__Iterator__is_ok]))(var_2); /* is_ok on */ +} +if (var3){ +} else { +goto BREAK_label; +} +{ +var4 = ((val*(*)(val* self))((((long)var_2&3)?class_info[((long)var_2&3)]:var_2->class)->vft[COLOR_core__abstract_collection__Iterator__item]))(var_2); /* item on */ +} +var_s = var4; +/* isa FlatString */ +cltype = type_core__FlatString.color; +idtype = type_core__FlatString.id; +if(cltype >= var_s->type->table_size) { +var6 = 0; +} else { +var6 = var_s->type->type_table[cltype] == idtype; +} +if (var6){ +{ +{ /* Inline flat$FlatString$first_byte (var_s) on */ +var9 = var_s->attrs[COLOR_core__flat__FlatString___first_byte].l; /* _first_byte on */ +var7 = var9; +RET_LABEL8:(void)0; +} +} +var5 = var7; +} else { +var5 = 0l; +} +var_from = var5; +{ +{ /* Inline abstract_text$FlatText$items (var_s) on */ +var12 = var_s->attrs[COLOR_core__abstract_text__FlatText___items].str; /* _items on */ +var10 = var12; +RET_LABEL11:(void)0; +} +} +{ +{ /* Inline abstract_text$FlatText$byte_length (var_s) on */ +var15 = var_s->attrs[COLOR_core__abstract_text__FlatText___byte_length].l; /* _byte_length on */ +var13 = var15; +RET_LABEL14:(void)0; +} +} +{ +core___core__Bytes___append_ns_from(var_b, var10, var13, var_from); /* Direct call bytes$Bytes$append_ns_from on */ +} +{ +((void(*)(val* self))((((long)var_2&3)?class_info[((long)var_2&3)]:var_2->class)->vft[COLOR_core__abstract_collection__Iterator__next]))(var_2); /* next on */ +} +} +BREAK_label: (void)0; +{ +((void(*)(val* self))((((long)var_2&3)?class_info[((long)var_2&3)]:var_2->class)->vft[COLOR_core__abstract_collection__Iterator__finish]))(var_2); /* finish on */ +} +RET_LABEL:; +} +/* method bytes$Text$unescape_to_bytes for (self: Text): Bytes */ +val* core__bytes___Text___unescape_to_bytes(val* self) { +val* var /* : Bytes */; +val* var1 /* : Bytes */; +long var2 /* : Int */; +val* var_res /* var res: Bytes */; +short int var_was_slash /* var was_slash: Bool */; +long var_i /* var i: Int */; +long var3 /* : Int */; +short int var4 /* : Bool */; +short int var6 /* : Bool */; +int cltype; +int idtype; +const char* var_class_name; +short int var7 /* : Bool */; +uint32_t var8 /* : Char */; +uint32_t var_c /* var c: Char */; +short int var9 /* : Bool */; +short int var10 /* : Bool */; +short int var12 /* : Bool */; +long var13 /* : Int */; +short int var15 /* : Bool */; +int cltype16; +int idtype17; +const char* var_class_name18; +long var19 /* : Int */; +short int var20 /* : Bool */; +short int var22 /* : Bool */; +short int var23 /* : Bool */; +short int var25 /* : Bool */; +short int var26 /* : Bool */; +short int var28 /* : Bool */; +short int var29 /* : Bool */; +short int var31 /* : Bool */; +short int var32 /* : Bool */; +short int var33 /* : Bool */; +short int var35 /* : Bool */; +short int var_ /* var : Bool */; +short int var36 /* : Bool */; +short int var38 /* : Bool */; +long var39 /* : Int */; +short int var41 /* : Bool */; +int cltype42; +int idtype43; +const char* var_class_name44; +long var45 /* : Int */; +val* var46 /* : Text */; +val* var_hx /* var hx: Text */; +short int var47 /* : Bool */; +long var48 /* : Int */; +unsigned char var49 /* : Byte */; +unsigned char var51 /* : Byte */; +long var52 /* : Int */; +short int var54 /* : Bool */; +int cltype55; +int idtype56; +const char* var_class_name57; +long var58 /* : Int */; +short int var59 /* : Bool */; +short int var60 /* : Bool */; +short int var62 /* : Bool */; +short int var_63 /* var : Bool */; +short int var64 /* : Bool */; +short int var66 /* : Bool */; +long var67 /* : Int */; +short int var69 /* : Bool */; +int cltype70; +int idtype71; +const char* var_class_name72; +long var73 /* : Int */; +val* var74 /* : Text */; +val* var_hx75 /* var hx: Text */; +short int var76 /* : Bool */; +long var77 /* : Int */; +uint32_t var78 /* : Char */; +uint32_t var80 /* : Char */; +long var81 /* : Int */; +short int var83 /* : Bool */; +int cltype84; +int idtype85; +const char* var_class_name86; +long var87 /* : Int */; +long var88 /* : Int */; +short int var90 /* : Bool */; +int cltype91; +int idtype92; +const char* var_class_name93; +long var94 /* : Int */; +var1 = NEW_core__Bytes(&type_core__Bytes); +{ +var2 = ((long(*)(val* self))(self->class->vft[COLOR_core__abstract_text__Text__byte_length]))(self); /* byte_length on */ +} +{ +core___core__Bytes___with_capacity(var1, var2); /* Direct call bytes$Bytes$with_capacity on */ +} +var_res = var1; +var_was_slash = 0; +var_i = 0l; +for(;;) { +{ +var3 = ((long(*)(val* self))(self->class->vft[COLOR_core__abstract_text__Text__length]))(self); /* length on */ +} +{ +{ /* Inline kernel$Int$< (var_i,var3) on */ +/* Covariant cast for argument 0 (i) isa OTHER */ +/* isa OTHER */ +var6 = 1; /* easy isa OTHER*/ +if (unlikely(!var6)) { +var_class_name = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 725); +fatal_exit(1); +} +var7 = var_i < var3; +var4 = var7; +goto RET_LABEL5; +RET_LABEL5:(void)0; +} +} +if (var4){ +{ +var8 = ((uint32_t(*)(val* self, long p0))(self->class->vft[COLOR_core__abstract_text__Text___91d_93d]))(self, var_i); /* [] on */ +} +var_c = var8; +var9 = !var_was_slash; +if (var9){ +{ +{ /* Inline kernel$Char$== (var_c,'\\') on */ +var12 = var_c == '\\'; +var10 = var12; +goto RET_LABEL11; +RET_LABEL11:(void)0; +} +} +if (var10){ +var_was_slash = 1; +} else { +{ +core___core__Bytes___add_char(var_res, var_c); /* Direct call bytes$Bytes$add_char on */ +} +} +{ +{ /* Inline kernel$Int$+ (var_i,1l) on */ +/* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */ +/* <1l:Int> isa OTHER */ +var15 = 1; /* easy <1l:Int> isa OTHER*/ +if (unlikely(!var15)) { +var_class_name18 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name18); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +fatal_exit(1); +} +var19 = var_i + 1l; +var13 = var19; +goto RET_LABEL14; +RET_LABEL14:(void)0; +} +} +var_i = var13; +goto BREAK_label; +} else { +} +var_was_slash = 0; +{ +{ /* Inline kernel$Char$== (var_c,'n') on */ +var22 = var_c == 'n'; +var20 = var22; +goto RET_LABEL21; +RET_LABEL21:(void)0; +} +} +if (var20){ +{ +core___core__Bytes___add_char(var_res, '\n'); /* Direct call bytes$Bytes$add_char on */ +} +} else { +{ +{ /* Inline kernel$Char$== (var_c,'r') on */ +var25 = var_c == 'r'; +var23 = var25; +goto RET_LABEL24; +RET_LABEL24:(void)0; +} +} +if (var23){ +{ +core___core__Bytes___add_char(var_res, '\015'); /* Direct call bytes$Bytes$add_char on */ +} +} else { +{ +{ /* Inline kernel$Char$== (var_c,'t') on */ +var28 = var_c == 't'; +var26 = var28; +goto RET_LABEL27; +RET_LABEL27:(void)0; +} +} +if (var26){ +{ +core___core__Bytes___add_char(var_res, '\t'); /* Direct call bytes$Bytes$add_char on */ +} +} else { +{ +{ /* Inline kernel$Char$== (var_c,'0') on */ +var31 = var_c == '0'; +var29 = var31; +goto RET_LABEL30; +RET_LABEL30:(void)0; +} +} +if (var29){ +{ +core___core__Bytes___add_char(var_res, '\000'); /* Direct call bytes$Bytes$add_char on */ +} +} else { +{ +{ /* Inline kernel$Char$== (var_c,'x') on */ +var35 = var_c == 'x'; +var33 = var35; +goto RET_LABEL34; +RET_LABEL34:(void)0; +} +} +var_ = var33; +if (var33){ +var32 = var_; +} else { +{ +{ /* Inline kernel$Char$== (var_c,'X') on */ +var38 = var_c == 'X'; +var36 = var38; +goto RET_LABEL37; +RET_LABEL37:(void)0; +} +} +var32 = var36; +} +if (var32){ +{ +{ /* Inline kernel$Int$+ (var_i,1l) on */ +/* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */ +/* <1l:Int> isa OTHER */ +var41 = 1; /* easy <1l:Int> isa OTHER*/ +if (unlikely(!var41)) { +var_class_name44 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name44); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +fatal_exit(1); +} +var45 = var_i + 1l; +var39 = var45; +goto RET_LABEL40; +RET_LABEL40:(void)0; +} +} +{ +var46 = ((val*(*)(val* self, long p0, long p1))(self->class->vft[COLOR_core__abstract_text__Text__substring]))(self, var39, 2l); /* substring on */ +} +var_hx = var46; +{ +var47 = core___core__Text___is_hex(var_hx); +} +if (var47){ +{ +var48 = ((long(*)(val* self, val* p0, val* p1))(var_hx->class->vft[COLOR_core__abstract_text__Text__to_hex]))(var_hx, ((val*)NULL), ((val*)NULL)); /* to_hex on */ +} +{ +{ /* Inline kernel$Int$to_b (var48) on */ +var51 = (unsigned char)var48; +var49 = var51; +goto RET_LABEL50; +RET_LABEL50:(void)0; +} +} +{ +core___core__Bytes___core__abstract_collection__SimpleCollection__add(var_res, var49); /* Direct call bytes$Bytes$add on */ +} +} else { +{ +core___core__Bytes___add_char(var_res, var_c); /* Direct call bytes$Bytes$add_char on */ +} +} +{ +{ /* Inline kernel$Int$+ (var_i,2l) on */ +/* Covariant cast for argument 0 (i) <2l:Int> isa OTHER */ +/* <2l:Int> isa OTHER */ +var54 = 1; /* easy <2l:Int> isa OTHER*/ +if (unlikely(!var54)) { +var_class_name57 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name57); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +fatal_exit(1); +} +var58 = var_i + 2l; +var52 = var58; +goto RET_LABEL53; +RET_LABEL53:(void)0; +} +} +var_i = var52; +} else { +{ +{ /* Inline kernel$Char$== (var_c,'u') on */ +var62 = var_c == 'u'; +var60 = var62; +goto RET_LABEL61; +RET_LABEL61:(void)0; +} +} +var_63 = var60; +if (var60){ +var59 = var_63; +} else { +{ +{ /* Inline kernel$Char$== (var_c,'U') on */ +var66 = var_c == 'U'; +var64 = var66; +goto RET_LABEL65; +RET_LABEL65:(void)0; +} +} +var59 = var64; +} +if (var59){ +{ +{ /* Inline kernel$Int$+ (var_i,1l) on */ +/* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */ +/* <1l:Int> isa OTHER */ +var69 = 1; /* easy <1l:Int> isa OTHER*/ +if (unlikely(!var69)) { +var_class_name72 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name72); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +fatal_exit(1); +} +var73 = var_i + 1l; +var67 = var73; +goto RET_LABEL68; +RET_LABEL68:(void)0; +} +} +{ +var74 = ((val*(*)(val* self, long p0, long p1))(self->class->vft[COLOR_core__abstract_text__Text__substring]))(self, var67, 6l); /* substring on */ +} +var_hx75 = var74; +{ +var76 = core___core__Text___is_hex(var_hx75); +} +if (var76){ +{ +var77 = ((long(*)(val* self, val* p0, val* p1))(var_hx75->class->vft[COLOR_core__abstract_text__Text__to_hex]))(var_hx75, ((val*)NULL), ((val*)NULL)); /* to_hex on */ +} +{ +{ /* Inline kernel$Int$code_point (var77) on */ +var80 = (uint32_t)var77; +var78 = var80; +goto RET_LABEL79; +RET_LABEL79:(void)0; +} +} +{ +core___core__Bytes___add_char(var_res, var78); /* Direct call bytes$Bytes$add_char on */ +} +} else { +{ +core___core__Bytes___add_char(var_res, var_c); /* Direct call bytes$Bytes$add_char on */ +} +} +{ +{ /* Inline kernel$Int$+ (var_i,6l) on */ +/* Covariant cast for argument 0 (i) <6l:Int> isa OTHER */ +/* <6l:Int> isa OTHER */ +var83 = 1; /* easy <6l:Int> isa OTHER*/ +if (unlikely(!var83)) { +var_class_name86 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name86); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +fatal_exit(1); +} +var87 = var_i + 6l; +var81 = var87; +goto RET_LABEL82; +RET_LABEL82:(void)0; +} +} +var_i = var81; +} else { +{ +core___core__Bytes___add_char(var_res, var_c); /* Direct call bytes$Bytes$add_char on */ +} +} +} +} +} +} +} +{ +{ /* Inline kernel$Int$+ (var_i,1l) on */ +/* Covariant cast for argument 0 (i) <1l:Int> isa OTHER */ +/* <1l:Int> isa OTHER */ +var90 = 1; /* easy <1l:Int> isa OTHER*/ +if (unlikely(!var90)) { +var_class_name93 = type_core__Int.name; +PRINT_ERROR("Runtime error: Cast failed. Expected `%s`, got `%s`", "OTHER", var_class_name93); +PRINT_ERROR(" (%s:%d)\n", FILE_core__kernel, 728); +fatal_exit(1); +} +var94 = var_i + 1l; +var88 = var94; +goto RET_LABEL89; +RET_LABEL89:(void)0; +} +} +var_i = var88; +} else { +goto BREAK_label95; +} +BREAK_label: (void)0; +} +BREAK_label95: (void)0; +var = var_res; +goto RET_LABEL; +RET_LABEL:; +return var; +} +/* method bytes$FlatText$append_to_bytes for (self: FlatText, Bytes) */ +void core__bytes___FlatText___Text__append_to_bytes(val* self, val* p0) { +val* var_b /* var b: Bytes */; +long var /* : Int */; +short int var1 /* : Bool */; +int cltype; +int idtype; +long var2 /* : Int */; +long var4 /* : Int */; +long var_from /* var from: Int */; +char* var5 /* : CString */; +char* var7 /* : CString */; +long var8 /* : Int */; +long var10 /* : Int */; +var_b = p0; +/* isa FlatString */ +cltype = type_core__FlatString.color; +idtype = type_core__FlatString.id; +if(cltype >= self->type->table_size) { +var1 = 0; +} else { +var1 = self->type->type_table[cltype] == idtype; +} +if (var1){ +{ +{ /* Inline flat$FlatString$first_byte (self) on */ +var4 = self->attrs[COLOR_core__flat__FlatString___first_byte].l; /* _first_byte on */ +var2 = var4; +RET_LABEL3:(void)0; +} +} +var = var2; +} else { +var = 0l; +} +var_from = var; +{ +{ /* Inline abstract_text$FlatText$items (self) on */ +var7 = self->attrs[COLOR_core__abstract_text__FlatText___items].str; /* _items on */ +var5 = var7; +RET_LABEL6:(void)0; +} +} +{ +{ /* Inline abstract_text$FlatText$byte_length (self) on */ +var10 = self->attrs[COLOR_core__abstract_text__FlatText___byte_length].l; /* _byte_length on */ +var8 = var10; +RET_LABEL9:(void)0; +} +} +{ +core___core__Bytes___append_ns_from(var_b, var5, var8, var_from); /* Direct call bytes$Bytes$append_ns_from on */ +} +RET_LABEL:; +}