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

methodHandles and constantPoolHandles should be passed as const references

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • None
    • b93


      Because of the way methodHandles and constantPoolHandles work in the post-Permgen world, they have copy constructors and destructors when they go out of scope. So they generate lots of code when passed as value parameters.

      Passing these as const reference types avoids this code generation.

      See src/share/vm/runtime/handles.{inline.hpp,hpp}

      The constructor puts the Method* or ConstantPool* on the thread's metadata handle list, copy constructor copies to a new handle, which also adds an entry on the list, and the destructor takes the pointer off the handle list. This is for MetadataOnStackMark to mark that these Method*/ConstantPool* values are being used so they are not deleted if they are pointing to old methods.

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

              Created:
              Updated:
              Resolved: