mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 08:34:33 +00:00
simplified join + mono
This commit is contained in:
parent
74f2b0afda
commit
4de6369e6a
25 changed files with 227 additions and 202 deletions
|
@ -884,33 +884,54 @@ where
|
|||
F1: FnOnce(&mut STLayoutInterner<'a>, &mut IdentIds, &'a Stmt<'a>) -> &'a Stmt<'a>,
|
||||
F2: FnOnce(&mut STLayoutInterner<'a>, &mut IdentIds, &'a Stmt<'a>) -> &'a Stmt<'a>,
|
||||
{
|
||||
let join_id = JoinPointId(environment.create_symbol(ident_ids, &format!("uniqueness_join")));
|
||||
match continutation {
|
||||
// The continuation is a single stmt. So we can insert it inline and skip creating a joinpoint.
|
||||
Stmt::Ret(_) | Stmt::Jump(_, _) => {
|
||||
let u = unique(layout_interner, ident_ids, continutation);
|
||||
let n = not_unique(layout_interner, ident_ids, continutation);
|
||||
|
||||
let switch = |unique_symbol| {
|
||||
arena.alloc(Stmt::Switch {
|
||||
cond_symbol: unique_symbol,
|
||||
cond_layout: Layout::BOOL,
|
||||
branches: &*arena.alloc([(1, BranchInfo::None, u.clone())]),
|
||||
default_branch: (BranchInfo::None, n),
|
||||
ret_layout: environment.layout,
|
||||
})
|
||||
};
|
||||
|
||||
unique_symbol(arena, ident_ids, environment, symbol, switch)
|
||||
}
|
||||
// We put the continuation in a joinpoint. To prevent duplicating the content.
|
||||
_ => {
|
||||
let join_id =
|
||||
JoinPointId(environment.create_symbol(ident_ids, &format!("uniqueness_join")));
|
||||
|
||||
let jump = arena.alloc(Stmt::Jump(join_id, arena.alloc([])));
|
||||
|
||||
let u = unique(layout_interner, ident_ids, jump);
|
||||
let n = not_unique(layout_interner, ident_ids, jump);
|
||||
|
||||
let join = |unique_symbol| {
|
||||
let switch = arena.alloc(Stmt::Switch {
|
||||
let switch = |unique_symbol| {
|
||||
arena.alloc(Stmt::Switch {
|
||||
cond_symbol: unique_symbol,
|
||||
cond_layout: Layout::BOOL,
|
||||
branches: &*arena.alloc([(1, BranchInfo::None, u.clone())]),
|
||||
default_branch: (BranchInfo::None, n),
|
||||
ret_layout: environment.layout,
|
||||
});
|
||||
})
|
||||
};
|
||||
|
||||
let join = arena.alloc(Stmt::Join {
|
||||
let unique = unique_symbol(arena, ident_ids, environment, symbol, switch);
|
||||
|
||||
arena.alloc(Stmt::Join {
|
||||
id: join_id,
|
||||
parameters: arena.alloc([]),
|
||||
body: continutation,
|
||||
remainder: switch,
|
||||
});
|
||||
|
||||
join
|
||||
};
|
||||
|
||||
unique_symbol(arena, ident_ids, environment, symbol, join)
|
||||
remainder: unique,
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn unique_symbol<'a, 'i, F>(
|
||||
|
|
|
@ -70,8 +70,8 @@ Implemented as two sets for efficiency.
|
|||
*/
|
||||
#[derive(Clone, Default)]
|
||||
struct SymbolRcTypes {
|
||||
owned: MutSet<Symbol>,
|
||||
borrowed: MutSet<Symbol>,
|
||||
reference_counted: MutSet<Symbol>,
|
||||
not_reference_counted: MutSet<Symbol>,
|
||||
}
|
||||
|
||||
impl SymbolRcTypes {
|
||||
|
@ -81,10 +81,10 @@ impl SymbolRcTypes {
|
|||
fn insert(&mut self, symbol: Symbol, var_rc_type: VarRcType) {
|
||||
match var_rc_type {
|
||||
VarRcType::ReferenceCounted => {
|
||||
self.owned.insert(symbol);
|
||||
self.reference_counted.insert(symbol);
|
||||
}
|
||||
VarRcType::NotReferenceCounted => {
|
||||
self.borrowed.insert(symbol);
|
||||
self.not_reference_counted.insert(symbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -93,10 +93,10 @@ impl SymbolRcTypes {
|
|||
Get the reference count type of a symbol.
|
||||
*/
|
||||
fn get(&self, symbol: &Symbol) -> Option<VarRcType> {
|
||||
if self.owned.contains(symbol) {
|
||||
debug_assert!(!self.borrowed.contains(symbol));
|
||||
if self.reference_counted.contains(symbol) {
|
||||
debug_assert!(!self.not_reference_counted.contains(symbol));
|
||||
Some(VarRcType::ReferenceCounted)
|
||||
} else if self.borrowed.contains(symbol) {
|
||||
} else if self.not_reference_counted.contains(symbol) {
|
||||
Some(VarRcType::NotReferenceCounted)
|
||||
} else {
|
||||
None
|
||||
|
|
|
@ -37,8 +37,6 @@ procedure List.9 (List.287):
|
|||
let List.500 : Int1 = lowlevel Eq List.498 List.499;
|
||||
if List.500 then
|
||||
let List.288 : Str = UnionAtIndex (Id 1) (Index 0) List.494;
|
||||
inc List.288;
|
||||
dec List.494;
|
||||
let List.495 : [C {}, C Str] = TagId(1) List.288;
|
||||
ret List.495;
|
||||
else
|
||||
|
@ -58,8 +56,6 @@ procedure Result.5 (Result.12, Result.13):
|
|||
if Result.41 then
|
||||
dec Result.13;
|
||||
let Result.14 : Str = UnionAtIndex (Id 1) (Index 0) Result.12;
|
||||
inc Result.14;
|
||||
dec Result.12;
|
||||
ret Result.14;
|
||||
else
|
||||
dec Result.12;
|
||||
|
@ -81,8 +77,7 @@ procedure Test.2 (Test.6):
|
|||
let Test.31 : Int1 = lowlevel Eq Test.29 Test.30;
|
||||
if Test.31 then
|
||||
let Test.7 : [<r>C List *self, C *self] = UnionAtIndex (Id 1) (Index 0) Test.6;
|
||||
inc Test.7;
|
||||
dec Test.6;
|
||||
joinpoint #Derived_gen.2:
|
||||
let Test.8 : Str = CallByName Test.2 Test.7;
|
||||
let Test.18 : Int1 = CallByName Bool.1;
|
||||
if Test.18 then
|
||||
|
@ -91,16 +86,33 @@ procedure Test.2 (Test.6):
|
|||
dec Test.8;
|
||||
let Test.17 : Str = "foo";
|
||||
ret Test.17;
|
||||
in
|
||||
let #Derived_gen.3 : Int1 = lowlevel RefCountIsUnique Test.6;
|
||||
if #Derived_gen.3 then
|
||||
decref Test.6;
|
||||
jump #Derived_gen.2;
|
||||
else
|
||||
inc Test.7;
|
||||
decref Test.6;
|
||||
jump #Derived_gen.2;
|
||||
else
|
||||
let Test.9 : List [<r>C List *self, C *self] = UnionAtIndex (Id 0) (Index 0) Test.6;
|
||||
inc Test.9;
|
||||
dec Test.6;
|
||||
joinpoint #Derived_gen.4:
|
||||
let Test.24 : {} = Struct {};
|
||||
let Test.23 : List Str = CallByName List.5 Test.9 Test.24;
|
||||
let Test.21 : [C {}, C Str] = CallByName List.9 Test.23;
|
||||
let Test.22 : Str = "foo";
|
||||
let Test.20 : Str = CallByName Result.5 Test.21 Test.22;
|
||||
ret Test.20;
|
||||
in
|
||||
let #Derived_gen.5 : Int1 = lowlevel RefCountIsUnique Test.6;
|
||||
if #Derived_gen.5 then
|
||||
decref Test.6;
|
||||
jump #Derived_gen.4;
|
||||
else
|
||||
inc Test.9;
|
||||
decref Test.6;
|
||||
jump #Derived_gen.4;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.32 : List [<r>C List *self, C *self] = Array [];
|
||||
|
|
|
@ -58,8 +58,7 @@ procedure Test.11 (Test.53, Test.54):
|
|||
joinpoint Test.27 Test.12 #Attr.12:
|
||||
let Test.8 : Int1 = UnionAtIndex (Id 2) (Index 1) #Attr.12;
|
||||
let Test.7 : [<rnw><null>, C *self Int1, C *self Int1] = UnionAtIndex (Id 2) (Index 0) #Attr.12;
|
||||
inc Test.7;
|
||||
dec #Attr.12;
|
||||
joinpoint #Derived_gen.5:
|
||||
joinpoint Test.31 Test.29:
|
||||
let Test.30 : U8 = GetTagId Test.7;
|
||||
switch Test.30:
|
||||
|
@ -86,6 +85,15 @@ procedure Test.11 (Test.53, Test.54):
|
|||
jump Test.31 Test.32;
|
||||
|
||||
in
|
||||
let #Derived_gen.6 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.6 then
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.5;
|
||||
else
|
||||
inc Test.7;
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.5;
|
||||
in
|
||||
jump Test.27 Test.53 Test.54;
|
||||
|
||||
procedure Test.2 (Test.13):
|
||||
|
@ -117,8 +125,7 @@ procedure Test.6 (Test.7, Test.8, Test.5):
|
|||
procedure Test.9 (Test.10, #Attr.12):
|
||||
let Test.8 : Int1 = UnionAtIndex (Id 1) (Index 1) #Attr.12;
|
||||
let Test.7 : [<rnw><null>, C *self Int1, C *self Int1] = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
inc Test.7;
|
||||
dec #Attr.12;
|
||||
joinpoint #Derived_gen.3:
|
||||
let Test.37 : U8 = GetTagId Test.7;
|
||||
joinpoint Test.38 Test.36:
|
||||
switch Test.8:
|
||||
|
@ -145,6 +152,15 @@ procedure Test.9 (Test.10, #Attr.12):
|
|||
let Test.39 : Str = CallByName Test.11 Test.10 Test.7;
|
||||
jump Test.38 Test.39;
|
||||
|
||||
in
|
||||
let #Derived_gen.4 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.4 then
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.3;
|
||||
else
|
||||
inc Test.7;
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.3;
|
||||
|
||||
procedure Test.0 ():
|
||||
let Test.41 : Int1 = false;
|
||||
|
|
|
@ -4,7 +4,6 @@ procedure Test.1 (Test.2):
|
|||
let Test.12 : Int1 = lowlevel Eq Test.10 Test.11;
|
||||
if Test.12 then
|
||||
let Test.3 : U64 = UnionAtIndex (Id 1) (Index 0) Test.2;
|
||||
dec Test.2;
|
||||
ret Test.3;
|
||||
else
|
||||
dec Test.2;
|
||||
|
|
|
@ -340,8 +340,6 @@ procedure Test.0 ():
|
|||
let Test.7 : Int1 = lowlevel Eq Test.5 Test.6;
|
||||
if Test.7 then
|
||||
let Test.2 : Str = UnionAtIndex (Id 1) (Index 0) Test.1;
|
||||
inc Test.2;
|
||||
dec Test.1;
|
||||
ret Test.2;
|
||||
else
|
||||
dec Test.1;
|
||||
|
|
|
@ -224,8 +224,6 @@ procedure Test.0 ():
|
|||
let Test.7 : Int1 = lowlevel Eq Test.5 Test.6;
|
||||
if Test.7 then
|
||||
let Test.2 : Str = UnionAtIndex (Id 1) (Index 0) Test.1;
|
||||
inc Test.2;
|
||||
dec Test.1;
|
||||
ret Test.2;
|
||||
else
|
||||
dec Test.1;
|
||||
|
|
|
@ -10,8 +10,7 @@ procedure #Derived.2 (#Derived.3, #Derived.4, #Derived.1):
|
|||
let #Derived_gen.6 : {Str, Str} = Struct {#Derived_gen.11, #Derived_gen.12};
|
||||
let #Derived_gen.8 : Str = "b";
|
||||
let #Derived_gen.10 : Str = StructAtIndex 1 #Derived.1;
|
||||
inc #Derived_gen.10;
|
||||
dec #Derived.1;
|
||||
dec #Derived_gen.13;
|
||||
let #Derived_gen.9 : Str = CallByName Json.18 #Derived_gen.10;
|
||||
let #Derived_gen.7 : {Str, Str} = Struct {#Derived_gen.8, #Derived_gen.9};
|
||||
let #Derived_gen.5 : List {Str, Str} = Array [#Derived_gen.6, #Derived_gen.7];
|
||||
|
@ -234,8 +233,6 @@ procedure Test.0 ():
|
|||
let Test.7 : Int1 = lowlevel Eq Test.5 Test.6;
|
||||
if Test.7 then
|
||||
let Test.2 : Str = UnionAtIndex (Id 1) (Index 0) Test.1;
|
||||
inc Test.2;
|
||||
dec Test.1;
|
||||
ret Test.2;
|
||||
else
|
||||
dec Test.1;
|
||||
|
|
|
@ -92,8 +92,6 @@ procedure Test.0 ():
|
|||
let Test.7 : Int1 = lowlevel Eq Test.5 Test.6;
|
||||
if Test.7 then
|
||||
let Test.2 : Str = UnionAtIndex (Id 1) (Index 0) Test.1;
|
||||
inc Test.2;
|
||||
dec Test.1;
|
||||
ret Test.2;
|
||||
else
|
||||
dec Test.1;
|
||||
|
|
|
@ -57,10 +57,7 @@ procedure Json.102 (Json.103, Json.527, Json.101):
|
|||
|
||||
procedure Json.144 (Json.145, Json.486, #Attr.12):
|
||||
let Json.143 : List Str = StructAtIndex 1 #Attr.12;
|
||||
inc Json.143;
|
||||
let Json.142 : Str = StructAtIndex 0 #Attr.12;
|
||||
inc Json.142;
|
||||
dec #Attr.12;
|
||||
let Json.524 : I64 = 123i64;
|
||||
let Json.523 : U8 = CallByName Num.127 Json.524;
|
||||
let Json.520 : List U8 = CallByName List.4 Json.145 Json.523;
|
||||
|
@ -236,8 +233,6 @@ procedure Test.0 ():
|
|||
let Test.9 : Int1 = lowlevel Eq Test.7 Test.8;
|
||||
if Test.9 then
|
||||
let Test.4 : Str = UnionAtIndex (Id 1) (Index 0) Test.2;
|
||||
inc Test.4;
|
||||
dec Test.2;
|
||||
ret Test.4;
|
||||
else
|
||||
dec Test.2;
|
||||
|
|
|
@ -8,10 +8,7 @@ procedure #Derived.4 (#Derived.5, #Derived.6, #Derived.1):
|
|||
ret #Derived_gen.3;
|
||||
in
|
||||
let #Derived.2 : Str = StructAtIndex 0 #Derived.1;
|
||||
inc #Derived.2;
|
||||
let #Derived.3 : Str = StructAtIndex 1 #Derived.1;
|
||||
inc #Derived.3;
|
||||
dec #Derived.1;
|
||||
let #Derived_gen.7 : Str = "A";
|
||||
let #Derived_gen.9 : Str = CallByName Json.18 #Derived.2;
|
||||
let #Derived_gen.10 : Str = CallByName Json.18 #Derived.3;
|
||||
|
@ -63,10 +60,7 @@ procedure Json.102 (Json.103, Json.527, Json.101):
|
|||
|
||||
procedure Json.144 (Json.145, Json.486, #Attr.12):
|
||||
let Json.143 : List Str = StructAtIndex 1 #Attr.12;
|
||||
inc Json.143;
|
||||
let Json.142 : Str = StructAtIndex 0 #Attr.12;
|
||||
inc Json.142;
|
||||
dec #Attr.12;
|
||||
let Json.524 : I64 = 123i64;
|
||||
let Json.523 : U8 = CallByName Num.127 Json.524;
|
||||
let Json.520 : List U8 = CallByName List.4 Json.145 Json.523;
|
||||
|
@ -244,8 +238,6 @@ procedure Test.0 ():
|
|||
let Test.9 : Int1 = lowlevel Eq Test.7 Test.8;
|
||||
if Test.9 then
|
||||
let Test.4 : Str = UnionAtIndex (Id 1) (Index 0) Test.2;
|
||||
inc Test.4;
|
||||
dec Test.2;
|
||||
ret Test.4;
|
||||
else
|
||||
dec Test.2;
|
||||
|
|
|
@ -6,11 +6,7 @@ procedure Test.0 ():
|
|||
let Test.10 : Int1 = lowlevel Eq Test.8 Test.9;
|
||||
if Test.10 then
|
||||
let Test.3 : Str = UnionAtIndex (Id 1) (Index 0) Test.11;
|
||||
inc Test.3;
|
||||
dec Test.11;
|
||||
ret Test.3;
|
||||
else
|
||||
let Test.4 : Str = UnionAtIndex (Id 0) (Index 0) Test.11;
|
||||
inc Test.4;
|
||||
dec Test.11;
|
||||
ret Test.4;
|
||||
|
|
|
@ -13,8 +13,13 @@ procedure Test.2 (Test.19):
|
|||
ret Test.14;
|
||||
else
|
||||
let Test.5 : [<rnu><null>, C *self] = UnionAtIndex (Id 0) (Index 0) Test.7;
|
||||
let #Derived_gen.1 : Int1 = lowlevel RefCountIsUnique Test.7;
|
||||
if #Derived_gen.1 then
|
||||
decref Test.7;
|
||||
jump Test.13 Test.5;
|
||||
else
|
||||
inc Test.5;
|
||||
dec Test.7;
|
||||
decref Test.7;
|
||||
jump Test.13 Test.5;
|
||||
in
|
||||
jump Test.13 Test.19;
|
||||
|
|
|
@ -51,8 +51,6 @@ procedure Decode.27 (Decode.107, Decode.108):
|
|||
let Decode.131 : Int1 = lowlevel Eq Decode.129 Decode.130;
|
||||
if Decode.131 then
|
||||
let Decode.111 : Str = UnionAtIndex (Id 1) (Index 0) Decode.109;
|
||||
inc Decode.111;
|
||||
dec Decode.109;
|
||||
let Decode.126 : [C [C List U8, C ], C Str] = TagId(1) Decode.111;
|
||||
ret Decode.126;
|
||||
else
|
||||
|
@ -211,8 +209,6 @@ procedure Json.42 (Json.298):
|
|||
let Json.502 : Int1 = lowlevel Eq Json.500 Json.501;
|
||||
if Json.502 then
|
||||
let Json.307 : Str = UnionAtIndex (Id 1) (Index 0) Json.492;
|
||||
inc Json.307;
|
||||
dec Json.492;
|
||||
let Json.496 : U64 = 1i64;
|
||||
let Json.495 : {List U8, List U8} = CallByName List.52 Json.304 Json.496;
|
||||
let Json.309 : List U8 = StructAtIndex 1 Json.495;
|
||||
|
|
|
@ -187,8 +187,6 @@ procedure Json.42 (Json.298):
|
|||
let Json.502 : Int1 = lowlevel Eq Json.500 Json.501;
|
||||
if Json.502 then
|
||||
let Json.307 : Str = UnionAtIndex (Id 1) (Index 0) Json.492;
|
||||
inc Json.307;
|
||||
dec Json.492;
|
||||
let Json.496 : U64 = 1i64;
|
||||
let Json.495 : {List U8, List U8} = CallByName List.52 Json.304 Json.496;
|
||||
let Json.309 : List U8 = StructAtIndex 1 Json.495;
|
||||
|
@ -365,8 +363,6 @@ procedure Test.0 ():
|
|||
let Test.33 : Int1 = lowlevel Eq Test.31 Test.32;
|
||||
if Test.33 then
|
||||
let Test.3 : Str = UnionAtIndex (Id 1) (Index 0) Test.1;
|
||||
inc Test.3;
|
||||
dec Test.1;
|
||||
let Test.19 : [C {}, C I64] = CallByName Str.27 Test.3;
|
||||
let Test.25 : U8 = 1i64;
|
||||
let Test.26 : U8 = GetTagId Test.19;
|
||||
|
|
|
@ -12,20 +12,16 @@ procedure Test.2 (Test.7):
|
|||
|
||||
procedure Test.6 (Test.17, #Attr.12):
|
||||
let Test.5 : U64 = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
dec #Attr.12;
|
||||
let Test.31 : Str = "";
|
||||
ret Test.31;
|
||||
|
||||
procedure Test.6 (Test.17, #Attr.12):
|
||||
let Test.5 : {} = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
dec #Attr.12;
|
||||
let Test.19 : Str = "";
|
||||
ret Test.19;
|
||||
|
||||
procedure Test.8 (Test.23, #Attr.12):
|
||||
let Test.7 : Str = UnionAtIndex (Id 2) (Index 0) #Attr.12;
|
||||
inc Test.7;
|
||||
dec #Attr.12;
|
||||
ret Test.7;
|
||||
|
||||
procedure Test.0 ():
|
||||
|
|
|
@ -66,8 +66,6 @@ procedure Test.0 ():
|
|||
let Test.11 : Int1 = lowlevel Eq Test.9 Test.10;
|
||||
if Test.11 then
|
||||
let Test.5 : Str = UnionAtIndex (Id 1) (Index 0) Test.6;
|
||||
inc Test.5;
|
||||
dec Test.6;
|
||||
ret Test.5;
|
||||
else
|
||||
dec Test.6;
|
||||
|
|
|
@ -62,8 +62,6 @@ procedure Test.0 ():
|
|||
let Test.11 : Int1 = lowlevel Eq Test.9 Test.10;
|
||||
if Test.11 then
|
||||
let Test.5 : Str = UnionAtIndex (Id 1) (Index 0) Test.6;
|
||||
inc Test.5;
|
||||
dec Test.6;
|
||||
ret Test.5;
|
||||
else
|
||||
dec Test.6;
|
||||
|
|
|
@ -4,13 +4,9 @@ procedure Test.2 (Test.4):
|
|||
let Test.12 : Int1 = lowlevel Eq Test.10 Test.11;
|
||||
if Test.12 then
|
||||
let Test.5 : Str = UnionAtIndex (Id 0) (Index 0) Test.4;
|
||||
inc Test.5;
|
||||
dec Test.4;
|
||||
ret Test.5;
|
||||
else
|
||||
let Test.6 : Str = UnionAtIndex (Id 1) (Index 0) Test.4;
|
||||
inc Test.6;
|
||||
dec Test.4;
|
||||
ret Test.6;
|
||||
|
||||
procedure Test.0 ():
|
||||
|
|
|
@ -8,8 +8,7 @@ procedure Test.0 ():
|
|||
let Test.18 : Int1 = lowlevel Eq Test.16 Test.17;
|
||||
if Test.18 then
|
||||
let Test.12 : [<rnu><null>, C *self] = UnionAtIndex (Id 0) (Index 0) Test.2;
|
||||
inc Test.12;
|
||||
dec Test.2;
|
||||
joinpoint #Derived_gen.2:
|
||||
let Test.13 : U8 = 0i64;
|
||||
let Test.14 : U8 = GetTagId Test.12;
|
||||
dec Test.12;
|
||||
|
@ -20,7 +19,15 @@ procedure Test.0 ():
|
|||
else
|
||||
let Test.9 : I64 = 0i64;
|
||||
ret Test.9;
|
||||
in
|
||||
let #Derived_gen.3 : Int1 = lowlevel RefCountIsUnique Test.2;
|
||||
if #Derived_gen.3 then
|
||||
decref Test.2;
|
||||
jump #Derived_gen.2;
|
||||
else
|
||||
inc Test.12;
|
||||
decref Test.2;
|
||||
jump #Derived_gen.2;
|
||||
else
|
||||
dec Test.2;
|
||||
let Test.10 : I64 = 0i64;
|
||||
ret Test.10;
|
||||
|
|
|
@ -39,8 +39,7 @@ procedure Test.4 (Test.28, Test.29):
|
|||
joinpoint Test.15 Test.5 #Attr.12:
|
||||
let Test.2 : U8 = UnionAtIndex (Id 0) (Index 1) #Attr.12;
|
||||
let Test.3 : [<rnu><null>, C *self U8] = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
inc Test.3;
|
||||
dec #Attr.12;
|
||||
joinpoint #Derived_gen.1:
|
||||
let Test.17 : U8 = CallByName Num.21 Test.2 Test.5;
|
||||
let Test.18 : U8 = GetTagId Test.3;
|
||||
switch Test.18:
|
||||
|
@ -53,6 +52,15 @@ procedure Test.4 (Test.28, Test.29):
|
|||
ret Test.16;
|
||||
|
||||
in
|
||||
let #Derived_gen.2 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.2 then
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.1;
|
||||
else
|
||||
inc Test.3;
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.1;
|
||||
in
|
||||
jump Test.15 Test.28 Test.29;
|
||||
|
||||
procedure Test.6 (Test.7):
|
||||
|
|
|
@ -8,7 +8,12 @@ procedure Str.3 (#Attr.2, #Attr.3):
|
|||
|
||||
procedure Test.11 (Test.29, #Attr.12):
|
||||
let Test.10 : {} = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
||||
dec #Attr.12;
|
||||
let #Derived_gen.2 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.2 then
|
||||
decref #Attr.12;
|
||||
ret Test.10;
|
||||
else
|
||||
decref #Attr.12;
|
||||
ret Test.10;
|
||||
|
||||
procedure Test.11 (Test.29, Test.10):
|
||||
|
@ -18,7 +23,7 @@ procedure Test.14 (Test.62, Test.63):
|
|||
joinpoint Test.37 Test.36 #Attr.12:
|
||||
let Test.12 : {} = UnionAtIndex (Id 1) (Index 1) #Attr.12;
|
||||
let Test.13 : I64 = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
||||
dec #Attr.12;
|
||||
joinpoint #Derived_gen.0:
|
||||
let Test.43 : {} = Struct {};
|
||||
let Test.42 : {} = CallByName Test.11 Test.43 Test.12;
|
||||
let Test.38 : [<r>C {}, C I64 {}] = CallByName Test.9 Test.42 Test.13;
|
||||
|
@ -33,6 +38,14 @@ procedure Test.14 (Test.62, Test.63):
|
|||
jump Test.37 Test.40 Test.38;
|
||||
|
||||
in
|
||||
let #Derived_gen.1 : Int1 = lowlevel RefCountIsUnique #Attr.12;
|
||||
if #Derived_gen.1 then
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.0;
|
||||
else
|
||||
decref #Attr.12;
|
||||
jump #Derived_gen.0;
|
||||
in
|
||||
jump Test.37 Test.62 Test.63;
|
||||
|
||||
procedure Test.2 ():
|
||||
|
|
|
@ -46,10 +46,7 @@ procedure Json.102 (Json.103, Json.530, Json.101):
|
|||
|
||||
procedure Json.144 (Json.145, Json.486, #Attr.12):
|
||||
let Json.143 : List Str = StructAtIndex 1 #Attr.12;
|
||||
inc Json.143;
|
||||
let Json.142 : Str = StructAtIndex 0 #Attr.12;
|
||||
inc Json.142;
|
||||
dec #Attr.12;
|
||||
let Json.524 : I64 = 123i64;
|
||||
let Json.523 : U8 = CallByName Num.127 Json.524;
|
||||
let Json.520 : List U8 = CallByName List.4 Json.145 Json.523;
|
||||
|
@ -208,8 +205,8 @@ procedure Test.5 (Test.6, Test.7, Test.4):
|
|||
if Test.25 then
|
||||
let Test.26 : Str = "A";
|
||||
let Test.29 : Str = StructAtIndex 0 Test.4;
|
||||
inc Test.29;
|
||||
dec Test.4;
|
||||
let #Derived_gen.0 : Str = StructAtIndex 1 Test.4;
|
||||
dec #Derived_gen.0;
|
||||
let Test.28 : Str = CallByName Json.18 Test.29;
|
||||
let Test.27 : List Str = Array [Test.28];
|
||||
let Test.19 : {Str, List Str} = CallByName Json.22 Test.26 Test.27;
|
||||
|
@ -217,8 +214,8 @@ procedure Test.5 (Test.6, Test.7, Test.4):
|
|||
else
|
||||
let Test.21 : Str = "B";
|
||||
let Test.24 : Str = StructAtIndex 1 Test.4;
|
||||
inc Test.24;
|
||||
dec Test.4;
|
||||
let #Derived_gen.1 : Str = StructAtIndex 0 Test.4;
|
||||
dec #Derived_gen.1;
|
||||
let Test.23 : Str = CallByName Json.18 Test.24;
|
||||
let Test.22 : List Str = Array [Test.23];
|
||||
let Test.19 : {Str, List Str} = CallByName Json.22 Test.21 Test.22;
|
||||
|
|
|
@ -54,14 +54,13 @@ procedure Test.43 (Test.44, Test.42):
|
|||
let Test.75 : Int1 = CallByName Bool.2;
|
||||
if Test.75 then
|
||||
let Test.77 : Str = StructAtIndex 0 Test.42;
|
||||
inc Test.77;
|
||||
dec Test.42;
|
||||
let Test.76 : Int1 = CallByName Test.16 Test.77;
|
||||
let Test.61 : Int1 = CallByName Test.14 Test.76;
|
||||
jump Test.62 Test.61;
|
||||
else
|
||||
let Test.69 : U8 = StructAtIndex 1 Test.42;
|
||||
dec Test.42;
|
||||
let #Derived_gen.0 : Str = StructAtIndex 0 Test.42;
|
||||
dec #Derived_gen.0;
|
||||
let Test.63 : Int1 = CallByName Test.15 Test.69;
|
||||
let Test.61 : Int1 = CallByName Test.14 Test.63;
|
||||
jump Test.62 Test.61;
|
||||
|
|
|
@ -87,10 +87,7 @@ procedure Json.1 ():
|
|||
|
||||
procedure Json.144 (Json.145, Json.486, #Attr.12):
|
||||
let Json.143 : List [C {}, C {}] = StructAtIndex 1 #Attr.12;
|
||||
inc Json.143;
|
||||
let Json.142 : Str = StructAtIndex 0 #Attr.12;
|
||||
inc Json.142;
|
||||
dec #Attr.12;
|
||||
let Json.524 : I64 = 123i64;
|
||||
let Json.523 : U8 = CallByName Num.127 Json.524;
|
||||
let Json.520 : List U8 = CallByName List.4 Json.145 Json.523;
|
||||
|
@ -123,10 +120,7 @@ procedure Json.144 (Json.145, Json.486, #Attr.12):
|
|||
|
||||
procedure Json.144 (Json.145, Json.486, #Attr.12):
|
||||
let Json.143 : List [] = StructAtIndex 1 #Attr.12;
|
||||
inc Json.143;
|
||||
let Json.142 : Str = StructAtIndex 0 #Attr.12;
|
||||
inc Json.142;
|
||||
dec #Attr.12;
|
||||
let Json.574 : I64 = 123i64;
|
||||
let Json.573 : U8 = CallByName Num.127 Json.574;
|
||||
let Json.570 : List U8 = CallByName List.4 Json.145 Json.573;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue