[Soot-list] baf locals packer question

mbatch at cs.mcgill.ca mbatch at cs.mcgill.ca
Thu Jul 6 18:51:07 EDT 2006


Hello all,

I have a Baf transform with moves bytecode around in a method. Sometimes
this results in the java verifier not being able to properly tell if a
register is initialized before use. To solve this in the most conservative
way, I run a guaranteed defs analysis and anywhere a local is used but not
defined I add an initializer at the top of the method for that local (i.e.
r1 = null). This is done BEFORE localpacking. This worked in the past, but
most recently I am getting unusual results. Since something was odd, I
went ahead and added initializers for EVERY local at the top of methods.

The local packer is "unsplitting" most of these locals such that they
share the same name (register) even though they clearly have overlapping
live ranges.

The following is an example. As you can see, z6, $z5, and $r30 are all
assigned $r20, even though they are boolean, boolean, and objectref
respectively, and clearly overlap. Anyone have any ideas on this one?


Before Local packing:

0 push null
1 store.r r2
2 push null
3 store.r r37
4 push null
5 store.r r39
6 push -1750717778
7 store.b $z7
8 push null
9 store.r $r41
10 push 1165249391
11 store.b z6
12 push 164612758
13 store.b $z5
14 push null
15 store.r r31
16 push null
17 store.r $r30
18 push null
19 store.r r27
20 push null
21 store.r $r26
22 push null
23 store.r r4
24 push null
25 store.r r5
26 push 1663228139
27 store.b $z3
28 push null
29 store.r $r20
30 push -472838325
31 store.b z2
32 push -2058237879
33 store.b $z1
34 push null
35 store.r r12
36 push null
37 store.r $r11
38 push null
39 store.r r3
40 push null
41 store.r $r8


After Local Packing:

0 push null
1 store.r r2
2 push null
3 store.r z2
4 push null
5 store.r r5
6 push -1750717778
7 store.b $r20
8 push null
9 store.r r3
10 push 1165249391
11 store.b $r20
12 push 164612758
13 store.b $r20
14 push null
15 store.r z2
16 push null
17 store.r $r20
18 push null
19 store.r z2
20 push null
21 store.r $r20
22 push null
23 store.r r3
24 push null
25 store.r r5
26 push 1663228139
27 store.b z2
28 push null
29 store.r $r20
30 push -472838325
31 store.b z2
32 push -2058237879
33 store.b r5
34 push null
35 store.r r3
36 push null
37 store.r r5
38 push null
39 store.r r3
40 push null
41 store.r r5	0 push null:q
1 store.r r2
2 push null
3 store.r r37
4 push null
5 store.r r39
6 push -1750717778
7 store.b $z7
8 push null
9 store.r $r41
10 push 1165249391
11 store.b z6
12 push 164612758
13 store.b $z5
14 push null
15 store.r r31
16 push null
17 store.r $r30
18 push null
19 store.r r27
20 push null
21 store.r $r26
22 push null
23 store.r r4
24 push null
25 store.r r5
26 push 1663228139
27 store.b $z3
28 push null
29 store.r $r20
30 push -472838325
31 store.b z2
32 push -2058237879
33 store.b $z1
34 push null
35 store.r r12
36 push null
37 store.r $r11
38 push null
39 store.r r3
40 push null
41 store.r $r8


Michael



More information about the Soot-list mailing list