Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DRLVM
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Estimated Complexity:
      Moderate

      Description

      === Description ===

      The patch adds checks of two constraints, fixes
      exception data flow issue and made arrangements
      for further subroutine inlining implementation.

      While adding a number of new checks, the patch
      reduces the total legth of the code by 75 lines
      and reduces verifier memory usage by removing
      structures which are not used. At least
      removing dead data just improves readability.

      === Testing ===

      Before the patch the test WideGoto.class hangs
      on verification stage.

      After the patch a verifier correctly reports:

      Uncaught exception in main:
      java.lang.VerifyError: (class: WideGoto,
      method: main([Ljava/lang/String;)V) wide should
      be followed by iload, fload, aload, lload,
      dload, istore, fstore, astore, lstore, dstore,
      ret or iinc

      The patch passes acceptance tests.

      Both patches and non-patched versions fail on
      the same thread manager assertion when trying
      to run eclipse.

      === Changes ===

      Below goes a detailed list of changes:

      • Added verification of wide instructions.
        Added verification of the total bytecode
        length.
      • Added a new file for subroutine
        implementation, added a reference to the file
        to MSVC project. Added design of subroutine
        inlining algorithm.
      • Added type flags for graph nodes and an
        appropriate constructor to create nodes of
        different types. Added an assertion to get
        instruction range only for
        VF_TYPE_NODE_CODE_RANGE nodes.
      • Simplified checks of a node type removing
        access to a last code instruction of a
        node. Removed artificial instructions for
        handler nodes and start/end nodes.
      • Removed service functions to work with
        artificial instructions. Moved instruction
        stack maps to the corresponding node maps.
        Removed second parsing of method signature when
        creating method IN and OUT maps.
      • Two times decreased a size of bytecode
        annotation structures and completely removed
        offset structures for such structures. Added
        annotations to vf_Context.
      • Removed a dynamic vector of exception
        handlers for each instruction.
      • Removed debug flag macros which are no
        longer used in the current version.
      • Simplified edge pre-counting algorithm by
        noticing that each basic block except the last
        produces at least one OUT edge, so we just need
        to make action about those blocks which branch
        execution. Used local counters in loops instead
        of one global counter to foster compiler
        optimizations.
      • Made vf_Graph class getters inline putting
        their definitions in the header file. Added
        GetEdgeCount getter. Removed unused SetNode
        method (should be added CopyNode instead for
        subroutine inlining).
      • Added a new reporter macro to add class
        and method names to any report.
      • Adopted debug facilities to work with new
        data structures.
      • When parsing a class file or getting
        exception information used local unsigned short
        type instead of reused and casted int.

      === Formatting ===

      I changed formatting of the code I touched.

      • Fixed English and removed excessive "This
        function ..." in documentation. Added
        Doxygen style documentation using @param and
        @return tags for new functions.
      • Renamed "deep" -> "depth" and "begin" ->
        "start" in variable and function names using
        input from a focus group from my cubicle.
      • Started using class library C style for
        brackets and spaces in function names.
        Consistently followed C style for local
        variable names and functions (low caps with
        underscore). Left Windows/JNI style (camel
        style with the first letter in method name
        uppercased) for C++ constructs.
      • To my ear getting a number of nodes
        doesn't imply that we are getting all nodes. So
        I renamed GetNodeNumber to GetNodeCount.
      • Reduced repeated long indirect pointer
        chains context->a->b[i]->c caching in a local
        variable.
      • Reformat long lines to fit 72 symbols.
      1. Verifier-patch-A-litle-addon.patch
        125 kB
        Pavel Rebriy
      2. Verifier-patch-A-litle-addon.patch
        125 kB
        Pavel Rebriy
      3. verifier_m_i_3.patch
        220 kB
        Alexei Fedotov
      4. verifier_4.patch
        168 kB
        Alexei Fedotov
      5. verifier_3.patch
        164 kB
        Alexei Fedotov
      6. verifier_2.patch
        164 kB
        Alexei Fedotov
      7. ManyLocals.java
        5 kB
        Alexei Fedotov
      8. WideGoto.class
        0.2 kB
        Alexei Fedotov
      9. WideGoto.j
        0.4 kB
        Alexei Fedotov

        Activity

        Gregory Shimansky made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Gregory Shimansky made changes -
        Resolution Fixed [ 1 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Gregory Shimansky made changes -
        Assignee Gregory Shimansky [ gshimansky ]
        Pavel Rebriy made changes -
        Attachment Verifier-patch-A-litle-addon.patch [ 12351362 ]
        Pavel Rebriy made changes -
        Attachment Verifier-patch-A-litle-addon.patch [ 12351361 ]
        Alexei Fedotov made changes -
        Attachment verifier_m_i_3.patch [ 12351222 ]
        Alexei Fedotov made changes -
        Attachment verifier_4.patch [ 12350530 ]
        Alexei Fedotov made changes -
        Attachment verifier_3.patch [ 12350483 ]
        Alexei Fedotov made changes -
        Attachment verifier_1.patch [ 12349849 ]
        Alexei Fedotov made changes -
        Attachment verifier_2.patch [ 12349940 ]
        Alexei Fedotov made changes -
        Attachment verifier.patch [ 12349753 ]
        Alexei Fedotov made changes -
        Attachment ManyLocals.java [ 12349848 ]
        Alexei Fedotov made changes -
        Attachment ManyLocals.java [ 12349852 ]
        Alexei Fedotov made changes -
        Attachment verifier_1.patch [ 12349849 ]
        Attachment ManyLocals.java [ 12349848 ]
        Alexei Fedotov made changes -
        Estimated Complexity Novice Moderate
        Patch Info [Patch Available]
        Alexei Fedotov made changes -
        Field Original Value New Value
        Attachment WideGoto.class [ 12349755 ]
        Attachment verifier.patch [ 12349753 ]
        Attachment WideGoto.j [ 12349754 ]
        Alexei Fedotov created issue -

          People

          • Assignee:
            Gregory Shimansky
            Reporter:
            Alexei Fedotov
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development