> On Jun 20, 2017, at 3:14 AM, Claes Redestad <claes.redes...@oracle.com> wrote: > > Hi, > > as a startup optimization, we can avoid a number of reflective operations on > variouscore classes by adding a specialized objectFieldOffset method taking > Class and String rather than Field: > > Webrev: https://bugs.openjdk.java.net/browse/JDK-8182487 > Hotspot: http://cr.openjdk.java.net/~redestad/8182487/hotspot.00 > <http://cr.openjdk.java.net/~redestad/8182487/hotspot.00>
While you are cleaning this up, could we remove that code: +static inline void throw_new(JNIEnv *env, const char *ename) { + char buf[100]; + + jio_snprintf(buf, 100, "%s%s", "java/lang/", ename); and instead pass the whole java/lang/* string? > JDK: http://cr.openjdk.java.net/~redestad/8182487/jdk.00 > > On startup tests this reduces executed instructions by ~1-2M, depending on > how many of the touched classes are loaded. > > Since all uses of this would throw an Error, InternalError or > ExceptionInInitializerError if the field was missing - effectively > aborting VM execution - it felt reasonable to simplify the code to > consistently throw InternalError and remove a number of distracting > try-catch blocks. > > Thanks! > > /Claes