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

Move Object.registerNatives into HotSpot

XMLWordPrintable

    • b21

      Object.java currently registers various native functions via the registerNatives facility.

          private static native void registerNatives();
          static {
              registerNatives();
          }

      Not costly in and off itself, but this has the side effect that these two methods are taken into account every time the VM has to generate default methods and overpasses for some class during class load, which can take up substantial time. When prototyping JDK-8219713, explicitly excluding these two methods showed some improvement to default method generation, but it was decided against adding such special cases.

      If we instead can get rid of the Object <clinit> and the registerNatives altogether we get the same (or a slightly better) speedup. This effectively reduces memory use and instructions retired doing default method generation by 3-5%:

      http://cr.openjdk.java.net/~redestad/scratch/object_registerNatives.00/

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

              Created:
              Updated:
              Resolved: