--- a/.hgignore Mon Oct 19 19:13:58 2015 +0200
+++ b/.hgignore Mon Oct 19 12:30:16 2015 -0700
@@ -5,3 +5,5 @@
^.hgtip
^.bridge2
.DS_Store
+.metadata/
+.recommenders/
--- a/make/CompileJavaModules.gmk Mon Oct 19 19:13:58 2015 +0200
+++ b/make/CompileJavaModules.gmk Mon Oct 19 12:30:16 2015 -0700
@@ -438,6 +438,18 @@
################################################################################
+jdk.vm.ci_EXCLUDE_FILES += \
+ jdk/vm/ci/options/processor/OptionProcessor.java \
+ jdk/vm/ci/service/processor/ServiceProviderProcessor.java \
+ #
+
+jdk.vm.ci_EXCLUDES += \
+ META-INF/jvmci.options \
+ META-INF/jvmci.providers \
+ #
+
+################################################################################
+
jdk.xml.bind_SETUP := GENERATE_JDKBYTECODE_NOWARNINGS
jdk.xml.bind_CLEAN := .properties
jdk.xml.bind_COPY := .xsd JAXBContextFactory.java ZeroOneBooleanAdapter.java
@@ -479,6 +491,7 @@
endif
SHARE_SRC_DIRS += \
+ $(HOTSPOT_TOPDIR)/src/$1/share/classes \
$(JDK_TOPDIR)/src/$1/share/classes \
$(LANGTOOLS_TOPDIR)/src/$1/share/classes \
$(CORBA_TOPDIR)/src/$1/share/classes \
@@ -531,7 +544,7 @@
$$(eval $$(call SetupJavaCompilation,$1, \
SETUP := $$(if $$($1_SETUP), $$($1_SETUP), GENERATE_JDKBYTECODE), \
- SRC := $$(wildcard $$(call ALL_SRC_DIRS,$1)), \
+ SRC := $$(if $$($1_SRC), $$($1_SRC), $$(wildcard $$(call ALL_SRC_DIRS,$1))), \
INCLUDES := $(JDK_USER_DEFINED_FILTER),\
BIN := $$(if $$($1_BIN), $$($1_BIN), $(JDK_OUTPUTDIR)/modules/$1), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers/$1, \
--- a/make/Images.gmk Mon Oct 19 19:13:58 2015 +0200
+++ b/make/Images.gmk Mon Oct 19 12:30:16 2015 -0700
@@ -39,7 +39,8 @@
MAIN_MODULES += java.se java.smartcardio jdk.httpserver jdk.sctp \
jdk.security.auth jdk.security.jgss jdk.pack200 jdk.xml.dom \
- jdk.accessibility jdk.internal.le jdk.scripting.nashorn.shell
+ jdk.accessibility jdk.internal.le jdk.scripting.nashorn.shell \
+ jdk.vm.ci
# providers
PROVIDER_MODULES += jdk.charsets jdk.crypto.ec jdk.crypto.pkcs11 jdk.jvmstat jdk.localedata \
--- a/make/Main.gmk Mon Oct 19 19:13:58 2015 +0200
+++ b/make/Main.gmk Mon Oct 19 12:30:16 2015 -0700
@@ -107,6 +107,7 @@
JDK_GENSRC_TARGETS := $(filter %-gensrc-jdk, $(GENSRC_TARGETS))
LANGTOOLS_GENSRC_TARGETS := $(filter %-gensrc-langtools, $(GENSRC_TARGETS))
CORBA_GENSRC_TARGETS := $(filter %-gensrc-corba, $(GENSRC_TARGETS))
+HOTSPOT_GENSRC_TARGETS := $(filter %-gensrc-hotspot, $(GENSRC_TARGETS))
ALL_TARGETS += $(GENSRC_TARGETS)
@@ -128,7 +129,8 @@
FILE_PREFIX := Copy, \
MAKE_SUBDIR := copy, \
CHECK_MODULES := $(ALL_MODULES), \
- USE_WRAPPER := true))
+ USE_WRAPPER := true, \
+ MULTIPLE_MAKEFILES := true))
ALL_TARGETS += $(COPY_TARGETS)
@@ -352,6 +354,8 @@
$(CORBA_GENSRC_TARGETS): interim-langtools
+ $(HOTSPOT_GENSRC_TARGETS): interim-langtools
+
$(JDK_GENSRC_TARGETS): interim-langtools buildtools-jdk
$(GENDATA_TARGETS): interim-langtools buildtools-jdk
@@ -415,6 +419,9 @@
# Explicitly add dependencies for special targets
java.base-java: unpack-sec
+ # The copy target copies files generated by gensrc
+ java.base-copy-hotspot: java.base-gensrc-hotspot
+
jdk.jdeps-gendata: java rmic
zip-security: java.base-java java.security.jgss-java java.security.jgss-libs \
--- a/make/MainSupport.gmk Mon Oct 19 19:13:58 2015 +0200
+++ b/make/MainSupport.gmk Mon Oct 19 12:30:16 2015 -0700
@@ -108,7 +108,8 @@
################################################################################
-MAKE_TOPDIR_LIST := $(JDK_TOPDIR) $(CORBA_TOPDIR) $(LANGTOOLS_TOPDIR)
+MAKE_TOPDIR_LIST := $(JDK_TOPDIR) $(CORBA_TOPDIR) $(LANGTOOLS_TOPDIR) \
+ $(HOTSPOT_TOPDIR)
MAKE_MAKEDIR_LIST := make
# Helper macro for DeclareRecipesForPhase
@@ -179,7 +180,7 @@
# FILE_PREFIX : File prefix for this build phase
# USE_WRAPPER : Set to true to use ModuleWrapper.gmk
# CHECK_MODULES : List of modules to try
-# MULTIPLE_MAKEFILES : Set to true to handle makefils for the same module in
+# MULTIPLE_MAKEFILES : Set to true to handle makefiles for the same module and
# phase in multiple repos
# Exported variables:
# $1_MODULES : All modules that had rules generated
--- a/make/common/Modules.gmk Mon Oct 19 19:13:58 2015 +0200
+++ b/make/common/Modules.gmk Mon Oct 19 12:30:16 2015 -0700
@@ -33,6 +33,7 @@
# Module list macros
ALL_TOP_SRC_DIRS := \
+ $(HOTSPOT_TOPDIR)/src \
$(JDK_TOPDIR)/src \
$(LANGTOOLS_TOPDIR)/src \
$(CORBA_TOPDIR)/src \
--- a/modules.xml Mon Oct 19 19:13:58 2015 +0200
+++ b/modules.xml Mon Oct 19 12:30:16 2015 -0700
@@ -237,6 +237,7 @@
<to>java.instrument</to>
<to>jdk.jfr</to>
<to>jdk.scripting.nashorn</to>
+ <to>jdk.vm.ci</to>
</export>
<export>
<name>jdk.internal.org.objectweb.asm.commons</name>
@@ -290,6 +291,7 @@
<to>jdk.security.auth</to>
<to>jdk.security.jgss</to>
<to>jdk.snmp</to>
+ <to>jdk.vm.ci</to>
<to>java.instrument</to>
</export>
<export>
@@ -1901,6 +1903,18 @@
</export>
</module>
<module>
+ <name>jdk.vm.ci</name>
+ <depend>java.base</depend>
+ <export>
+ <name>jdk.vm.ci.hotspot</name>
+ <to>jdk.jfr</to>
+ </export>
+ <export>
+ <name>jdk.vm.ci.hotspot.events</name>
+ <to>jdk.jfr</to>
+ </export>
+ </module>
+ <module>
<name>jdk.xml.bind</name>
<depend>java.activation</depend>
<depend>java.base</depend>
--- a/test/lib/share/classes/jdk/test/lib/apps/LingeredApp.java Mon Oct 19 19:13:58 2015 +0200
+++ b/test/lib/share/classes/jdk/test/lib/apps/LingeredApp.java Mon Oct 19 12:30:16 2015 -0700
@@ -67,6 +67,7 @@
public class LingeredApp {
private static final long spinDelay = 1000;
+ private static final int appWaitTime = 100;
private final String lockFileName;
private long lockCreationTime;
@@ -111,6 +112,12 @@
this.storedAppOutput = new ArrayList<String>();
}
+ public LingeredApp() {
+ final String lockName = UUID.randomUUID().toString() + ".lck";
+ this.lockFileName = lockName;
+ this.storedAppOutput = new ArrayList<String>();
+ }
+
/**
*
* @return name of lock file
@@ -338,21 +345,18 @@
* High level interface for test writers
*/
/**
- * Factory method that creates SmartAppTest object with ready to use application
- * lock name is autogenerated, wait timeout is hardcoded
+ * Factory method that creates LingeredApp object with ready to use application
+ * lock name is autogenerated
* @param cmd - vm options, could be null to auto add testvm.options
* @return LingeredApp object
* @throws IOException
*/
public static LingeredApp startApp(List<String> cmd) throws IOException {
- final String lockName = UUID.randomUUID().toString() + ".lck";
- final int waitTime = 10;
-
- LingeredApp a = new LingeredApp(lockName);
+ LingeredApp a = new LingeredApp();
a.createLock();
try {
a.runApp(cmd);
- a.waitAppReady(waitTime);
+ a.waitAppReady(appWaitTime);
} catch (Exception ex) {
a.deleteLock();
throw ex;
@@ -361,6 +365,26 @@
return a;
}
+ /**
+ * Factory method that starts pre-created LingeredApp
+ * lock name is autogenerated
+ * @param cmd - vm options, could be null to auto add testvm.options
+ * @param theApp - app to start
+ * @return LingeredApp object
+ * @throws IOException
+ */
+
+ public static void startApp(List<String> cmd, LingeredApp theApp) throws IOException {
+ theApp.createLock();
+ try {
+ theApp.runApp(cmd);
+ theApp.waitAppReady(appWaitTime);
+ } catch (Exception ex) {
+ theApp.deleteLock();
+ throw ex;
+ }
+ }
+
public static LingeredApp startApp() throws IOException {
return startApp(null);
}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/lib/share/classes/jdk/test/lib/apps/LingeredAppWithDeadlock.java Mon Oct 19 12:30:16 2015 -0700
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2005, 2015, 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 jdk.test.lib.apps;
+
+import java.util.concurrent.Phaser;
+
+public class LingeredAppWithDeadlock extends LingeredApp {
+
+ private static final Object Lock1 = new Object();
+ private static final Object Lock2 = new Object();
+
+ private static volatile int reachCount = 0;
+
+ private static final Phaser p = new Phaser(2);
+
+ private static class ThreadOne extends Thread {
+ public void run() {
+ // wait Lock2 is locked
+ p.arriveAndAwaitAdvance();
+ synchronized (Lock1) {
+ // signal Lock1 is locked
+ p.arriveAndAwaitAdvance();
+ synchronized (Lock2) {
+ reachCount += 1;
+ }
+ }
+ }
+ }
+
+ private static class ThreadTwo extends Thread {
+ public void run() {
+ synchronized (Lock2) {
+ // signal Lock2 is locked
+ p.arriveAndAwaitAdvance();
+ // wait Lock1 is locked
+ p.arriveAndAwaitAdvance();
+ synchronized (Lock1) {
+ reachCount += 1;
+ }
+ }
+ }
+ }
+
+ public static void main(String args[]) {
+ if (args.length != 1) {
+ System.err.println("Lock file name is not specified");
+ System.exit(7);
+ }
+
+ // Run two theads that should come to deadlock
+ new ThreadOne().start();
+ new ThreadTwo().start();
+
+ if (reachCount > 0) {
+ // Not able to deadlock, exiting
+ System.exit(3);
+ }
+
+ LingeredApp.main(args);
+ }
+ }
--- a/test/lib/sun/hotspot/WhiteBox.java Mon Oct 19 19:13:58 2015 +0200
+++ b/test/lib/sun/hotspot/WhiteBox.java Mon Oct 19 12:30:16 2015 -0700
@@ -112,6 +112,12 @@
public native void forceSafepoint();
+ private native long getConstantPool0(Class<?> aClass);
+ public long getConstantPool(Class<?> aClass) {
+ Objects.requireNonNull(aClass);
+ return getConstantPool0(aClass);
+ }
+
// JVMTI
private native void addToBootstrapClassLoaderSearch0(String segment);
public void addToBootstrapClassLoaderSearch(String segment){
@@ -159,6 +165,7 @@
public native int NMTGetHashSize();
// Compiler
+ public native int matchesMethod(Executable method, String pattern);
public native int deoptimizeFrames(boolean makeNotEntrant);
public native void deoptimizeAll();
public boolean isMethodCompiled(Executable method) {
@@ -288,6 +295,11 @@
public native void forceNMethodSweep();
public native Object[] getCodeHeapEntries(int type);
public native int getCompilationActivityMode();
+ private native long getMethodData0(Executable method);
+ public long getMethodData(Executable method) {
+ Objects.requireNonNull(method);
+ return getMethodData0(method);
+ }
public native Object[] getCodeBlob(long addr);
// Intered strings
--- a/test/lib/sun/hotspot/code/NMethod.java Mon Oct 19 19:13:58 2015 +0200
+++ b/test/lib/sun/hotspot/code/NMethod.java Mon Oct 19 12:30:16 2015 -0700
@@ -35,14 +35,16 @@
}
private NMethod(Object[] obj) {
super((Object[])obj[0]);
- assert obj.length == 4;
+ assert obj.length == 5;
comp_level = (Integer) obj[1];
insts = (byte[]) obj[2];
compile_id = (Integer) obj[3];
+ address = (Long) obj[4];
}
public final byte[] insts;
public final int comp_level;
public final int compile_id;
+ public final long address;
@Override
public String toString() {
@@ -51,6 +53,7 @@
+ ", insts=" + insts
+ ", comp_level=" + comp_level
+ ", compile_id=" + compile_id
+ + ", address=" + address
+ '}';
}
}