package alias
- Alphabetic
- Public
- Protected
Type Members
- sealed trait Alias extends AliasPropertyMetaInformation with OrderedProperty
Describes the alias properties of the associated entities.
Describes the alias properties of the associated entities.
Alias properties can establish a binding between a pair of entities, including definition sites, formal parameters, method return values, fields, etc. For more information, see org.opalj.tac.fpcf.analyses.alias.AliasSourceElement and org.opalj.tac.fpcf.analyses.alias.AliasEntity. The pair may consist of different types of entities, such as a field and a formal parameter.
An alias property provides information about the relationship of the memory locations of the associated entities.
- NoAlias can be assigned to a pair of entities, iff no execution path exists where both entities refer to the same memory location. This implies that there is a definite separation of the memory locations of the two entities, and no interference can occur when one of the entities is referenced. Note that this does not imply that, for example, the fields of the entities cannot refer to the same memory location. Example:
Object m(Object a) { Object b = new Object(); return b; }
In this example, the formal parameter
aand the local variablebare guaranteed to never refer to the same memory location, asbis always assigned to a new object that the formal parameter can't possibly be pointing to since the object has not been created before the method call. This ensures that the method's return value and the formal parameter never point to the same memory location.- MustAlias can be assigned to a pair of entities, iff both entities refer to the same memory location in every execution time at all times. This implies that at every use site of one entity, it can be replaced with the other entity (if it is defined at the current location) without changing the semantics of the program. Example:
Object m() { Object a = new Object(); Object b = a; return b; }
In this example, the local variable
aandbare guaranteed to refer to the same memory location at all times, because a is only assigned once and b is only defined once with the value of a. This means that the return value of the method can be replaced witha.- MayAlias can always be assigned to any given pair of entities without invalidating the results. It indicates that the two entities might refer to the same memory location but are not obligated to do so. This serves as a default/fallback value when no other property can be guaranteed. Example:
Object m(Object a) { Object b = a; System.out.println(b); b = new Object(); return b; }
In this example neither MustAlias nor NoAlias can be assigned to the pair of formal parameter
aand local variableb, because b initially refers to the same memory location as a but is later assigned to a new object.Note that the examples above are usually already optimized by the compiler and are used for illustrative purposes.
The alias properties are ordered and form a lattice with the following order: MayAlias > MustAlias > NoAlias. This means that MayAlias is the most precise property and NoAlias is the least precise property. This allows for an analysis to return NoAlias as an intermediate result when no further information is available (because there is no reason to assume it can alias) and later refine it to MustAlias or even MayAlias if more information becomes available that indicate a MayAlias or MustAlias relation. An analysis is not allowed to return a less precise property than the one that was previously assigned to the same pair of entities.
An analysis should attempt to be as sound as possible when assigning MustAlias or NoAlias properties, but might not always be able to do so, e.g. when a field is changed via reflection or native methods. In such cases, the analysis should document the possible unsoundness.
Alias information is only defined at a location where both entities of the associated pair are defined. If one of the entities is not defined at the current location, the given alias property holds no information.
- class AliasEntity extends AnyRef
Represents a pair of AliasSourceElements and a Context for each the elements to which an alias relationship can be assigned.
Represents a pair of AliasSourceElements and a Context for each the elements to which an alias relationship can be assigned. It is used to query and store the associated alias property in the property store. The order of the elements is irrelevant, as the alias property is symmetric. To ensure this, the given elements might be swapped internally.
- case class AliasField(fieldReference: FieldReference) extends AliasSourceElement with Product with Serializable
Represents a non-static field that is part of an alias relation.
- case class AliasFormalParameter(fp: VirtualFormalParameter) extends AliasSourceElement with Product with Serializable
Represents a formal parameter of a method that is part of an alias relation.
- sealed trait AliasPropertyMetaInformation extends PropertyMetaInformation
- case class AliasReturnValue(method: Method, project: SomeProject) extends AliasSourceElement with Product with Serializable
Represents a method return value of a method that is part of an alias relation.
- sealed trait AliasSourceElement extends AnyRef
Represents a source code element which can be part of an alias relation.
Represents a source code element which can be part of an alias relation.
Valid elements are:
- AliasFormalParameter: A formal parameter.
- AliasReturnValue: A method return value.
- AliasField: A non-static field, represented by a FieldReference.
- AliasStaticField: A static field.
- case class AliasStaticField(field: Field) extends AliasSourceElement with Product with Serializable
Represents a static field that is part of an alias relation.
- case class AliasUVar(persistentUVar: PUVar[ValueInformation], method: Method, project: SomeProject) extends AliasSourceElement with Product with Serializable
Represents a UVar that is part of an alias relation.
- case class FieldReference(field: Field, context: Context, defSites: IntTrieSet) extends Product with Serializable
Encapsulates a reference to a specific field.
Encapsulates a reference to a specific field. it contains the possible definition sites of the object used to access the field and the context in which the field is referenced.
- field
The field that is referenced
- defSites
The possible definition sites of the field
Value Members
- object Alias extends AliasPropertyMetaInformation
- object AliasEntity
- object AliasSourceElement
- case object MayAlias extends Alias with Product with Serializable
Indicates that the two associated entities might refer to the same memory location but are not obligated to do so.
Indicates that the two associated entities might refer to the same memory location but are not obligated to do so.
If this property is given as an org.opalj.fpcf.InterimResult, it is guaranteed that the final result will be MayAlias. However, it is not guaranteed that the actual relation cannot be described as MustAlias or NoAlias.
- See also
Alias for more information about alias properties.
- case object MustAlias extends Alias with Product with Serializable
Indicates that the two associated entities are guaranteed to always refer to the same memory location.
Indicates that the two associated entities are guaranteed to always refer to the same memory location.
If this property is given as an org.opalj.fpcf.InterimResult, the final result can be refined to MayAlias if further information becomes available that indicate a MayAlias relation.
An analysis should attempt to be as sound as possible when assigning MustAlias as a final result, but might not always be able to do so, e.g. when a field is changed via reflection or native methods. In such cases, the analysis should document the possible unsoundness.
- See also
Alias for more information about alias properties.
- case object NoAlias extends Alias with Product with Serializable
Indicates that the two associated entities are guaranteed to never refer to the same memory location.
Indicates that the two associated entities are guaranteed to never refer to the same memory location.
If this property is given as an org.opalj.fpcf.InterimResult, the final result can be refined to MustAlias or MayAlias if further information becomes available that indicate a MustAlias or MayAlias relation.
An analysis should attempt to be as sound as possible when assigning NoAlias as a final result, but might not always be able to do so, e.g. when a field is changed via reflection or native methods. In such cases, the analysis should document the possible unsoundness.
- See also
Alias for more information about alias properties.