Class GotoRemoval


  • final class GotoRemoval
    extends java.lang.Object
    • Field Detail

      • OPTION_MERGE_ADJACENT_LABELS

        static final int OPTION_MERGE_ADJACENT_LABELS
        See Also:
        Constant Field Values
      • OPTION_REMOVE_REDUNDANT_RETURNS

        static final int OPTION_REMOVE_REDUNDANT_RETURNS
        See Also:
        Constant Field Values
      • labels

        final java.util.Map<Node,​Label> labels
      • labelLookup

        final java.util.Map<Label,​Node> labelLookup
      • parentLookup

        final java.util.Map<Node,​Node> parentLookup
      • nextSibling

        final java.util.Map<Node,​Node> nextSibling
      • options

        final int options
    • Constructor Detail

      • GotoRemoval

        GotoRemoval()
      • GotoRemoval

        GotoRemoval​(int options)
    • Method Detail

      • removeGotos

        public final void removeGotos​(Block method)
      • removeGotosCore

        private void removeGotosCore​(Block method)
      • traverseGraph

        private void traverseGraph​(Block method)
      • trySimplifyGoto

        private boolean trySimplifyGoto​(Expression gotoExpression)
      • tryInlineReturn

        private boolean tryInlineReturn​(Expression gotoExpression,
                                        Node target,
                                        AstCode code)
      • getParents

        private java.lang.Iterable<Node> getParents​(Node node)
      • getParents

        private <T extends Node> java.lang.Iterable<T> getParents​(Node node,
                                                                  java.lang.Class<T> parentType)
      • enter

        private Node enter​(Node node,
                           java.util.Set<Node> visitedNodes)
      • exit

        private Node exit​(Node node,
                          java.util.Set<Node> visitedNodes)
      • transformLeaveStatements

        private void transformLeaveStatements​(Block method)
      • removeRedundantCode

        public static void removeRedundantCode​(Block method)
      • removeRedundantCode

        public static void removeRedundantCode​(Block method,
                                               int options)
      • removeRedundantCodeCore

        private void removeRedundantCodeCore​(Block method)