[Soot-list] coupling between an allocation site and the constructorinvocation site

Eric Bodden eric.bodden at mail.mcgill.ca
Tue Jan 23 10:18:17 EST 2007


It depends. Generally, the invocation of the constructor can be (almost)
arbitrarily far away from the object instantiation. This is just
according to the JVM specs. The only limitation is that it has to occur
before any other use of the variable.

Having said that, Soot has a class JimpleConstructorFolder, which is a
BodyTransformer. If you apply this transformation to your method body in
question, it will soundly move each such constructor invocation directly
behind the "new" statement.


Eric


> -----Original Message-----
> From: soot-list-bounces at sable.mcgill.ca [mailto:soot-list-
> bounces at sable.mcgill.ca] On Behalf Of Peng Li
> Sent: Monday, January 22, 2007 10:10 PM
> To: soot-list at sable.mcgill.ca
> Subject: [Soot-list] coupling between an allocation site and the
> constructorinvocation site
> 
> HI
> For each instantiation of an object in java is represented as two
> jimple stmts, one newstmt and one specialinvoke stmt(constructor
> invocation site). I am just wondering if there is a easy and simple
> method to find the constructor invocation site based on the allocation
> site which i specified?
> 
> Cheers
> Peng
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list



More information about the Soot-list mailing list