--- a/make/CompileJavaModules.gmk Mon Nov 30 13:26:00 2015 -0800
+++ b/make/CompileJavaModules.gmk Mon Nov 30 13:55:05 2015 -0800
@@ -367,6 +367,29 @@
################################################################################
+jdk.hotspot.agent_SRC += \
+ $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent \
+ $(HOTSPOT_TOPDIR)/agent/src/share/classes \
+ #
+jdk.hotspot.agent_ADD_JAVAC_FLAGS := $(DISABLE_WARNINGS),-overrides
+jdk.hotspot.agent_COPY := .png sa.js .properties
+
+ifeq ($(MODULE), jdk.hotspot.agent)
+ ### Copy gif files
+ # Special handling to copy gif files in images/toolbarButtonGraphics \
+ # -> classes/toolbarButtonGraphics.
+ # These can't be handled by COPY to SetupJavaCompilation since they chop off
+ # one directory level.
+ $(eval $(call SetupCopyFiles, COPY_SA_IMAGES, \
+ SRC := $(HOTSPOT_TOPDIR)/agent/src/share/classes/images, \
+ DEST := $(JDK_OUTPUTDIR)/modules/$(MODULE), \
+ FILES := $(wildcard $(HOTSPOT_TOPDIR)/agent/src/share/classes/images/*/*/*.gif), \
+ ))
+ jdk.hotspot.agent: $(COPY_SA_IMAGES)
+endif
+
+################################################################################
+
jdk.internal.le_COPY := .properties
################################################################################
@@ -528,24 +551,23 @@
CLASSPATH := $(foreach d, $(DEPS), $(if $($d_BIN), $($d_BIN), \
$(JDK_OUTPUTDIR)/modules/$d))
-# When crypto classes are prebuilt, need to look for classes already in
-# output dir.
-ifneq ($(BUILD_CRYPTO), true)
+ # When crypto classes are prebuilt, need to look for classes already in
+ # output dir.
+ ifneq ($(BUILD_CRYPTO), true)
CLASSPATH += $(JDK_OUTPUTDIR)/modules/$(MODULE)
-endif
+ endif
JAVAC_FLAGS := -bootclasspath $(EMPTY_DIR) -extdirs $(EMPTY_DIR) \
-endorseddirs $(EMPTY_DIR) $($(MODULE)_ADD_JAVAC_FLAGS)
$(eval $(call SetupJavaCompilation, $(MODULE), \
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
SRC := $(if $($(MODULE)_SRC), $($(MODULE)_SRC), $(wildcard $(ALL_SRC_DIRS))), \
- INCLUDES := $(JDK_USER_DEFINED_FILTER),\
+ INCLUDES := $(JDK_USER_DEFINED_FILTER),\
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules/$(MODULE)), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers/$(MODULE), \
CLASSPATH := $(CLASSPATH), \
ADD_JAVAC_FLAGS := $($(MODULE)_ADD_JAVAC_FLAGS) $(JAVAC_FLAGS) \
))
-
TARGETS += $($(MODULE)) $($(MODULE)_COPY_EXTRA)
# Declare dependencies between java compilations of different modules.
--- a/make/Images.gmk Mon Nov 30 13:26:00 2015 -0800
+++ b/make/Images.gmk Mon Nov 30 13:55:05 2015 -0800
@@ -27,6 +27,7 @@
include $(SPEC)
include MakeBase.gmk
+include Modules.gmk
TOOL_TARGETS :=
JDK_TARGETS :=
--- a/make/Main.gmk Mon Nov 30 13:26:00 2015 -0800
+++ b/make/Main.gmk Mon Nov 30 13:55:05 2015 -0800
@@ -53,8 +53,7 @@
$(eval $(call IncludeCustomExtension, , Main.gmk))
# All modules for the current target platform.
-# Manually add jdk.hotspot.agent for now.
-ALL_MODULES := $(call FindAllModules) jdk.hotspot.agent
+ALL_MODULES := $(call FindAllModules)
################################################################################
################################################################################
@@ -424,11 +423,6 @@
# virtual target.
jdk.jdwp.agent-libs: jdk.jdwp.agent-gensrc
- # Until the module system is in place, jdk.jdi-gensrc needs to combine service
- # loader configuration with jdk.hotspot.agent so is dependent on importing
- # hotspot.
- jdk.jdi-gensrc-jdk: import-hotspot
-
# The swing beans need to have java base properly generated to avoid errors
# in javadoc.
java.desktop-gensrc-jdk: java.base-gensrc
--- a/make/common/Modules.gmk Mon Nov 30 13:26:00 2015 -0800
+++ b/make/common/Modules.gmk Mon Nov 30 13:55:05 2015 -0800
@@ -30,6 +30,12 @@
include SetupJavaCompilers.gmk
################################################################################
+# Some platforms don't have the serviceability agent
+ifeq ($(INCLUDE_SA), false)
+ MODULES_FILTER += jdk.hotspot.agent
+endif
+
+################################################################################
# Module list macros
ALL_TOP_SRC_DIRS := \
@@ -43,21 +49,25 @@
#
# Find all modules with java sources by looking in the source dirs
+# jdk.hotspot.agent currently doesn't comply with source dir policy.
define FindJavaModules
$(filter-out $(MODULES_FILTER), $(sort $(notdir \
$(patsubst %/,%, $(dir $(patsubst %/,%, $(dir $(patsubst %/,%, $(dir \
$(wildcard $(patsubst %,%/*/share/classes/*, $(ALL_TOP_SRC_DIRS)) \
$(patsubst %,%/*/$(OPENJDK_TARGET_OS)/classes/*, $(ALL_TOP_SRC_DIRS)) \
- $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS))))))))))))
+ $(patsubst %,%/*/$(OPENJDK_TARGET_OS_TYPE)/classes/*, $(ALL_TOP_SRC_DIRS))))))))))) \
+ jdk.hotspot.agent)
endef
# Find all modules with source for the target platform.
+# jdk.hotspot.agent currently doesn't comply with source dir policy.
define FindAllModules
$(sort $(filter-out $(MODULES_FILTER) closed demo sample, \
$(notdir $(patsubst %/,%, $(dir \
$(wildcard $(patsubst %, %/*/share, $(ALL_TOP_SRC_DIRS)) \
$(patsubst %, %/*/$(OPENJDK_TARGET_OS), $(ALL_TOP_SRC_DIRS)) \
- $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS))))))))
+ $(patsubst %, %/*/$(OPENJDK_TARGET_OS_TYPE), $(ALL_TOP_SRC_DIRS)))))) \
+ jdk.hotspot.agent))
endef
################################################################################
--- a/make/common/NativeCompilation.gmk Mon Nov 30 13:26:00 2015 -0800
+++ b/make/common/NativeCompilation.gmk Mon Nov 30 13:55:05 2015 -0800
@@ -296,6 +296,10 @@
# LD the linker to use, default is $(LD)
# OPTIMIZATION sets optimization level to NONE, LOW, HIGH, HIGHEST
# DISABLED_WARNINGS_<toolchain> Disable the given warnings for the specified toolchain
+# DISABLED_WARNINGS_C_<toolchain> Disable the given warnings for the specified toolchain
+# when compiling C code
+# DISABLED_WARNINGS_CXX_<toolchain> Disable the given warnings for the specified
+# toolchain when compiling C++ code
# STRIP_SYMBOLS Set to true to strip the final binary if the toolchain allows for it
# STRIPFLAGS Optionally change the flags given to the strip command
SetupNativeCompilation = $(NamedParamsMacroTemplate)
@@ -539,8 +543,12 @@
# Pick up disabled warnings, if possible on this platform.
ifneq ($(DISABLE_WARNING_PREFIX),)
- $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
- $1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)))
+ $1_EXTRA_CFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
+ $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
+ $$($1_DISABLED_WARNINGS_C_$(TOOLCHAIN_TYPE)))
+ $1_EXTRA_CXXFLAGS += $$(addprefix $(DISABLE_WARNING_PREFIX), \
+ $$($1_DISABLED_WARNINGS_$(TOOLCHAIN_TYPE)) \
+ $$($1_DISABLED_WARNINGS_CXX_$(TOOLCHAIN_TYPE)))
endif
# Check if warnings should be considered errors.
--- a/modules.xml Mon Nov 30 13:26:00 2015 -0800
+++ b/modules.xml Mon Nov 30 13:55:05 2015 -0800
@@ -344,6 +344,7 @@
<to>java.sql.rowset</to>
<to>jdk.dynalink</to>
<to>jdk.scripting.nashorn</to>
+ <to>jdk.vm.cds</to>
</export>
<export>
<name>sun.reflect.annotation</name>
--- a/test/lib/sun/hotspot/WhiteBox.java Mon Nov 30 13:26:00 2015 -0800
+++ b/test/lib/sun/hotspot/WhiteBox.java Mon Nov 30 13:55:05 2015 -0800
@@ -407,6 +407,7 @@
public native void assertMatchingSafepointCalls(boolean mutexSafepointValue, boolean attemptedNoSafepointValue);
// Sharing
+ public native boolean isSharedClass(Class<?> c);
public native boolean isShared(Object o);
public native boolean areSharedStringsIgnored();
}