Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8029567

Clean up linkResolver code

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: hs25
    • Fix Version/s: 9
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b69

      Backports

        Description

        Recent changes for to meet the jdk8 deadline have left some cleanup items. These are cosmetic but because the code is so complex now, the cosmetic problems make this code even harder to understand and more likely to create bugs. See referenced bugs.

        The specific things that need to be done is to fix the parameter lists in linkResolver to 1. not wrap multiple lines and 2. not pass non-const reference parameters because at the call site you have no idea that these are output parameters.

        Other things in linkResolver, there are similar but different functions: lookup_instance_method_in_klasses vs. lookup_method_in_klasses. The former skips statics. It would be better to have an InstanceKlass::uncached_lookup_instance_method() which skips statics and that could be used instead of the following code in klassVtable.cpp also.

              Method* mo = InstanceKlass::cast(super)->lookup_method(name, signature);
        + while (mo != NULL && mo->access_flags().is_static()
        + && mo->method_holder() != NULL
        + && mo->method_holder()->super() != NULL)
        + {
        + mo = mo->method_holder()->super()->uncached_lookup_method(name, signature);
        + }

        A cleanup pass of link resolution code should be done before the suggested complete rewrite so that it's clearer what it does. This is technical debt.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                coleenp Coleen Phillimore
                Reporter:
                coleenp Coleen Phillimore
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: