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

Use Unsafe.defineAnonymousClass for loading Nashorn script code

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b83
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        We should use Unsafe.defineAnonymousClass to load Nashorn script code. We can cut down significantly on the number of class loaders (as we no longer need one per compilation job in order for the generated classes to be GC eligible). Anonymous classes are said to be more aggressively optimized (at least that's what Aleksey Shipilev told me). Class installation time also gets reduced to 80% of what it was before.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  attila Attila Szegedi
                  Reporter:
                  attila Attila Szegedi
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: