improved Javadoc

This commit is contained in:
Manu Sridharan 2012-09-19 11:45:49 -04:00
parent a87d486b42
commit 210d4c53ea
2 changed files with 24 additions and 0 deletions

View File

@ -9,6 +9,10 @@ import com.ibm.wala.ssa.SSAInstructionFactory;
import com.ibm.wala.ssa.SymbolTable;
import com.ibm.wala.types.TypeReference;
/**
* Checks if a reference is null or undefined, and if so, throws a
* ReferenceError. Otherwise, it's a no-op.
*/
public class JavaScriptCheckReference extends SSAInstruction {
private final int ref;

View File

@ -10,15 +10,35 @@ import com.ibm.wala.types.FieldReference;
import com.ibm.wala.types.TypeReference;
import com.ibm.wala.util.debug.Assertions;
/**
* IR instruction to check whether a field is defined on some object. The field
* is represented either by a {@link FieldReference} or by a local value number.
*/
public class AstIsDefinedInstruction extends SSAInstruction {
/**
* name of the field. If non-null, fieldVal should be -1.
*/
private final FieldReference fieldRef;
/**
* value number holding the field string. If non-negative,
* fieldRef should be null.
*/
private final int fieldVal;
/**
* the base pointer
*/
private final int rval;
/**
* gets 1 if the field is defined, 0 otherwise.
*/
private final int lval;
/**
* This constructor should only be used from {@link SSAInstruction#copyForSSA(SSAInstructionFactory, int[], int[])}
*/
public AstIsDefinedInstruction(int lval, int rval, int fieldVal, FieldReference fieldRef) {
this.lval = lval;
this.rval = rval;