Class SlotVariablePartition


  • public class SlotVariablePartition
    extends Object
    Partitions each JVM local slot into one or more source variables using a reaching-definition analysis.
    • Constructor Detail

      • SlotVariablePartition

        public SlotVariablePartition​(IRMethod method,
                                     IntFunction<String> baseNameForSlot,
                                     SlotVariablePartition.ScopeNameResolver scopeNameResolver)
        Partitions the method's slots immediately, using one resolver for both load and store offsets.
        Parameters:
        method - the method to analyze
        baseNameForSlot - supplies the fallback name for a slot with no scope name
        scopeNameResolver - resolves the declared name in scope at an offset, may be null
      • SlotVariablePartition

        public SlotVariablePartition​(IRMethod method,
                                     IntFunction<String> baseNameForSlot,
                                     SlotVariablePartition.ScopeNameResolver scopeNameResolver,
                                     SlotVariablePartition.ScopeNameResolver storeNameResolver)
        As the three-argument form, with a dedicated resolver for STORE offsets.
        Parameters:
        method - the method to analyze
        baseNameForSlot - supplies the fallback name for a slot with no scope name
        scopeNameResolver - resolves the declared name in scope at a load offset, may be null
        storeNameResolver - resolves the declared name in scope at a store offset, may be null
      • SlotVariablePartition

        public SlotVariablePartition​(IRMethod method,
                                     IntFunction<String> baseNameForSlot,
                                     SlotVariablePartition.ScopeNameResolver scopeNameResolver,
                                     SlotVariablePartition.ScopeNameResolver storeNameResolver,
                                     SlotVariablePartition.ScopeNameResolver scopeDescriptorResolver)
        As the four-argument form, with a resolver for the declared descriptor in scope, so two components cannot share a debug name unless they share a type.
        Parameters:
        method - the method to analyze
        baseNameForSlot - supplies the fallback name for a slot with no scope name
        scopeNameResolver - resolves the declared name in scope at a load offset, may be null
        storeNameResolver - resolves the declared name in scope at a store offset, may be null
        scopeDescriptorResolver - resolves the declared descriptor in scope at an offset, may be null
    • Method Detail

      • nameForStore

        public String nameForStore​(StoreLocalInstruction store)
        Parameters:
        store - the store whose target variable is wanted
        Returns:
        the variable name, or null if the store was not analyzed
      • nameForLoad

        public String nameForLoad​(LoadLocalInstruction load)
        Parameters:
        load - the load whose source variable is wanted
        Returns:
        the variable name, or null if the load was not analyzed
      • nameForPhi

        public String nameForPhi​(PhiInstruction phi)
        Parameters:
        phi - the phi whose merged variable is wanted
        Returns:
        the variable name, or null if the phi does not represent a local slot