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

Some fieldDescriptor methods can pass existing constantPoolHandle

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 11, 13, 14
    • Fix Version/s: 14
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b22

      Description

      In the fieldDescriptor::name and signature we dereference a constantPoolHandle and pass the ConstantPool* to methods accepting a const constantPoolHandle&. This means we create new handles, which has a small but measurable overhead.

      diff -r 7e79aaa59912 src/hotspot/share/runtime/fieldDescriptor.inline.hpp
      --- a/src/hotspot/share/runtime/fieldDescriptor.inline.hpp Sat Nov 02 01:03:32 2019 +0100
      +++ b/src/hotspot/share/runtime/fieldDescriptor.inline.hpp Sun Nov 03 01:30:55 2019 +0100
      @@ -31,11 +31,11 @@
       // must be put in this file, as they require runtime/handles.inline.hpp.

       inline Symbol* fieldDescriptor::name() const {
      - return field()->name(_cp());
      + return field()->name(_cp);
       }

       inline Symbol* fieldDescriptor::signature() const {
      - return field()->signature(_cp());
      + return field()->signature(_cp);
       }

       inline InstanceKlass* fieldDescriptor::field_holder() const {

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              redestad Claes Redestad
              Reporter:
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: