Pseudocode: don't write full label name when jump on it
This commit is contained in:
@@ -25,7 +25,7 @@ L6 [condition entry point]:
|
||||
r(0) -> <v3>
|
||||
mark(a > 0)
|
||||
call(a > 0, compareTo|<v2>, <v3>) -> <v4>
|
||||
jt(L2 [loop entry point]|<v4>) USE: in: {a=READ} out: {a=READ}
|
||||
jt(L2|<v4>) USE: in: {a=READ} out: {a=READ}
|
||||
L3 [loop exit point]:
|
||||
read (Unit)
|
||||
2 mark("after") INIT: in: {} out: {}
|
||||
@@ -36,4 +36,4 @@ error:
|
||||
<ERROR>
|
||||
sink:
|
||||
<SINK> USE: in: {} out: {}
|
||||
=====================
|
||||
=====================
|
||||
@@ -19,7 +19,7 @@ L0:
|
||||
v(i) INIT: in: {} out: {i=D}
|
||||
L2 [loop entry point]:
|
||||
L6 [condition entry point]:
|
||||
jmp?(L3 [loop exit point]) INIT: in: {i=D} out: {i=D}
|
||||
jmp?(L3) INIT: in: {i=D} out: {i=D}
|
||||
magic[LOOP_RANGE_ITERATION](1..10|<v3>) -> <v4>
|
||||
w(i|<v4>) INIT: in: {i=D} out: {i=ID}
|
||||
mark(for (i in 1..10) { val a = i }) INIT: in: {i=ID} out: {i=ID}
|
||||
@@ -28,7 +28,7 @@ L4 [body entry point]:
|
||||
v(val a = i) INIT: in: {i=ID} out: {a=D, i=ID}
|
||||
r(i) -> <v5> INIT: in: {a=D, i=ID} out: {a=D, i=ID}
|
||||
w(a|<v5>) INIT: in: {a=D, i=ID} out: {a=ID, i=ID}
|
||||
3 jmp(L2 [loop entry point]) INIT: in: {i=ID} out: {i=ID} USE: in: {i=READ} out: {i=READ}
|
||||
3 jmp(L2) INIT: in: {i=ID} out: {i=ID} USE: in: {i=READ} out: {i=READ}
|
||||
L3 [loop exit point]:
|
||||
L5 [body exit point]:
|
||||
read (Unit) INIT: in: {i=D} out: {i=D}
|
||||
@@ -40,4 +40,4 @@ error:
|
||||
<ERROR>
|
||||
sink:
|
||||
<SINK> USE: in: {} out: {}
|
||||
=====================
|
||||
=====================
|
||||
@@ -18,7 +18,7 @@ L0:
|
||||
w(b|<v1>) INIT: in: {b=D} out: {b=ID}
|
||||
v(val f = { (x: Int) -> val a = x + b }) INIT: in: {b=ID} out: {b=ID, f=D}
|
||||
mark({ (x: Int) -> val a = x + b }) INIT: in: {b=ID, f=D} out: {b=ID, f=D}
|
||||
jmp?(L2 [after local declaration])
|
||||
jmp?(L2)
|
||||
d({ (x: Int) -> val a = x + b }) USE: in: {b=READ} out: {b=READ}
|
||||
L2 [after local declaration]:
|
||||
r({ (x: Int) -> val a = x + b }) -> <v2>
|
||||
|
||||
@@ -17,12 +17,12 @@ L0:
|
||||
r("before") -> <v0>
|
||||
mark(if (true) { val a = 1 } else { val b = 2 })
|
||||
r(true) -> <v1>
|
||||
jf(L2 [else branch]|<v1>)
|
||||
jf(L2|<v1>)
|
||||
3 mark({ val a = 1 })
|
||||
v(val a = 1) INIT: in: {} out: {a=D}
|
||||
r(1) -> <v2> INIT: in: {a=D} out: {a=D}
|
||||
w(a|<v2>) INIT: in: {a=D} out: {a=ID}
|
||||
2 jmp(L3 ['if' expression result]) INIT: in: {} out: {}
|
||||
2 jmp(L3) INIT: in: {} out: {}
|
||||
L2 [else branch]:
|
||||
3 mark({ val b = 2 })
|
||||
v(val b = 2) INIT: in: {} out: {b=D}
|
||||
|
||||
@@ -25,7 +25,7 @@ L0:
|
||||
magic[IMPLICIT_RECEIVER](x) -> <v2> INIT: in: {a=D, x=ID} out: {a=D, x=ID}
|
||||
r(x|<v2>) -> <v3>
|
||||
w(a|<v3>) INIT: in: {a=D, x=ID} out: {a=ID, x=ID}
|
||||
2 jmp?(L2 [after local declaration]) INIT: in: {x=ID} out: {x=ID}
|
||||
2 jmp?(L2) INIT: in: {x=ID} out: {x=ID}
|
||||
d(fun foo() { val b = x }) USE: in: {x=READ} out: {x=READ}
|
||||
L2 [after local declaration]:
|
||||
mark("after")
|
||||
|
||||
@@ -16,7 +16,7 @@ L0:
|
||||
v(val b = 1) INIT: in: {} out: {b=D}
|
||||
r(1) -> <v1> INIT: in: {b=D} out: {b=D}
|
||||
w(b|<v1>) INIT: in: {b=D} out: {b=ID}
|
||||
jmp?(L2 [after local declaration]) INIT: in: {b=ID} out: {b=ID}
|
||||
jmp?(L2) INIT: in: {b=ID} out: {b=ID}
|
||||
d(fun local(x: Int) { val a = x + b }) USE: in: {b=READ} out: {b=READ}
|
||||
L2 [after local declaration]:
|
||||
mark("after")
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ L0:
|
||||
v(val b = 1) INIT: in: {} out: {b=D}
|
||||
r(1) -> <v1> INIT: in: {b=D} out: {b=D}
|
||||
w(b|<v1>) INIT: in: {b=D} out: {b=ID}
|
||||
jmp?(L2 [after local declaration]) INIT: in: {b=ID} out: {b=ID}
|
||||
jmp?(L2) INIT: in: {b=ID} out: {b=ID}
|
||||
d(fun local(x: Int) = x + b) USE: in: {b=READ} out: {b=READ}
|
||||
L2 [after local declaration]:
|
||||
mark("after")
|
||||
|
||||
@@ -21,7 +21,7 @@ L0:
|
||||
v(val a = 1) INIT: in: {} out: {a=D}
|
||||
r(1) -> <v1> INIT: in: {a=D} out: {a=D}
|
||||
w(a|<v1>) INIT: in: {a=D} out: {a=ID}
|
||||
2 jmp?(L2 [after local declaration]) INIT: in: {} out: {}
|
||||
2 jmp?(L2) INIT: in: {} out: {}
|
||||
d(fun foo() { val b = 2 })
|
||||
L2 [after local declaration]:
|
||||
mark("after")
|
||||
|
||||
@@ -23,7 +23,7 @@ L0:
|
||||
v(val x = 1) INIT: in: {bar=D} out: {bar=D, x=D}
|
||||
r(1) -> <v1> INIT: in: {bar=D, x=D} out: {bar=D, x=D}
|
||||
w(x|<v1>) INIT: in: {bar=D, x=D} out: {bar=D, x=ID}
|
||||
2 jmp?(L2 [after local declaration]) INIT: in: {bar=D} out: {bar=D}
|
||||
2 jmp?(L2) INIT: in: {bar=D} out: {bar=D}
|
||||
d(fun foo() { val a = 2 })
|
||||
L2 [after local declaration]:
|
||||
r(object { { val x = 1 } fun foo() { val a = 2 } }) -> <v2>
|
||||
|
||||
@@ -15,10 +15,10 @@ L0:
|
||||
1 <START> INIT: in: {} out: {} USE: in: {} out: {}
|
||||
2 mark({ class A { var a : Int get() { return $a } set(v: Int) { $a = v } } })
|
||||
v(var a : Int get() { return $a } set(v: Int) { $a = v }) INIT: in: {} out: {a=D}
|
||||
jmp?(L2 [after local declaration]) INIT: in: {a=D} out: {a=D}
|
||||
jmp?(L2) INIT: in: {a=D} out: {a=D}
|
||||
d(get() { return $a }) USE: in: {a=READ} out: {a=READ}
|
||||
L2 [after local declaration]:
|
||||
jmp?(L5 [after local declaration])
|
||||
jmp?(L5)
|
||||
d(set(v: Int) { $a = v }) USE: in: {a=ONLY_WRITTEN_NEVER_READ} out: {a=ONLY_WRITTEN_NEVER_READ}
|
||||
L1:
|
||||
L5 [after local declaration]:
|
||||
|
||||
@@ -19,12 +19,12 @@ L0:
|
||||
mark("before")
|
||||
r("before") -> <v0>
|
||||
mark(try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 })
|
||||
jmp?(L2 [onException])
|
||||
jmp?(L3 [onExceptionToFinallyBlock])
|
||||
jmp?(L2)
|
||||
jmp?(L3)
|
||||
3 mark({ foo() })
|
||||
mark(foo())
|
||||
call(foo(), foo) -> <v1>
|
||||
2 jmp(L4 [afterCatches]) USE: in: {} out: {}
|
||||
2 jmp(L4) USE: in: {} out: {}
|
||||
L2 [onException]:
|
||||
3 v(e: Exception) INIT: in: {} out: {e=D}
|
||||
magic[FAKE_INITIALIZER](e: Exception) -> <v2> INIT: in: {e=D} out: {e=D}
|
||||
@@ -33,9 +33,9 @@ L2 [onException]:
|
||||
v(val a = e) INIT: in: {e=ID} out: {a=D, e=ID} USE: in: {e=READ} out: {e=READ}
|
||||
r(e) -> <v3> INIT: in: {a=D, e=ID} out: {a=D, e=ID} USE: in: {} out: {e=READ}
|
||||
w(a|<v3>) INIT: in: {a=D, e=ID} out: {a=ID, e=ID}
|
||||
3 jmp(L4 [afterCatches]) INIT: in: {e=ID} out: {e=ID}
|
||||
3 jmp(L4) INIT: in: {e=ID} out: {e=ID}
|
||||
L4 [afterCatches]:
|
||||
2 jmp(L5 [skipFinallyToErrorBlock]) INIT: in: {} out: {}
|
||||
2 jmp(L5) INIT: in: {} out: {}
|
||||
L3 [onExceptionToFinallyBlock]:
|
||||
L6 [start finally]:
|
||||
3 mark({ val a = 1 })
|
||||
@@ -45,6 +45,7 @@ L6 [start finally]:
|
||||
L7 [finish finally]:
|
||||
2 jmp(error) INIT: in: {} out: {}
|
||||
L5 [skipFinallyToErrorBlock]:
|
||||
L8 [copy of L3, onExceptionToFinallyBlock]:
|
||||
3 mark({ val a = 1 })
|
||||
v(val a = 1) INIT: in: {} out: {a=D}
|
||||
r(1) -> <v4> INIT: in: {a=D} out: {a=D}
|
||||
@@ -58,4 +59,4 @@ error:
|
||||
<ERROR>
|
||||
sink:
|
||||
<SINK> USE: in: {} out: {}
|
||||
=====================
|
||||
=====================
|
||||
@@ -20,7 +20,7 @@ L6 [condition entry point]:
|
||||
L4 [body entry point]:
|
||||
3 mark({ val a: Int })
|
||||
v(val a: Int) INIT: in: {} out: {a=D}
|
||||
2 jmp(L2 [loop entry point]) INIT: in: {} out: {} USE: in: {} out: {}
|
||||
2 jmp(L2) INIT: in: {} out: {} USE: in: {} out: {}
|
||||
L3 [loop exit point]:
|
||||
L5 [body exit point]:
|
||||
- read (Unit)
|
||||
@@ -32,4 +32,4 @@ error:
|
||||
<ERROR>
|
||||
sink:
|
||||
<SINK> USE: in: {} out: {}
|
||||
=====================
|
||||
=====================
|
||||
Reference in New Issue
Block a user