Merge
authorduke
Wed, 05 Jul 2017 21:47:36 +0200 (2017-07-05)
changeset 38737 bd57c1bd1e80
parent 38736 40c900f520ce (current diff)
parent 38631 bbb89d6c08cc (diff)
child 38799 0c6d943a32fa
Merge
--- a/.hgtags-top-repo	Mon Jun 06 09:58:03 2016 -0700
+++ b/.hgtags-top-repo	Wed Jul 05 21:47:36 2017 +0200
@@ -363,3 +363,4 @@
 047f95de8f918d8ff5e8cd2636a2abb5c3c8adb8 jdk-9+118
 3463a3f14f0f0e8a68f29ac6405454f2fa2f598a jdk-9+119
 647e0142a5a52749db572b5e6638d561def6479e jdk-9+120
+cae471d3b87783e0a3deea658e1e1c84b2485b6c jdk-9+121
--- a/LICENSE	Mon Jun 06 09:58:03 2016 -0700
+++ b/LICENSE	Wed Jul 05 21:47:36 2017 +0200
@@ -3,7 +3,7 @@
 Version 2, June 1991
 
 Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
 Everyone is permitted to copy and distribute verbatim copies of this license
 document, but changing it is not allowed.
@@ -287,8 +287,8 @@
     more details.
 
     You should have received a copy of the GNU General Public License along
-    with this program; if not, write to the Free Software Foundation, Inc., 59
-    Temple Place, Suite 330, Boston, MA 02111-1307 USA
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 Also add information on how to contact you by electronic and paper mail.
 
--- a/common/conf/jib-profiles.js	Mon Jun 06 09:58:03 2016 -0700
+++ b/common/conf/jib-profiles.js	Wed Jul 05 21:47:36 2017 +0200
@@ -318,7 +318,8 @@
         },
 
         "linux-x86-open": {
-            default_make_targets: "profiles"
+            default_make_targets: "profiles",
+            configure_args: "--with-jvm-variants=client,server"
         }
     };
     var openOnlyProfiles = concatObjects(openOnlyProfiles, openOnlyProfilesExtra);
--- a/make/common/Modules.gmk	Mon Jun 06 09:58:03 2016 -0700
+++ b/make/common/Modules.gmk	Wed Jul 05 21:47:36 2017 +0200
@@ -57,7 +57,6 @@
     java.rmi \
     java.security.jgss \
     java.security.sasl \
-    java.sql \
     java.xml \
     java.xml.crypto \
     jdk.httpserver \
@@ -72,7 +71,6 @@
 
 # to be deprivileged
 BOOT_MODULES += \
-    java.sql.rowset \
     java.smartcardio \
     jdk.naming.rmi \
     #
@@ -106,6 +104,8 @@
 PLATFORM_MODULES += \
     java.compiler \
     java.scripting \
+    java.sql \
+    java.sql.rowset \
     jdk.accessibility \
     jdk.charsets \
     jdk.crypto.ec \
--- a/test/lib/sun/hotspot/WhiteBox.java	Mon Jun 06 09:58:03 2016 -0700
+++ b/test/lib/sun/hotspot/WhiteBox.java	Wed Jul 05 21:47:36 2017 +0200
@@ -377,6 +377,12 @@
   public native long incMetaspaceCapacityUntilGC(long increment);
   public native long metaspaceCapacityUntilGC();
 
+  // Don't use these methods directly
+  // Use sun.hotspot.gc.GC class instead.
+  public native int currentGC();
+  public native int allSupportedGC();
+  public native boolean gcSelectedByErgo();
+
   // Force Young GC
   public native void youngGC();
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/sun/hotspot/gc/GC.java	Wed Jul 05 21:47:36 2017 +0200
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+package sun.hotspot.gc;
+
+import java.util.ArrayList;
+import java.util.List;
+import sun.hotspot.WhiteBox;
+
+/**
+ * API to obtain information about selected and supported Garbage Collectors
+ * retrieved from the VM with the WhiteBox API.
+ */
+public enum GC {
+    Serial(1),
+    Parallel(2),
+    ConcMarkSweep(4),
+    G1(8);
+
+    private static final GC CURRENT_GC;
+    private static final int ALL_GC_CODES;
+    private static final boolean IS_BY_ERGO;
+    static {
+        WhiteBox WB = WhiteBox.getWhiteBox();
+        ALL_GC_CODES = WB.allSupportedGC();
+        IS_BY_ERGO = WB.gcSelectedByErgo();
+
+        int currentCode = WB.currentGC();
+        GC tmp = null;
+        for (GC gc: GC.values()) {
+            if (gc.code == currentCode) {
+                tmp = gc;
+                break;
+            }
+        }
+        if (tmp == null) {
+            throw new Error("Unknown current GC code " + currentCode);
+        }
+        CURRENT_GC = tmp;
+    }
+
+    private final int code;
+    private GC(int code) {
+        this.code = code;
+    }
+
+    /**
+     * @return true if the collector is supported by the VM, false otherwise.
+     */
+    public boolean isSupported() {
+        return (ALL_GC_CODES & code) != 0;
+    }
+
+
+    /**
+     * @return the current collector used by VM.
+     */
+    public static GC current() {
+        return CURRENT_GC;
+    }
+
+    /**
+     * @return true if GC was selected by ergonomic, false if specified
+     * explicitly by the command line flag.
+     */
+    public static boolean currentSetByErgo() {
+        return IS_BY_ERGO;
+    }
+
+    /**
+     * @return List of collectors supported by the VM.
+     */
+    public static List<GC> allSupported() {
+        List<GC> list = new ArrayList<>();
+        for (GC gc: GC.values()) {
+            if (gc.isSupported()) {
+                list.add(gc);
+            }
+        }
+        return list;
+    }
+}
+