soot.jimple.toolkits.pointer.util
Class NativeHelper

java.lang.Object
  extended by soot.jimple.toolkits.pointer.util.NativeHelper
Direct Known Subclasses:
SparkNativeHelper

public abstract class NativeHelper
extends Object


Constructor Summary
NativeHelper()
           
 
Method Summary
 ReferenceVariable arrayElementOf(ReferenceVariable base)
          Returns a reference variable representing the array element of this variable.
protected abstract  ReferenceVariable arrayElementOfImpl(ReferenceVariable base)
           
 void assign(ReferenceVariable lhs, ReferenceVariable rhs)
          Regular assignment such as "a = b".
protected abstract  void assignImpl(ReferenceVariable lhs, ReferenceVariable rhs)
          Sub classes should implement both.
 void assignObjectTo(ReferenceVariable lhs, AbstractObject obj)
          Assignment of an abstract object to the variable, such as " a = new A()", which is considered to add a target in a's points-to set.
protected abstract  void assignObjectToImpl(ReferenceVariable lhs, AbstractObject obj)
           
 ReferenceVariable cloneObject(ReferenceVariable source)
          Returns a variable which has the effect of cloning.
protected abstract  ReferenceVariable cloneObjectImpl(ReferenceVariable source)
           
 ReferenceVariable newInstanceOf(ReferenceVariable cls)
          Returns a variable which carries an allocation site with the least type (an artificial type, subtype of any other types, which means such type info is useless for resolving invocation targets).
protected abstract  ReferenceVariable newInstanceOfImpl(ReferenceVariable cls)
           
 ReferenceVariable staticField(String className, String fieldName)
          Returns a reference variable representing a static Java field.
protected abstract  ReferenceVariable staticFieldImpl(String className, String fieldName)
           
 ReferenceVariable tempField(String fieldsig)
          Returns a variable representing a non-existing Java field, used by e.g., java.lang.Class: getSingers, setSigners java.lang.Class: getProtectionDomain0, setProtectionDomain0 To simplify simulation, the temporary field variable is like a static field.
protected abstract  ReferenceVariable tempFieldImpl(String fieldsig)
           
 ReferenceVariable tempLocalVariable(SootMethod method)
           
protected abstract  ReferenceVariable tempLocalVariableImpl(SootMethod method)
           
 ReferenceVariable tempVariable()
          Make a temporary variable.
protected abstract  ReferenceVariable tempVariableImpl()
           
 void throwException(AbstractObject obj)
          Throw of an abstract object as an exception.
protected abstract  void throwExceptionImpl(AbstractObject obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeHelper

public NativeHelper()
Method Detail

assign

public void assign(ReferenceVariable lhs,
                   ReferenceVariable rhs)
Regular assignment such as "a = b".


assignObjectTo

public void assignObjectTo(ReferenceVariable lhs,
                           AbstractObject obj)
Assignment of an abstract object to the variable, such as " a = new A()", which is considered to add a target in a's points-to set. This method is used to fomulate the effect of getting an environmental constant object such as 'getClass'.


throwException

public void throwException(AbstractObject obj)
Throw of an abstract object as an exception.


arrayElementOf

public ReferenceVariable arrayElementOf(ReferenceVariable base)
Returns a reference variable representing the array element of this variable. Now it does not look at the array index.


cloneObject

public ReferenceVariable cloneObject(ReferenceVariable source)
Returns a variable which has the effect of cloning. A moderate approach would return the variable itself. e.g., a = b.clone() will be rendered to: Vr.isAssigned(Vb.cloneObject()); Va = Vr;


newInstanceOf

public ReferenceVariable newInstanceOf(ReferenceVariable cls)
Returns a variable which carries an allocation site with the least type (an artificial type, subtype of any other types, which means such type info is useless for resolving invocation targets). It is used for simulating java.lang.Class.newInstance0(); To verify, @this variable mush have CLASSCLASS type.


staticField

public ReferenceVariable staticField(String className,
                                     String fieldName)
Returns a reference variable representing a static Java field. The implementation must ensure that there is only one such representation for each static field.

Parameters:
field, - must be a static field

tempField

public ReferenceVariable tempField(String fieldsig)
Returns a variable representing a non-existing Java field, used by e.g., java.lang.Class: getSingers, setSigners java.lang.Class: getProtectionDomain0, setProtectionDomain0 To simplify simulation, the temporary field variable is like a static field. The temporary fields are uniquely indexed by signatures.


tempVariable

public ReferenceVariable tempVariable()
Make a temporary variable. It is used for assignment where both sides are complex variables. e.g., for java.lang.System arraycopy(src, ..., dst, ...) instead of make an expression : dst[] = src[], it introduces a temporary variable t = src[] dst[] = t The temporary variable has to be unique.


tempLocalVariable

public ReferenceVariable tempLocalVariable(SootMethod method)

assignImpl

protected abstract void assignImpl(ReferenceVariable lhs,
                                   ReferenceVariable rhs)
Sub classes should implement both.


assignObjectToImpl

protected abstract void assignObjectToImpl(ReferenceVariable lhs,
                                           AbstractObject obj)

throwExceptionImpl

protected abstract void throwExceptionImpl(AbstractObject obj)

arrayElementOfImpl

protected abstract ReferenceVariable arrayElementOfImpl(ReferenceVariable base)

cloneObjectImpl

protected abstract ReferenceVariable cloneObjectImpl(ReferenceVariable source)

newInstanceOfImpl

protected abstract ReferenceVariable newInstanceOfImpl(ReferenceVariable cls)

staticFieldImpl

protected abstract ReferenceVariable staticFieldImpl(String className,
                                                     String fieldName)

tempFieldImpl

protected abstract ReferenceVariable tempFieldImpl(String fieldsig)

tempVariableImpl

protected abstract ReferenceVariable tempVariableImpl()

tempLocalVariableImpl

protected abstract ReferenceVariable tempLocalVariableImpl(SootMethod method)