Harmony
  1. Harmony
  2. HARMONY-2052

[drlvm][kernel] Improve/re-implement a parser of generic signatures

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Classlib, DRLVM
    • Labels:
      None
    • Estimated Complexity:
      Moderate

      Description

      Improve/re-implement a parser of generic signatures in DRLVM kernel classes [1], and move this functionality to classlib (luni ?), so other VMs could reuse it for 1.5 support. The current impl is somewhat messy and half-baked, one need to invent more shaped and modular API to the parser. One more possible issue is parser's dependency on antlr, which may be considered overkill for this duty. I think antlr has its pros, like more illustrative code with clear correlation to formal grammar [2]; unfortunately this is not the case with the impl in question. OTOH minimizing number of dependencies for VM is always good.

      [1] working_vm\vm\vmcore\src\kernel_classes\javasrc\org\apache\harmony\lang\reflect**
      [2] http://java.sun.com/docs/books/vmspec/2nd-edition/ClassFileFormat-Java5.pdf Para 4.4.4

      1. HARMONY-2052-1.diff
        105 kB
        Paulex Yang
      2. HARMONY-2052-1.diff
        105 kB
        Vladimir Beliaev
      3. HARMONY-2052-1.diff
        106 kB
        Vladimir Beliaev
      4. antlr-2.7.5.jar
        425 kB
        Vladimir Beliaev

        Issue Links

          Activity

          Hide
          Paulex Yang added a comment -

          This is the first part of the proposed refactory, for the comments of interest part. This is part is for decoupling j.l.r and o.a.h.l.r packages, so that the real implementation can be improved easily (and help myself understand the code as well). Currently the refactory is straightfoward and somewhat naive, no need to say that there are much things left to do, performance, compiler warning, etc, and nothing improved on the implementation itself. I'll go on with it if this patch is fine.

          Show
          Paulex Yang added a comment - This is the first part of the proposed refactory, for the comments of interest part. This is part is for decoupling j.l.r and o.a.h.l.r packages, so that the real implementation can be improved easily (and help myself understand the code as well). Currently the refactory is straightfoward and somewhat naive, no need to say that there are much things left to do, performance, compiler warning, etc, and nothing improved on the implementation itself. I'll go on with it if this patch is fine.
          Hide
          Alexey Varlamov added a comment -

          Very nice - so it appears the parser has no kernel or VMI dependency - just signature and reflected object as inputs are enough? That's excellent, the 1st step already brought desired parser API simplification!
          I suppose we need not commit this patch, please keep going.

          Show
          Alexey Varlamov added a comment - Very nice - so it appears the parser has no kernel or VMI dependency - just signature and reflected object as inputs are enough? That's excellent, the 1st step already brought desired parser API simplification! I suppose we need not commit this patch, please keep going.
          Hide
          Vladimir Beliaev added a comment -

          I've attached 'antlr-2.7.5.jar' file which is 'it is fully in the public domain' (according to http://www.antlr2.org/license.html) because of this JAR is not available at www.antlr2.org now...

          Show
          Vladimir Beliaev added a comment - I've attached 'antlr-2.7.5.jar' file which is 'it is fully in the public domain' (according to http://www.antlr2.org/license.html ) because of this JAR is not available at www.antlr2.org now...
          Hide
          Vladimir Beliaev added a comment -

          I've rebased HARMONY-2052-1.diff on recent Harmoby version, passed 'kernel tests' (which includes Generic tests & reflection test) on Windows/IA32 debug build default EM mode.

          Alexey, please get this patch committed to simplify moving forward with this JIRA fixing.

          Thanks
          Vladimir Beliaev

          Show
          Vladimir Beliaev added a comment - I've rebased HARMONY-2052 -1.diff on recent Harmoby version, passed 'kernel tests' (which includes Generic tests & reflection test) on Windows/IA32 debug build default EM mode. Alexey, please get this patch committed to simplify moving forward with this JIRA fixing. Thanks Vladimir Beliaev
          Hide
          Alexey Varlamov added a comment -

          Vladimir, I'm OK with committing it but please eliminate compilation warnings.

          Show
          Alexey Varlamov added a comment - Vladimir, I'm OK with committing it but please eliminate compilation warnings.
          Hide
          Vladimir Beliaev added a comment -

          Alexey, new version of this HARMONY-2052-1.diff does not produce warnings... Thanks for the catching this.

          Show
          Vladimir Beliaev added a comment - Alexey, new version of this HARMONY-2052 -1.diff does not produce warnings... Thanks for the catching this.
          Hide
          Alexey Varlamov added a comment -

          Applied at revision: 545750, thanks!

          Show
          Alexey Varlamov added a comment - Applied at revision: 545750, thanks!

            People

            • Assignee:
              Paulex Yang
              Reporter:
              Alexey Varlamov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Development