[Soot-list] Rebuilding the context sensitive call graph
khilan.gudka at imperial.ac.uk
Thu Jan 31 15:42:59 EST 2008
Eric Bodden wrote:
>> What are the semantics of specialinvoke? Is it possible to replace
>> specialinvoke $r1.<init>() with virtualinvoke $r1.init(); ?
> No, that would be wrong. specialinvoke is statically resolved. A
> specialinvoke on a type T invokes the method on type T. A
> virtualinvoke in type T does a virtual dispatch and may invoke an
> implementation in a subtype, if the object you invoke the method on is
> of a subtype of T.
Ok, so from what I understand, the call graph will record this fact by
adding an edge from the specialinvoke statement to the corresponding
target method that will be called (which it can determine statically as
you said). So, even if it was dynamic dispatch, would it not still
invoke the method I have duplicated? Although, does the jvm expect the
method to also exist in all superclasses up to the reference type? Does
the jvm perform such checks?
Department of Computing
Imperial College London
More information about the Soot-list