[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Jimple Canonical Form
On Fri, 5 Sep 2003, Venkatesh Prasad Ranganath wrote:
> Sorry, I used the wrong term. I meant "deterministic". However, the
> question is to what extent is the creation of Jimple deterministic? As
> you said, all else being equal or same across the 2 runs, can the user
> assume the following?
> 1> Identical identifiers represent the same variable, i.e., $r0 in the
> both bodies of a method identify the same variable.
> 2> Given a Stmt object AssignStmt(Local($r1) = Local($r2) +
> Local($r3)), one can obtain the use/def boxes as a List via
> getUseDefBoxes() call and the order of the boxes in the list will be
> same for the same statement in different bodies of the same method.
> 3> The order of the statements in different bodies of a method are
> identical.
Yes. This is the desired behaviour of Soot. If this is not the actual
behaviour of Soot, then it is a bug; please tell us about it, or supply a
patch.
We needed determinism to make our regression tests work; otherwise it was
quite difficult to compare Jimple output across runs. I think Raja's
thesis has a small section on how he created DeterministicHashMap to fix
the main part of the problem here.
pat