[Soot-list] jimple, detecting loops in methods
Eric Bodden
eric.bodden at mail.mcgill.ca
Mon Jun 26 06:21:54 EDT 2006
Hi.
I think soot.jimple.toolkits.annotation.logic.LoopFinder is what you
want.
Hope that helps.
--
Eric Bodden
Sable Research Group, McGill University
Montreal, Canada
> -----Original Message-----
> From: soot-list-bounces at sable.mcgill.ca [mailto:soot-list-
> bounces at sable.mcgill.ca] On Behalf Of Raghav Karol
> Sent: Saturday, June 24, 2006 9:21 PM
> To: soot-list at sable.mcgill.ca
> Subject: [Soot-list] jimple, detecting loops in methods
>
> Hello *,
>
> I am using the jimple IR to try and determine which units occur inside
> loops and hence may execute more than once during a method invocation.
>
> I figured I could use the unit.getBoxesPointingToThis() method, to get
> StmtBoxes that point to the calling unit. But this is not what the
> method does; see details below.
>
> Could someone suggest a hint to do this.
>
> Thanks in advance,
> Raghav
>
> Details
> =====
>
> Original Method:
> -----------------------
> public void run() {
> for(int i = 0; i < 1000; i ++) {
> methodOne();
> }
> }
>
> unit.getPointingToThis() Info
> -----------------------------------------
> // Method body dump
> <experiment.test.ThreadFinderTest: void run()> { this := @this:
> experiment.test.ThreadFinderTest j = 100 i = 0 goto [?= (branch)]
> virtualinvoke this.<experiment.test.ThreadFinderTest: void
> methodOne()>() i = i + 1 if i < 1000 goto virtualinvoke
> this.<experiment.test.ThreadFinderTest: void methodOne()>() return }
>
> // Units with getBoxesPointingToThis().size() > 0
> Unit: virtualinvoke this.<experiment.test.ThreadFinderTest: void
> methodOne()>()
> GetPointingToThis().getUnit(): virtualinvoke
> this.<experiment.test.ThreadFinderTest: void methodOne()>()
> Unit: if i < 1000 goto virtualinvoke
> this.<experiment.test.ThreadFinderTest: void methodOne()>()
> GetPointingToThis().getUnit(): if i < 1000 goto virtualinvoke
> this.<experiment.test.ThreadFinderTest: void methodOne()>()
> _______________________________________________
> 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