sealed trait Alias extends AliasPropertyMetaInformation with OrderedProperty
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 a and the local variable b are guaranteed to never refer to the same memory location,
as b is 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 a and b are 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 with a.
- 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 a and local variable b,
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.
- Source
- Alias.scala
- Alphabetic
- By Inheritance
- Alias
- OrderedProperty
- Property
- AliasPropertyMetaInformation
- PropertyMetaInformation
- PropertyKind
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type Self = Alias
- Definition Classes
- AliasPropertyMetaInformation → PropertyMetaInformation
Abstract Value Members
- abstract def checkIsEqualOrBetterThan(e: Entity, other: Alias): Unit
Checks if this alias property is at least as restrictive as
other.Checks if this alias property is at least as restrictive as
other. For the restrictiveness order, see Alias.- e
The entity that this property is associated with.
- other
The other alias property.
- Definition Classes
- Alias → OrderedProperty
- Exceptions thrown
IllegalArgumentExceptionIf this property is less precise than the given one.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- final def asOrderedProperty: OrderedProperty
Returns
thisif this property inherits from OrderedProperty.Returns
thisif this property inherits from OrderedProperty.Used, e.g., by the framework to support debugging analyses.
- Definition Classes
- Property
- def bottomness: Int
Returns a value between zero and 9 which describes how close the value is to its absolute bottom.
Returns a value between zero and 9 which describes how close the value is to its absolute bottom. Zero means the value is very close to the bottom and 9 means the value is far away from the bottom.
The default value is "5".
- Definition Classes
- OrderedProperty
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def id: Int
The id uniquely identifies this property's category.
The id uniquely identifies this property's category. All property objects of the same kind have to use the same id which is guaranteed since they share the same
PropertyKey- Definition Classes
- PropertyMetaInformation → PropertyKind
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def isOrderedProperty: Boolean
Returns
trueif this property inherits from OrderedProperty.Returns
trueif this property inherits from OrderedProperty.- Definition Classes
- Property
- final def key: PropertyKey[Alias]
A globally unique key used to access alias properties
A globally unique key used to access alias properties
- Definition Classes
- Alias → PropertyMetaInformation
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @Deprecated
- Deprecated