[Soot-list] jb.use-original-names option, local variables

Laurie Hendren hendren at cs.mcgill.ca
Sun Jul 9 08:17:17 EDT 2006


Right,  I thought I had answered this.  I will try again.

In normal mode, i.e. when you don't have "use-orginal-names" on,
Soot builds UD-DU webs to break variables into as many different
variables as possible.   This is part of the way to SSA form,  but
does not require phi-nodes.    The $ stack variables look just like
any other variables and so they will be split - but also normal programmer
variables will be split.   This is known to improve precision (SSA will
give you a bit more precision,  but at the cost of introducing phi-nodes).

The use-original-names option appears to disable splitting, because if you
split a programmer variable, it will not longer have its original name.
Since all variable splitting is done at the same time (stack variables look
like ordinary variables in Jimple,  we just give them a $ name to indicate
they came from stack locations),  this means that the stack variables do
not get split when the "use-original-names" is on.

Example:

    x = new Object();
    x = new Object();
    $s1 = new Object();
    $s1 = new Object();

with "use-orginal-names" off,  both x and $s1 will be split into two 
variables,   with "use-original-names" on, neither will be split.


Cheers, Laurie

Raghav Karol wrote:
> On 7/6/06, Eric Bodden <eric.bodden at mail.mcgill.ca> wrote:
>> > Is it possible to use distinct local variables for each new object
>> > created while still enjoying the benefit of original names?
>>
>> So you want multiple distinct variables with one and the same name?
> 
> I think I didn't explain my question well enough. With the
> use-original-names:true option in jimple the stack locations are
> represented by the *same* variable in a method I analyse. With the
> option set to false distinct variables are used for the stack
> locations.
> 
> Using the same variable makes makes my flow-insentive analysis
> imprecise. I wanted to know if it was possible to use distinct
> variables for the stack along with original variable names in jimple.
> 
> Thank your for suggesting SSA, I'll try it to see if it improves my 
> results.
> 
>> I am
>> very much sure that the Jimple IR assumes that each variable has its own
>> name. Hence, this should be impossible. What you could do is possibly
>> use something like SSA-form where variables are indexed but use the
>> original name as prefix or so. Or you could manually store a mapping to
>> the original name. Also you can use the Local Splitter (jb.ls) and
>> Jimple Local Aggregator (jb.a) to switch between the split and
>> aggregated local variable representation.
>>
> 
> 
>> Eric Bodden
>> Sable Research Group, McGill University
>> Montreal, Canada
>>
>>
> 
> 

-- 
+-----------------------------------------------------------------
| Laurie Hendren --- laurie.hendren at mcgill.ca
| Associate Dean (Academic), Faculty of Science,
| Dawson Hall, McGill University, 853 Sherbrooke St W,
| Montreal QC H3A 2T6 Canada, 514-398-7179, fax 514-398-1774
+----------------------------------------------------------------
| For contact and home page info as Professor, Computer Science:
| http://www.sable.mcgill.ca/~hendren   ---  hendren at cs.mcgill.ca
| Research: http://www.sable.mcgill.ca  http://aspectbench.org
+----------------------------------------------------------------



More information about the Soot-list mailing list