Class InterProceduralEngine


  • public class InterProceduralEngine
    extends Object
    Simulation engine that follows method calls up to a configurable depth, resolving callees from the ClassPool and lifting their bodies to IR on demand.
    • Constructor Detail

      • InterProceduralEngine

        public InterProceduralEngine​(SimulationContext context)
        Creates an engine with an empty call stack and method cache.
        Parameters:
        context - configuration and shared resources for the simulation
    • Method Detail

      • addListener

        public InterProceduralEngine addListener​(SimulationListener listener)
        Registers a listener for simulation events.
        Parameters:
        listener - the listener to register
        Returns:
        this engine
      • addListeners

        public InterProceduralEngine addListeners​(SimulationListener... listenerArray)
        Registers several listeners for simulation events.
        Parameters:
        listenerArray - the listeners to register
        Returns:
        this engine
      • getCallStack

        public CallStackState getCallStack()
        Returns:
        the current call stack
      • getMethodsSimulated

        public int getMethodsSimulated()
        Returns:
        the number of methods simulated in the last run
      • getMaxDepthReached

        public int getMaxDepthReached()
        Returns:
        the maximum call depth reached in the last run
      • simulate

        public SimulationResult simulate​(IRMethod method)
        Simulates a method, following calls inter-procedurally when the context allows it.
        Parameters:
        method - the entry method to simulate
        Returns:
        the collected simulation result