Skip to content

Commit

Permalink
Undo field non-doubling
Browse files Browse the repository at this point in the history
  • Loading branch information
Kroppeb committed Jul 16, 2023
1 parent 78950d2 commit b74ab15
Show file tree
Hide file tree
Showing 21 changed files with 639 additions and 644 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ public int getExprentUse() {
//+ int j1 = l + i1 * this.field_225231_b;
//+ aint[j1] &= 16777215;
// return 0; // multiple references to a field considered dangerous in a multithreaded environment, thus no Exprent.MULTIPLE_USES set here
// return instance == null ? Exprent.MULTIPLE_USES : instance.getExprentUse() & Exprent.MULTIPLE_USES;
return instance == null ? Exprent.MULTIPLE_USES : instance.getExprentUse() & Exprent.MULTIPLE_USES;
// getting a field could trigger classloading, so it's technically not pure.
// TODO: add a decompiler option?
return instance == null ? Exprent.SIDE_EFFECTS_FREE : instance.getExprentUse() & Exprent.SIDE_EFFECTS_FREE;
// return instance == null ? Exprent.SIDE_EFFECTS_FREE : instance.getExprentUse() & Exprent.SIDE_EFFECTS_FREE;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion testData/results/pkg/TestAmbiguousCall.dec
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class TestAmbiguousCall {
this.m2(this.field++);// 40
this.m2((long)(this.field++));// 41
this.m2((int)(this.field2++));// 43
this.m2((long)(this.field2++));// 44
this.m2(this.field2++);// 44
}// 45
}

Expand Down
4 changes: 3 additions & 1 deletion testData/results/pkg/TestArrayAssign.dec
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class TestArrayAssign {

public void test2(TestArrayAssign.Holder holder, int i, double inc) {
for (int j = 0; j < i; ++j) {// 15
holder.a[j] += inc;// 16
holder.a[j] = holder.a[j] + inc;// 16
}
}// 18

Expand Down Expand Up @@ -150,7 +150,9 @@ class 'pkg/TestArrayAssign' {
c 15
d 15
e 15
10 15
11 15
12 15
13 15
14 14
15 14
Expand Down
24 changes: 18 additions & 6 deletions testData/results/pkg/TestArrayFieldAccess2.dec
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ public class TestArrayFieldAccess2 {
}// 10

public void test1() {
this.value = this.array[this.index] += 4;// 13
this.value = this.array[this.index] = this.array[this.index] + 4;// 13
}// 14

public void test2() {
this.value = this.array[this.index] -= 4;// 17
this.value = this.array[this.index] = this.array[this.index] - 4;// 17
}// 18

public void test3() {
this.value = this.array[this.index] *= 4;// 21
this.value = this.array[this.index] = this.array[this.index] * 4;// 21
}// 22

public void test4() {
this.value = this.array[this.index] /= 4;// 25
this.value = this.array[this.index] = this.array[this.index] / 4;// 25
}// 26

public void test5() {
this.value = this.array[this.index] |= 4;// 29
this.value = this.array[this.index] = this.array[this.index] | 4;// 29
}// 30

public void test6() {
this.value = this.array[this.index] &= 4;// 33
this.value = this.array[this.index] = this.array[this.index] & 4;// 33
}// 34

public void testPP() {
Expand Down Expand Up @@ -91,7 +91,9 @@ class 'pkg/TestArrayFieldAccess2' {
6 12
7 12
8 12
a 12
b 12
c 12
e 12
f 12
10 12
Expand All @@ -109,7 +111,9 @@ class 'pkg/TestArrayFieldAccess2' {
6 16
7 16
8 16
a 16
b 16
c 16
e 16
f 16
10 16
Expand All @@ -127,7 +131,9 @@ class 'pkg/TestArrayFieldAccess2' {
6 20
7 20
8 20
a 20
b 20
c 20
e 20
f 20
10 20
Expand All @@ -145,7 +151,9 @@ class 'pkg/TestArrayFieldAccess2' {
6 24
7 24
8 24
a 24
b 24
c 24
e 24
f 24
10 24
Expand All @@ -163,7 +171,9 @@ class 'pkg/TestArrayFieldAccess2' {
6 28
7 28
8 28
a 28
b 28
c 28
e 28
f 28
10 28
Expand All @@ -181,7 +191,9 @@ class 'pkg/TestArrayFieldAccess2' {
6 32
7 32
8 32
a 32
b 32
c 32
e 32
f 32
10 32
Expand Down
33 changes: 15 additions & 18 deletions testData/results/pkg/TestDoublePopAfterJump.dec
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final class TestDoublePopAfterJump {

while (var10001 - 100 <= 0) {// 57 58 59
var10001 += 1;// 60
if ((var10001 + 1) % 3 == 0) {// 61 63 64 65
if (var10001 % 3 == 0) {// 63 64 65
var10000.print("Fizz");// 69 70
var10001 = -var10001;// 72
}
Expand All @@ -38,14 +38,12 @@ public final class TestDoublePopAfterJump {
}

if (var10001 <= 0) {// 90
int var14 = -var10001;// 91
int var11 = -var10001;// 91
var10000.println();// 94
var10001 = var14;
var10001 = var11;
} else {
var10000.println(Integer.toString(var10001));// 100 101
PrintStream var17 = java/lang/System/out;// 102
var10001 = var10001;
var10000 = var17;
var10000 = java/lang/System/out;// 102
}
}
}// 108
Expand Down Expand Up @@ -84,7 +82,6 @@ class 'pkg/TestDoublePopAfterJump' {
7 23
8 23
b 24
c 25
e 25
f 25
10 25
Expand Down Expand Up @@ -119,14 +116,14 @@ class 'pkg/TestDoublePopAfterJump' {
45 45
46 45
47 45
4e 50
4e 48
}

method 'fizzBuzzReduced ()V' {
0 53
1 54
3 56
b 58
0 51
1 52
3 54
b 56
}
}

Expand All @@ -147,7 +144,6 @@ Lines mapping:
58 <-> 24
59 <-> 24
60 <-> 25
61 <-> 26
63 <-> 26
64 <-> 26
65 <-> 26
Expand All @@ -168,11 +164,11 @@ Lines mapping:
100 <-> 45
101 <-> 45
102 <-> 46
108 <-> 51
115 <-> 54
116 <-> 55
119 <-> 57
124 <-> 59
108 <-> 49
115 <-> 52
116 <-> 53
119 <-> 55
124 <-> 57
Not mapped:
30
33
Expand All @@ -183,6 +179,7 @@ Not mapped:
42
43
56
61
62
67
68
Expand Down
111 changes: 54 additions & 57 deletions testData/results/pkg/TestFieldSingleAccess.dec
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,17 @@ public final class TestFieldSingleAccess {
public int field2;

public final void test() {
Integer var10000 = this.field;// 25 26
if (var10000 != null) {// 28
System.out.println(var10000);// 29 31
if (this.field != null) {// 25 26 28
System.out.println(this.field);// 29 31
}
}// 32 34

public final void test2() {
int var10000 = this.field2;// 41 42
System.out.println(var10000 * var10000);// 44 45 47
System.out.println(this.field2 * this.field2);// 41 42 44 45 47
}

public final void test1() {
synchronized (this.field) {// 53 54 56 57
synchronized (this.field) {// 53 54 57
System.out.println('1');// 59 60 61
}
}// 79
Expand All @@ -29,75 +27,74 @@ class 'pkg/TestFieldSingleAccess' {
1 7
2 7
3 7
5 8
8 9
9 9
a 9
c 9
d 9
e 9
f 11
10 11
5 7
8 8
9 8
a 8
c 8
d 8
e 8
f 10
10 10
}

method 'test2 ()V' {
0 14
1 14
2 14
3 14
5 15
6 15
7 15
8 15
a 15
0 13
1 13
2 13
3 13
5 13
6 13
7 13
8 13
a 13
}

method 'test1 ()V' {
0 19
1 19
2 19
3 19
5 19
6 19
7 20
8 20
9 20
a 20
b 20
c 20
d 20
e 20
19 22
0 17
1 17
2 17
3 17
6 17
7 18
8 18
9 18
a 18
b 18
c 18
d 18
e 18
19 20
}
}

Lines mapping:
25 <-> 8
26 <-> 8
28 <-> 9
29 <-> 10
31 <-> 10
32 <-> 12
34 <-> 12
41 <-> 15
42 <-> 15
44 <-> 16
45 <-> 16
47 <-> 16
53 <-> 20
54 <-> 20
56 <-> 20
57 <-> 20
59 <-> 21
60 <-> 21
61 <-> 21
79 <-> 23
28 <-> 8
29 <-> 9
31 <-> 9
32 <-> 11
34 <-> 11
41 <-> 14
42 <-> 14
44 <-> 14
45 <-> 14
47 <-> 14
53 <-> 18
54 <-> 18
57 <-> 18
59 <-> 19
60 <-> 19
61 <-> 19
79 <-> 21
Not mapped:
27
30
43
46
55
56
62
63
65
Expand Down
Loading

0 comments on commit b74ab15

Please sign in to comment.