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

Some fieldDescriptor methods can pass existing constantPoolHandle

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 14
    • 11, 13, 14
    • hotspot
    • b22

      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 {

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

              Created:
              Updated:
              Resolved: