Class RegularTransferResult<V extends AbstractValue<V>,​S extends Store<S>>

  • Type Parameters:
    V - type of the abstract value that is tracked
    S - the store type used in the analysis

    public class RegularTransferResult<V extends AbstractValue<V>,​S extends Store<S>>
    extends TransferResult<V,​S>
    Implementation of a TransferResult with just one non-exceptional store. The result of getThenStore and getElseStore is equal to the only underlying store.
    • Field Detail

      • store

        protected final S extends Store<S> store
        The regular result store.
    • Constructor Detail

      • RegularTransferResult

        public RegularTransferResult​(@Nullable V value,
                                     S resultStore,
                                     @Nullable java.util.Map<javax.lang.model.type.TypeMirror,​S> exceptionalStores,
                                     boolean storeChanged)
        Create a TransferResult with resultStore as the resulting store. If the corresponding Node is a boolean node, then resultStore is used for both the 'then' and 'else' edge.

        Exceptions: If the corresponding Node throws an exception, then the corresponding store in exceptionalStores is used. If no exception is found in exceptionalStores, then it is assumed that no special handling is necessary and the store before the corresponding Node will be passed along any exceptional edge.

        Aliasing: resultStore and any store in exceptionalStores are not allowed to be used anywhere outside of this class (including use through aliases). Complete control over the objects is transferred to this class.

        Parameters:
        value - the abstract value produced by the transfer function
        resultStore - the regular result store
        exceptionalStores - the stores in case the basic block throws an exception, or null if the basic block does not throw any exceptions
        storeChanged - see TransferResult.storeChanged()
    • Method Detail

      • getRegularStore

        public S getRegularStore()
        The regular result store.
        Specified by:
        getRegularStore in class TransferResult<V extends AbstractValue<V>,​S extends Store<S>>
        Returns:
        the regular result store produced if no exception is thrown by the Node corresponding to this transfer function result
      • getThenStore

        public S getThenStore()
        Description copied from class: TransferResult
        Returns the result store produced if the Node this result belongs to evaluates to true.
        Specified by:
        getThenStore in class TransferResult<V extends AbstractValue<V>,​S extends Store<S>>
        Returns:
        the result store produced if the Node this result belongs to evaluates to true
      • getElseStore

        public S getElseStore()
        Description copied from class: TransferResult
        Returns the result store produced if the Node this result belongs to evaluates to false.
        Specified by:
        getElseStore in class TransferResult<V extends AbstractValue<V>,​S extends Store<S>>
        Returns:
        the result store produced if the Node this result belongs to evaluates to false
      • containsTwoStores

        public boolean containsTwoStores()
        Description copied from class: TransferResult
        Returns true if and only if this transfer result contains two stores that are potentially not equal. Note that the result true does not imply that getRegularStore cannot be called (or vice versa for false). Rather, it indicates that getThenStore or getElseStore can be used to give more precise results. Otherwise, if the result is false, then all three methods getRegularStore, getThenStore, and getElseStore return equivalent stores.
        Specified by:
        containsTwoStores in class TransferResult<V extends AbstractValue<V>,​S extends Store<S>>
        Returns:
        true if and only if this transfer result contains two stores that are potentially not equal
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object