blob: f1a909118ada793855d6f5381ed91478f4cf5e90 [file] [log] [blame]
== myRun ==
inline fun <T> myRun(block: () -> T): T {
contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
}
return block()
}
---------------------
L0:
1 <START> INIT: in: {} out: {}
v(block: () -> T) INIT: in: {} out: {}
magic[FAKE_INITIALIZER](block: () -> T) -> <v0> INIT: in: {} out: {}
w(block|<v0>) INIT: in: {} out: {}
2 mark({ contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) } return block() }) INIT: in: {} out: {}
mark({ callsInPlace(block, InvocationKind.EXACTLY_ONCE) })
jmp?(L2)
d({ callsInPlace(block, InvocationKind.EXACTLY_ONCE) })
L2 [after local declaration]:
r({ callsInPlace(block, InvocationKind.EXACTLY_ONCE) }) -> <v1>
mark(contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) })
call(contract { callsInPlace(block, InvocationKind.EXACTLY_ONCE) }, contract|<v1>) -> <v2>
r(block) -> <v3>
mark(block())
call(block(), invoke|<v3>) -> <v4>
ret(*|<v4>) L1
L1:
1 <END>
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== anonymous_0 ==
{
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
}
---------------------
L3:
3 <START> INIT: in: {} out: {}
4 mark(callsInPlace(block, InvocationKind.EXACTLY_ONCE))
magic[IMPLICIT_RECEIVER](callsInPlace(block, InvocationKind.EXACTLY_ONCE)) -> <v0>
r(block) -> <v1>
mark(InvocationKind.EXACTLY_ONCE)
r(EXACTLY_ONCE) -> <v2>
mark(callsInPlace(block, InvocationKind.EXACTLY_ONCE))
call(callsInPlace(block, InvocationKind.EXACTLY_ONCE), callsInPlace|<v0>, <v1>, <v2>) -> <v3>
L4:
3 <END>
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== getBoolean ==
fun getBoolean(): Boolean = false
---------------------
L0:
1 <START> INIT: in: {} out: {}
r(false) -> <v0>
ret(*|<v0>) L1
L1:
<END>
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== test ==
fun test() {
val x: Int
if (getBoolean())
myRun {
while (getBoolean()) {
do {
myRun {
if (getBoolean()) {
x = 42
}
else {
x = 43
}
}
break
} while (getBoolean())
myRun { x.inc() }
myRun { x = 42 }
break
}
x = 42
}
else
myRun {
x = 42
}
x.inc()
}
---------------------
L0:
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
2 mark({ val x: Int if (getBoolean()) myRun { while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42 } else myRun { x = 42 } x.inc() })
v(val x: Int) INIT: in: {} out: {x=D}
mark(if (getBoolean()) myRun { while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42 } else myRun { x = 42 }) INIT: in: {x=D} out: {x=D}
mark(getBoolean())
call(getBoolean(), getBoolean) -> <v0>
jf(L2|<v0>)
mark({ while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42 })
r({ while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42 }) -> <v1>
mark(myRun { while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42 })
call(myRun { while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42 }, myRun|<v1>) -> <v2>
L3 [before inlined declaration]:
inlined({ while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42 }) INIT: in: {x=ID} out: {x=ID} USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
L4 [after inlined declaration]:
jmp(L31) USE: in: {x=READ} out: {x=READ}
L2 [else branch]:
mark({ x = 42 }) INIT: in: {x=D} out: {x=D}
r({ x = 42 }) -> <v3>
mark(myRun { x = 42 })
call(myRun { x = 42 }, myRun|<v3>) -> <v4>
L32 [before inlined declaration]:
inlined({ x = 42 }) INIT: in: {x=ID} out: {x=ID} USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
L31 ['if' expression result]:
L33 [after inlined declaration]:
merge(if (getBoolean()) myRun { while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42 } else myRun { x = 42 }|<v2>, <v4>) -> <v5>
mark(x.inc()) USE: in: {x=READ} out: {x=READ}
r(x) -> <v6> USE: in: {} out: {x=READ}
mark(inc())
call(inc(), inc|<v6>) -> <v7>
L1:
1 <END> INIT: in: {} out: {}
error:
<ERROR>
sink:
<SINK> USE: in: {} out: {}
=====================
== inlined anonymous_1 ==
{
while (getBoolean()) {
do {
myRun {
if (getBoolean()) {
x = 42
}
else {
x = 43
}
}
break
} while (getBoolean())
myRun { x.inc() }
myRun { x = 42 }
break
}
x = 42
}
---------------------
L5:
3 <START> INIT: in: {x=D} out: {x=D}
4 mark(while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break } x = 42)
L7 [loop entry point]:
L11 [condition entry point]:
mark(getBoolean())
call(getBoolean(), getBoolean) -> <v0>
mark(while (getBoolean()) { do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break })
jf(L8|<v0>)
L9 [body entry point]:
5 mark({ do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()) myRun { x.inc() } myRun { x = 42 } break })
6 mark(do { myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break } while (getBoolean()))
L12 [loop entry point]:
L14 [body entry point]:
mark({ myRun { if (getBoolean()) { x = 42 } else { x = 43 } } break })
mark({ if (getBoolean()) { x = 42 } else { x = 43 } })
r({ if (getBoolean()) { x = 42 } else { x = 43 } }) -> <v1>
mark(myRun { if (getBoolean()) { x = 42 } else { x = 43 } })
call(myRun { if (getBoolean()) { x = 42 } else { x = 43 } }, myRun|<v1>) -> <v2>
L17 [before inlined declaration]:
inlined({ if (getBoolean()) { x = 42 } else { x = 43 } }) INIT: in: {x=ID} out: {x=ID} USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
L18 [after inlined declaration]:
jmp(L13) USE: in: {x=READ} out: {x=READ}
L15 [body exit point]:
L16 [condition entry point]:
- mark(getBoolean())
- call(getBoolean(), getBoolean) -> <v4>
- 5 jt(L12|<v4>)
L13 [loop exit point]:
read (Unit) INIT: in: {x=ID} out: {x=ID}
mark({ x.inc() })
r({ x.inc() }) -> <v5>
mark(myRun { x.inc() })
call(myRun { x.inc() }, myRun|<v5>) -> <v6>
L23 [before inlined declaration]:
inlined({ x.inc() }) USE: in: {x=READ} out: {x=READ}
L24 [after inlined declaration]:
mark({ x = 42 })
r({ x = 42 }) -> <v7>
mark(myRun { x = 42 })
call(myRun { x = 42 }, myRun|<v7>) -> <v8>
L27 [before inlined declaration]:
inlined({ x = 42 })
L28 [after inlined declaration]:
jmp(L8) USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
- 4 jmp(L7)
L8 [loop exit point]:
L10 [body exit point]:
read (Unit) INIT: in: {x=I?D} out: {x=I?D}
r(42) -> <v10> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
w(x|<v10>) INIT: in: {x=I?D} out: {x=ID} USE: in: {x=READ} out: {x=WRITTEN_AFTER_READ}
L6:
3 <END> INIT: in: {x=ID} out: {x=ID} USE: in: {x=READ} out: {x=READ}
error:
- <ERROR>
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {x=READ} out: {x=READ}
=====================
== inlined anonymous_2 ==
{
if (getBoolean()) {
x = 42
}
else {
x = 43
}
}
---------------------
L19:
7 <START> INIT: in: {x=D} out: {x=D}
8 mark(if (getBoolean()) { x = 42 } else { x = 43 })
mark(if (getBoolean()) { x = 42 } else { x = 43 })
mark(getBoolean())
call(getBoolean(), getBoolean) -> <v0>
jf(L21|<v0>)
9 mark({ x = 42 })
r(42) -> <v1> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
w(x|<v1>) INIT: in: {x=D} out: {x=ID} USE: in: {x=READ} out: {x=WRITTEN_AFTER_READ}
8 jmp(L22) INIT: in: {x=ID} out: {x=ID} USE: in: {x=READ} out: {x=READ}
L21 [else branch]:
9 mark({ x = 43 }) INIT: in: {x=D} out: {x=D}
r(43) -> <v3> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
w(x|<v3>) INIT: in: {x=D} out: {x=ID} USE: in: {x=READ} out: {x=WRITTEN_AFTER_READ}
L22 ['if' expression result]:
8 merge(if (getBoolean()) { x = 42 } else { x = 43 }|!<v2>, !<v4>) -> <v5> INIT: in: {x=ID} out: {x=ID}
L20:
7 <END> USE: in: {x=READ} out: {x=READ}
error:
- <ERROR>
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {x=READ} out: {x=READ}
=====================
== inlined anonymous_3 ==
{ x.inc() }
---------------------
L25:
6 <START> INIT: in: {x=ID} out: {x=ID}
7 mark(x.inc())
mark(x.inc()) USE: in: {x=READ} out: {x=READ}
r(x) -> <v0> USE: in: {x=WRITTEN_AFTER_READ} out: {x=READ}
mark(inc())
call(inc(), inc|<v0>) -> <v1>
6 ret(*|<v1>) L26
L26:
<END> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
error:
- <ERROR>
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
=====================
== inlined anonymous_4 ==
{ x = 42 }
---------------------
L29:
6 <START> INIT: in: {x=ID} out: {x=ID}
7 mark(x = 42)
r(42) -> <v0>
w(x|<v0>)
L30:
6 <END> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
error:
- <ERROR>
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
=====================
== inlined anonymous_5 ==
{
x = 42
}
---------------------
L34:
3 <START> INIT: in: {x=D} out: {x=D}
4 mark(x = 42)
r(42) -> <v0> USE: in: {x=WRITTEN_AFTER_READ} out: {x=WRITTEN_AFTER_READ}
w(x|<v0>) INIT: in: {x=D} out: {x=ID} USE: in: {x=READ} out: {x=WRITTEN_AFTER_READ}
L35:
3 <END> INIT: in: {x=ID} out: {x=ID} USE: in: {x=READ} out: {x=READ}
error:
- <ERROR>
sink:
<SINK> INIT: in: {x=ID} out: {x=ID} USE: in: {x=READ} out: {x=READ}
=====================