merge JEP-230-microbenchmarks-branch
authorredestad
Wed, 17 Oct 2018 23:28:08 +0200
branchJEP-230-microbenchmarks-branch
changeset 56990 3d4b9350fac2
parent 56981 99cc37ccd75d (current diff)
parent 52181 d5a96cafdd4a (diff)
child 56991 924fbbfdf07a
merge
--- a/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java	Wed Oct 17 17:30:28 2018 +0200
+++ b/make/jdk/src/classes/build/tools/classlist/HelloClasslist.java	Wed Oct 17 23:28:08 2018 +0200
@@ -66,6 +66,15 @@
         Stream.of(helloWorld.split(","))
               .forEach(System.out::println);
 
+        // Common concatenation patterns
+        String const_I = "string" + args.length;
+        String const_S = "string" + String.valueOf(args.length);
+        String S_const = String.valueOf(args.length) + "string";
+        String S_S     = String.valueOf(args.length) + String.valueOf(args.length);
+        String const_J = "string" + System.currentTimeMillis();
+        String I_const = args.length + "string";
+        String J_const = System.currentTimeMillis() + "string";
+
         String newDate = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(
                 LocalDateTime.now(ZoneId.of("GMT")));
 
--- a/src/hotspot/cpu/arm/vm_version_arm.hpp	Wed Oct 17 17:30:28 2018 +0200
+++ b/src/hotspot/cpu/arm/vm_version_arm.hpp	Wed Oct 17 23:28:08 2018 +0200
@@ -110,7 +110,6 @@
   static bool supports_kuser_cmpxchg64() { return _kuser_helper_version >= KUSER_VERSION_CMPXCHG64; }
   // Override Abstract_VM_Version implementation
   static bool use_biased_locking();
-  static const char* vm_info_string();
 
   static bool has_vfp()             { return (_features & vfp_m) != 0; }
   static bool has_vfp3_32()         { return (_features & vfp3_32_m) != 0; }
--- a/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Wed Oct 17 17:30:28 2018 +0200
+++ b/src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp	Wed Oct 17 23:28:08 2018 +0200
@@ -34,6 +34,8 @@
 #include "code/vtableStubs.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/gcLocker.hpp"
+#include "gc/shared/barrierSet.hpp"
+#include "gc/shared/barrierSetAssembler.hpp"
 #include "interpreter/interpreter.hpp"
 #include "logging/log.hpp"
 #include "memory/resourceArea.hpp"
--- a/src/hotspot/cpu/x86/x86_32.ad	Wed Oct 17 17:30:28 2018 +0200
+++ b/src/hotspot/cpu/x86/x86_32.ad	Wed Oct 17 23:28:08 2018 +0200
@@ -619,7 +619,7 @@
   int framesize = C->frame_size_in_bytes();
   int bangsize = C->bang_size_in_bytes();
 
-  __ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, C->in_24_bit_fp_mode());
+  __ verified_entry(framesize, C->need_stack_bang(bangsize)?bangsize:0, C->in_24_bit_fp_mode(), C->stub_function() != NULL);
 
   C->set_frame_complete(cbuf.insts_size());
 
--- a/src/hotspot/share/prims/jvmtiExport.cpp	Wed Oct 17 17:30:28 2018 +0200
+++ b/src/hotspot/share/prims/jvmtiExport.cpp	Wed Oct 17 23:28:08 2018 +0200
@@ -1044,7 +1044,7 @@
  public:
    JvmtiObjectAllocEventMark(JavaThread *thread, oop obj) : JvmtiClassEventMark(thread, oop_to_klass(obj)) {
      _jobj = (jobject)to_jobject(obj);
-     _size = obj->size() * wordSize;
+     _size = Universe::heap()->obj_size(obj) * wordSize;
    };
    jobject jni_jobject() { return _jobj; }
    jlong size() { return _size; }
--- a/src/hotspot/share/prims/jvmtiTagMap.cpp	Wed Oct 17 17:30:28 2018 +0200
+++ b/src/hotspot/share/prims/jvmtiTagMap.cpp	Wed Oct 17 23:28:08 2018 +0200
@@ -105,7 +105,7 @@
   }
 
   inline bool equals(oop object) {
-    return object == object_peek();
+    return oopDesc::equals(object, object_peek());
   }
 
   inline JvmtiTagHashmapEntry* next() const        { return _next; }
@@ -186,6 +186,7 @@
 
     // shift right to get better distribution (as these bits will be zero
     // with aligned addresses)
+    key = Access<>::resolve(key);
     unsigned int addr = (unsigned int)(cast_from_oop<intptr_t>(key));
 #ifdef _LP64
     return (addr >> 3) % size;
--- a/src/java.base/share/classes/java/lang/StringConcatHelper.java	Wed Oct 17 17:30:28 2018 +0200
+++ b/src/java.base/share/classes/java/lang/StringConcatHelper.java	Wed Oct 17 23:28:08 2018 +0200
@@ -139,61 +139,6 @@
     }
 
     /**
-     * Mix coder into current coder
-     * @param current current coder
-     * @param value   value to mix in
-     * @return new coder
-     */
-    static byte mixCoder(byte current, boolean value) {
-        // Booleans are represented with Latin1
-        return current;
-    }
-
-    /**
-     * Mix coder into current coder
-     * @param current current coder
-     * @param value   value to mix in
-     * @return new coder
-     */
-    static byte mixCoder(byte current, byte value) {
-        // Bytes are represented with Latin1
-        return current;
-    }
-
-    /**
-     * Mix coder into current coder
-     * @param current current coder
-     * @param value   value to mix in
-     * @return new coder
-     */
-    static byte mixCoder(byte current, short value) {
-        // Shorts are represented with Latin1
-        return current;
-    }
-
-    /**
-     * Mix coder into current coder
-     * @param current current coder
-     * @param value   value to mix in
-     * @return new coder
-     */
-    static byte mixCoder(byte current, int value) {
-        // Ints are represented with Latin1
-        return current;
-    }
-
-    /**
-     * Mix coder into current coder
-     * @param current current coder
-     * @param value   value to mix in
-     * @return new coder
-     */
-    static byte mixCoder(byte current, long value) {
-        // Longs are represented with Latin1
-        return current;
-    }
-
-    /**
      * Prepends the stringly representation of boolean value into buffer,
      * given the coder and final index. Index is measured in chars, not in bytes!
      *
--- a/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Wed Oct 17 17:30:28 2018 +0200
+++ b/src/java.base/share/classes/java/lang/invoke/StringConcatFactory.java	Wed Oct 17 23:28:08 2018 +0200
@@ -1588,28 +1588,47 @@
 
                         Class<?> argClass = ptypes[ac];
                         MethodHandle lm = lengthMixer(argClass);
-                        MethodHandle cm = coderMixer(argClass);
+
+                        // Read these bottom up:
+
+                        if (argClass.isPrimitive() && argClass != char.class) {
+
+                            // 3. Drop old index, producing ("new-index", "coder", <args>)
+                            mh = MethodHandles.dropArguments(mh, 1, int.class);
 
-                        // Read this bottom up:
+                            // 2. Compute "new-index", producing ("new-index", "old-index", "coder", <args>)
+                            //    Length mixer needs old index, plus the appropriate argument
+                            mh = MethodHandles.foldArguments(mh, 0, lm,
+                                    1, // old-index
+                                    3 + ac // selected argument
+                            );
 
-                        // 4. Drop old index and coder, producing ("new-index", "new-coder", <args>)
-                        mh = MethodHandles.dropArguments(mh, 2, int.class, byte.class);
+                            // 1. The mh shape here is ("old-index", "coder", <args>); we don't need to recalculate
+                            //    the coder for non-char primitive arguments
+
+                        } else {
+                            MethodHandle cm = coderMixer(argClass);
 
-                        // 3. Compute "new-index", producing ("new-index", "new-coder", "old-index", "old-coder", <args>)
-                        //    Length mixer needs old index, plus the appropriate argument
-                        mh = MethodHandles.foldArguments(mh, 0, lm,
-                                2, // old-index
-                                4 + ac // selected argument
-                        );
+                            // 4. Drop old index and coder, producing ("new-index", "new-coder", <args>)
+                            mh = MethodHandles.dropArguments(mh, 2, int.class, byte.class);
+
+                            // 3. Compute "new-index", producing ("new-index", "new-coder", "old-index", "old-coder", <args>)
+                            //    Length mixer needs old index, plus the appropriate argument
+                            mh = MethodHandles.foldArguments(mh, 0, lm,
+                                    2, // old-index
+                                    4 + ac // selected argument
+                            );
 
-                        // 2. Compute "new-coder", producing ("new-coder", "old-index", "old-coder", <args>)
-                        //    Coder mixer needs old coder, plus the appropriate argument.
-                        mh = MethodHandles.foldArguments(mh, 0, cm,
-                                2, // old-coder
-                                3 + ac // selected argument
-                        );
+                            // 2. Compute "new-coder", producing ("new-coder", "old-index", "old-coder", <args>)
+                            //    Coder mixer needs old coder, plus the appropriate argument.
+                            mh = MethodHandles.foldArguments(mh, 0, cm,
+                                    2, // old-coder
+                                    3 + ac // selected argument
+                            );
 
-                        // 1. The mh shape here is ("old-index", "old-coder", <args>)
+                            // 1. The mh shape here is ("old-index", "old-coder", <args>)
+                        }
+
                         break;
                     default:
                         throw new StringConcatException("Unhandled tag: " + el.getTag());