[Soot-list] InvokeExpr.setMethod()

Ondrej Lhotak olhotak at sable.mcgill.ca
Thu Oct 21 11:27:48 EDT 2004


One of the updates that was made to Soot in response to the abc project
was to make it produce code like javac 1.4, in which method references
have not necessarily been resolved (to conform with section 13.1
of the JLS, 2nd ed). This means that an InvokeExpr must be able to
refer to methods which do not actually exist. To implement this,
we've added a SootMethodRef, which is a reference to a method. The
SootMethodRef has a resolve method which resolves it to a method
according to the specification in section 5.4.3.3 of the VM spec.
Also, a SootMethod has a makeRef() method which makes a reference to
that method. Therefore, an InvokeExpr now contains a SootMethodRef
rather than a SootMethod. In making this change, we did not feel it
was necessary to add a setMethodRef() method to change the method ref
in an existing InvokeExpr, because an InvokeExpr is always stored in
a ValueBox, whose purpose is to make it possible to replace the Value
stored in it. Therefore, the InvokeExpr can just be replaced with a new
InvokeExpr containing the new SootMethodRef. However, if it would help,
there is no problem with adding a setMethodRef() method to InvokeExpr.

Ondrej

On Thu, Oct 21, 2004 at 03:41:51PM +0200, Richard Stahl wrote:
> Hello,
> 
> for my transformation I used to use the SOOT 2.1.0 release while now i 
> have change to the development version.
> 
> I can not find InvokeExpr.setMethod(SootMethod m) anymore in the 
> development version.
> 
> Can you, please, let me know how to properly change the method in an 
> InvokeExpr?
> 
> Thank you very much in advance.
> 
> Best regards,
> Richard
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://www.sable.mcgill.ca/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list