Pseudocode: don't write full label name when jump on it

This commit is contained in:
Svetlana Isakova
2014-09-03 16:00:41 +04:00
parent 3a9b7bbade
commit 976d5ab030
89 changed files with 482 additions and 480 deletions
@@ -11,19 +11,19 @@ L0:
1 <START>
2 mark({ try { // do nothing } finally { test() } })
mark(try { // do nothing } finally { test() })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ test() }), mark({ // do nothing })]
jmp?(L2) NEXT:[mark({ test() }), mark({ // do nothing })]
3 mark({ // do nothing })
read (Unit)
2 jmp(L3 [skipFinallyToErrorBlock]) NEXT:[mark({ test() })]
2 jmp(L3) NEXT:[mark({ test() })]
L2 [onExceptionToFinallyBlock]:
L4 [start finally]:
3 mark({ test() }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
3 mark({ test() }) PREV:[jmp?(L2)]
mark(test())
call(test(), test) -> <v0>
L5 [finish finally]:
2 jmp(error) NEXT:[<ERROR>]
L3 [skipFinallyToErrorBlock]:
3 mark({ test() }) PREV:[jmp(L3 [skipFinallyToErrorBlock])]
3 mark({ test() }) PREV:[jmp(L3)]
mark(test())
call(test(), test) -> <v0>
2 merge(try { // do nothing } finally { test() }|!<v1>) -> <v2>
@@ -33,4 +33,4 @@ error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
=====================
@@ -11,20 +11,20 @@ L0:
1 <START>
2 mark({ try { // do nothing } finally { return test() } })
mark(try { // do nothing } finally { return test() })
jmp?(L2 [onExceptionToFinallyBlock]) NEXT:[mark({ return test() }), mark({ // do nothing })]
jmp?(L2) NEXT:[mark({ return test() }), mark({ // do nothing })]
3 mark({ // do nothing })
read (Unit)
2 jmp(L3 [skipFinallyToErrorBlock]) NEXT:[mark({ return test() })]
2 jmp(L3) NEXT:[mark({ return test() })]
L2 [onExceptionToFinallyBlock]:
L4 [start finally]:
3 mark({ return test() }) PREV:[jmp?(L2 [onExceptionToFinallyBlock])]
3 mark({ return test() }) PREV:[jmp?(L2)]
mark(test())
call(test(), test) -> <v0>
ret(*|<v0>) L1 NEXT:[<END>]
L5 [finish finally]:
- 2 jmp(error) NEXT:[<ERROR>] PREV:[]
L3 [skipFinallyToErrorBlock]:
3 mark({ return test() }) PREV:[jmp(L3 [skipFinallyToErrorBlock])]
3 mark({ return test() }) PREV:[jmp(L3)]
mark(test())
call(test(), test) -> <v0>
ret(*|<v0>) L1 NEXT:[<END>]
@@ -35,4 +35,4 @@ error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
=====================
@@ -21,12 +21,12 @@ L0:
call(toLong(), toLong|<v3>) -> <v4>
mark(x == 0.toLong())
call(x == 0.toLong(), equals|<v2>, <v4>) -> <v5>
jf(L2 [else branch]|<v5>) NEXT:[read (Unit), r(sum) -> <v6>]
jf(L2|<v5>) NEXT:[read (Unit), r(sum) -> <v6>]
r(sum) -> <v6>
ret(*|<v6>) L1 NEXT:[<END>]
- jmp(L3 ['if' expression result]) NEXT:[merge(if (x == 0.toLong()) return sum|!<v7>) -> <v8>] PREV:[]
- jmp(L3) NEXT:[merge(if (x == 0.toLong()) return sum|!<v7>) -> <v8>] PREV:[]
L2 [else branch]:
read (Unit) PREV:[jf(L2 [else branch]|<v5>)]
read (Unit) PREV:[jf(L2|<v5>)]
L3 ['if' expression result]:
merge(if (x == 0.toLong()) return sum|!<v7>) -> <v8>
r(x) -> <v9>
@@ -11,19 +11,19 @@ L0:
1 <START>
2 mark({ try { return foo() } catch (e: Throwable) { } })
mark(try { return foo() } catch (e: Throwable) { })
jmp?(L2 [onException]) NEXT:[v(e: Throwable), mark({ return foo() })]
jmp?(L2) NEXT:[v(e: Throwable), mark({ return foo() })]
3 mark({ return foo() })
mark(foo())
call(foo(), foo) -> <v0>
ret(*|<v0>) L1 NEXT:[<END>]
- 2 jmp(L3 [afterCatches]) NEXT:[merge(try { return foo() } catch (e: Throwable) { }|!<v1>, !<v3>) -> <v4>] PREV:[]
- 2 jmp(L3) NEXT:[merge(try { return foo() } catch (e: Throwable) { }|!<v1>, !<v3>) -> <v4>] PREV:[]
L2 [onException]:
3 v(e: Throwable) PREV:[jmp?(L2 [onException])]
3 v(e: Throwable) PREV:[jmp?(L2)]
magic[FAKE_INITIALIZER](e: Throwable) -> <v2>
w(e|<v2>)
4 mark({ })
read (Unit)
3 jmp(L3 [afterCatches])
3 jmp(L3)
L3 [afterCatches]:
2 merge(try { return foo() } catch (e: Throwable) { }|!<v1>, !<v3>) -> <v4>
L1:
@@ -32,4 +32,4 @@ error:
<ERROR> PREV:[]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
=====================
@@ -13,31 +13,31 @@ L0:
1 <START>
2 mark({ try { test() } catch (any : Exception) { test() } finally { test() } })
mark(try { test() } catch (any : Exception) { test() } finally { test() })
jmp?(L2 [onException]) NEXT:[v(any : Exception), jmp?(L3 [onExceptionToFinallyBlock])]
jmp?(L3 [onExceptionToFinallyBlock]) NEXT:[mark({ test() }), mark({ test() })]
jmp?(L2) NEXT:[v(any : Exception), jmp?(L3)]
jmp?(L3) NEXT:[mark({ test() }), mark({ test() })]
3 mark({ test() })
mark(test())
call(test(), test) -> <v0>
2 jmp(L4 [afterCatches]) NEXT:[jmp(L5 [skipFinallyToErrorBlock])]
2 jmp(L4) NEXT:[jmp(L5)]
L2 [onException]:
3 v(any : Exception) PREV:[jmp?(L2 [onException])]
3 v(any : Exception) PREV:[jmp?(L2)]
magic[FAKE_INITIALIZER](any : Exception) -> <v1>
w(any|<v1>)
4 mark({ test() })
mark(test())
call(test(), test) -> <v2>
3 jmp(L4 [afterCatches])
3 jmp(L4)
L4 [afterCatches]:
2 jmp(L5 [skipFinallyToErrorBlock]) NEXT:[mark({ test() })] PREV:[jmp(L4 [afterCatches]), jmp(L4 [afterCatches])]
2 jmp(L5) NEXT:[mark({ test() })] PREV:[jmp(L4), jmp(L4)]
L3 [onExceptionToFinallyBlock]:
L6 [start finally]:
3 mark({ test() }) PREV:[jmp?(L3 [onExceptionToFinallyBlock])]
3 mark({ test() }) PREV:[jmp?(L3)]
mark(test())
call(test(), test) -> <v3>
L7 [finish finally]:
2 jmp(error) NEXT:[<ERROR>]
L5 [skipFinallyToErrorBlock]:
3 mark({ test() }) PREV:[jmp(L5 [skipFinallyToErrorBlock])]
3 mark({ test() }) PREV:[jmp(L5)]
mark(test())
call(test(), test) -> <v3>
2 merge(try { test() } catch (any : Exception) { test() } finally { test() }|<v0>, <v2>) -> <v4>
@@ -47,4 +47,4 @@ error:
<ERROR> PREV:[jmp(error)]
sink:
<SINK> PREV:[<ERROR>, <END>]
=====================
=====================