# HG changeset patch # User jprovino # Date 1349894158 14400 # Node ID 2f7431485cfab2d7be9a4e92b9df56c657815e08 # Parent 3fc49366dc15da619b29a9c5501a1163a704bca6 7189254: Change makefiles for more flexibility to override defaults Summary: Change makefiles so that targets and parameters can be overridden by alternate makefiles. Reviewed-by: dholmes, coleenp diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/Makefile --- a/hotspot/make/Makefile Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/Makefile Wed Oct 10 14:35:58 2012 -0400 @@ -76,6 +76,8 @@ include $(GAMMADIR)/make/altsrc.make +-include $(HS_ALT_MAKE)/Makefile.make + ifneq ($(ALT_OUTPUTDIR),) ALT_OUT=ALT_OUTPUTDIR=$(ALT_OUTPUTDIR) else @@ -88,16 +90,23 @@ KERNEL_VM_TARGETS=productkernel fastdebugkernel optimizedkernel jvmgkernel ZERO_VM_TARGETS=productzero fastdebugzero optimizedzero jvmgzero SHARK_VM_TARGETS=productshark fastdebugshark optimizedshark jvmgshark +MINIMAL1_VM_TARGETS=productminimal1 fastdebugminimal1 jvmgminimal1 -COMMON_VM_PRODUCT_TARGETS=product product1 productkernel docs export_product -COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 fastdebugkernel docs export_fastdebug -COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 jvmgkernel docs export_debug +COMMON_VM_PRODUCT_TARGETS=product product1 docs export_product +COMMON_VM_FASTDEBUG_TARGETS=fastdebug fastdebug1 docs export_fastdebug +COMMON_VM_DEBUG_TARGETS=jvmg jvmg1 docs export_debug # JDK directory list JDK_DIRS=bin include jre lib demo all: all_product all_fastdebug +ifeq ($(JVM_VARIANT_MINIMAL1),true) +all_product: productminimal1 +all_fastdebug: fastdebugminimal1 +all_debug: jvmgminimal1 +endif + ifdef BUILD_CLIENT_ONLY all_product: product1 docs export_product all_fastdebug: fastdebug1 docs export_fastdebug @@ -114,7 +123,7 @@ endif endif -all_optimized: optimized optimized1 optimizedkernel docs export_optimized +all_optimized: optimized optimized1 docs export_optimized allzero: all_productzero all_fastdebugzero all_productzero: productzero docs export_product @@ -167,6 +176,11 @@ $(MAKE) BUILD_FLAVOR=$(@:%shark=%) VM_TARGET=$@ \ generic_buildshark $(ALT_OUT) +$(MINIMAL1_VM_TARGETS): + $(CD) $(GAMMADIR)/make; \ + $(MAKE) BUILD_FLAVOR=$(@:%minimal1=%) VM_TARGET=$@ \ + generic_buildminimal1 $(ALT_OUT) + # Build compiler1 (client) rule, different for platforms generic_build1: $(MKDIR) -p $(OUTPUTDIR) @@ -239,6 +253,27 @@ $(MAKE) -f $(ABS_OS_MAKEFILE) \ $(MAKE_ARGS) $(VM_TARGET) +generic_buildminimal1: +ifeq ($(JVM_VARIANT_MINIMAL1),true) + $(MKDIR) -p $(OUTPUTDIR) + ifeq ($(ARCH_DATA_MODEL), 32) + ifeq ($(OSNAME),windows) + $(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ; + else + ifeq ($(OSNAME),solaris) + $(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" ; + else + $(CD) $(OUTPUTDIR); \ + $(MAKE) -f $(ABS_OS_MAKEFILE) $(MAKE_ARGS) $(VM_TARGET) ; + endif + endif + else + @$(ECHO) "No ($(VM_TARGET)) for $(OSNAME) ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)" + endif +else + @$(ECHO) "Error: trying to build a minimal target but JVM_VARIANT_MINIMAL1 is not true." +endif + # Export file rule generic_export: $(EXPORT_LIST) export_product: @@ -287,6 +322,8 @@ KERNEL_DIR=$(KERNEL_BASE_DIR)/$(VM_SUBDIR) ZERO_DIR=$(ZERO_BASE_DIR)/$(VM_SUBDIR) SHARK_DIR=$(SHARK_BASE_DIR)/$(VM_SUBDIR) +MINIMAL1_BASE_DIR=$(OUTPUTDIR)/$(VM_PLATFORM)_minimal1 +MINIMAL1_DIR=$(MINIMAL1_BASE_DIR)/$(VM_SUBDIR) ifeq ($(JVM_VARIANT_SERVER), true) MISC_DIR=$(C2_DIR) @@ -308,6 +345,10 @@ MISC_DIR=$(ZERO_DIR) GEN_DIR=$(ZERO_BASE_DIR)/generated endif +ifeq ($(JVM_VARIANT_MINIMAL1), true) + MISC_DIR=$(MINIMAL1_DIR) + GEN_DIR=$(MINIMAL1_BASE_DIR)/generated +endif # Bin files (windows) ifeq ($(OSNAME),windows) @@ -357,6 +398,16 @@ $(install-file) endif +# Minimal JVM files always come from minimal area +$(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz + $(install-file) +$(EXPORT_MINIMAL_DIR)/%.dll: $(MINIMAL1_DIR)/%.dll + $(install-file) +$(EXPORT_MINIMAL_DIR)/%.pdb: $(MINIMAL1_DIR)/%.pdb + $(install-file) +$(EXPORT_MINIMAL_DIR)/%.map: $(MINIMAL1_DIR)/%.map + $(install-file) + # Shared Library ifneq ($(OSNAME),windows) ifeq ($(JVM_VARIANT_SERVER), true) @@ -411,6 +462,26 @@ $(EXPORT_SERVER_DIR)/%.$(LIBRARY_SUFFIX): $(ZERO_DIR)/%.$(LIBRARY_SUFFIX) $(install-file) endif + ifeq ($(JVM_VARIANT_MINIMAL1), true) + $(EXPORT_JRE_LIB_ARCH_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX) + $(install-file) + $(EXPORT_MINIMAL_DIR)/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX) + $(install-file) + $(EXPORT_MINIMAL_DIR)/64/%.$(LIBRARY_SUFFIX): $(MINIMAL1_DIR)/%.$(LIBRARY_SUFFIX) + $(install-file) + $(EXPORT_JRE_LIB_ARCH_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo + $(install-file) + $(EXPORT_MINIMAL_DIR)/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo + $(install-file) + $(EXPORT_MINIMAL_DIR)/64/%.debuginfo: $(MINIMAL1_DIR)/%.debuginfo + $(install-file) + $(EXPORT_JRE_LIB_ARCH_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz + $(install-file) + $(EXPORT_MINIMAL_DIR)/%.diz: $(MINIMAL1_DIR)/%.diz + $(install-file) + $(EXPORT_MINIMAL_DIR)/64/%.diz: $(MINIMAL1_DIR)/%.diz + $(install-file) + endif endif # Jar file (sa-jdi.jar) @@ -451,7 +522,7 @@ $(install-file) # Xusage file -$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt: $(XUSAGE) +$(EXPORT_SERVER_DIR)/Xusage.txt $(EXPORT_CLIENT_DIR)/Xusage.txt $(EXPORT_KERNEL_DIR)/Xusage.txt $(EXPORT_MINIMAL_DIR)/Xusage.txt: $(XUSAGE) $(prep-target) $(RM) $@.temp $(SED) 's/\(separated by \)[;:]/\1$(PATH_SEP)/g' $< > $@.temp @@ -467,6 +538,7 @@ $(RM) -r $(KERNEL_DIR) $(RM) -r $(ZERO_DIR) $(RM) -r $(SHARK_DIR) + $(RM) -r $(MINIMAL1_DIR) clean_export: $(RM) -r $(EXPORT_PATH) clean_jdk: @@ -574,10 +646,11 @@ @$(ECHO) "create_jdk: Create JDK image, export all files into it" @$(ECHO) "update_jdk: Update JDK image with fresh exported files" @$(ECHO) " " - @$(ECHO) "Others targets are:" + @$(ECHO) "Other targets are:" @$(ECHO) " $(C1_VM_TARGETS)" @$(ECHO) " $(C2_VM_TARGETS)" @$(ECHO) " $(KERNEL_VM_TARGETS)" + @$(ECHO) " $(MINIMAL1_VM_TARGETS)" # Variable help (only common ones used by this workspace) variable_help: variable_help_intro variable_list variable_help_end @@ -672,9 +745,10 @@ include $(GAMMADIR)/make/jprt.gmk .PHONY: all world clobber clean help $(C1_VM_TARGETS) $(C2_VM_TARGETS) \ - $(KERNEL_VM_TARGETS) \ - generic_build1 generic_build2 generic_buildkernel generic_export \ + $(KERNEL_VM_TARGETS) $(MINIMAL1_VM_TARGETS) \ + generic_build1 generic_build2 generic_buildkernel generic_buildminimal1 generic_export \ export_product export_fastdebug export_debug export_optimized \ export_jdk_product export_jdk_fastdebug export_jdk_debug \ create_jdk copy_jdk update_jdk test_jdk \ - copy_product_jdk copy_fastdebug_jdk copy_debug_jdk + copy_product_jdk copy_fastdebug_jdk copy_debug_jdk \ + $(HS_ALT_MAKE)/Makefile.make diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/bsd/Makefile --- a/hotspot/make/bsd/Makefile Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/bsd/Makefile Wed Oct 10 14:35:58 2012 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2012, 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 @@ -175,6 +175,10 @@ # profiledshark shark __shark/profiled # productshark shark __shark/product # +# fastdebugminimal1 minimal1 __minimal1/fastdebug +# jvmgminimal1 minimal1 __minimal1/jvmg +# productminimal1 minimal1 __minimal1/product +# # What you get with each target: # # debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher @@ -199,6 +203,7 @@ SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS)) SUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS)) SUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS)) +SUBDIRS_MINIMAL1 = $(addprefix $(OSNAME)_$(BUILDARCH)_minimal1/,$(TARGETS)) TARGETS_C2 = $(TARGETS) TARGETS_C1 = $(addsuffix 1,$(TARGETS)) @@ -206,6 +211,7 @@ TARGETS_CORE = $(addsuffix core,$(TARGETS)) TARGETS_ZERO = $(addsuffix zero,$(TARGETS)) TARGETS_SHARK = $(addsuffix shark,$(TARGETS)) +TARGETS_MINIMAL1 = $(addsuffix minimal1,$(TARGETS)) BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) LIBRARY_SUFFIX=$(LIBRARY_SUFFIX) @@ -223,6 +229,7 @@ @echo " $(TARGETS_CORE)" @echo " $(TARGETS_ZERO)" @echo " $(TARGETS_SHARK)" + @echo " $(TARGETS_MINIMAL1)" checks: check_os_version check_j2se_version @@ -281,6 +288,10 @@ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks $(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH) +$(SUBDIRS_MINIMAL1): $(BUILDTREE_MAKE) + $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks + $(BUILDTREE) VARIANT=minimal1 + platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in $(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@ @@ -340,12 +351,22 @@ cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install endif +$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1) + cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) +ifeq ($(TEST_IN_BUILD),true) + cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma +endif +ifdef INSTALL + cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install +endif + # Just build the tree, and nothing else: tree: $(SUBDIRS_C2) tree1: $(SUBDIRS_C1) treecore: $(SUBDIRS_CORE) treezero: $(SUBDIRS_ZERO) treeshark: $(SUBDIRS_SHARK) +treeminimal1: $(SUBDIRS_MINIMAL1) # Doc target. This is the same for all build options. # Hence create a docs directory beside ...$(ARCH)_[...] @@ -367,17 +388,23 @@ clean_docs: rm -rf $(SUBDIR_DOCS) -clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark: +clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark clean_minimal1: rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@) -clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs +clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_minimal1 clean_docs include $(GAMMADIR)/make/cscope.make +# +# Include alternate Makefile if it exists. +# +-include $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make + #------------------------------------------------------------------------------- -.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) +.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) $(TARGETS_MINIMAL1) .PHONY: tree tree1 treecore treezero treeshark .PHONY: all compiler1 compiler2 core zero shark .PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs .PHONY: checks check_os_version check_j2se_version +.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/bsd/makefiles/buildtree.make --- a/hotspot/make/bsd/makefiles/buildtree.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/bsd/makefiles/buildtree.make Wed Oct 10 14:35:58 2012 -0400 @@ -60,6 +60,7 @@ -include $(SPEC) include $(GAMMADIR)/make/scm.make +include $(GAMMADIR)/make/defs.make include $(GAMMADIR)/make/altsrc.make @@ -195,6 +196,8 @@ sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \ echo; \ echo "GAMMADIR = $(GAMMADIR)"; \ + echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \ + echo "OSNAME = $(OSNAME)"; \ echo "SYSDEFS = \$$(Platform_sysdefs)"; \ echo "SRCARCH = $(SRCARCH)"; \ echo "BUILDARCH = $(BUILDARCH)"; \ @@ -251,6 +254,7 @@ [ -n "$(SPEC)" ] && \ echo "include $(SPEC)"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \ + echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \ ) > $@ diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/bsd/makefiles/defs.make --- a/hotspot/make/bsd/makefiles/defs.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/bsd/makefiles/defs.make Wed Oct 10 14:35:58 2012 -0400 @@ -155,6 +155,7 @@ EXPORT_LIST += $(EXPORT_JRE_LIB_ARCH_DIR)/libjsig.$(LIBRARY_SUFFIX) EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client +EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar @@ -168,6 +169,19 @@ EXPORT_LIST += $(EXPORT_CLIENT_DIR)/libjvm.$(LIBRARY_SUFFIX) endif +ifeq ($(JVM_VARIANT_MINIMAL1),true) + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz + else + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo + endif + endif +endif + # Serviceability Binaries # No SA Support for PPC, IA64, ARM or zero ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/bsd/makefiles/gcc.make --- a/hotspot/make/bsd/makefiles/gcc.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/bsd/makefiles/gcc.make Wed Oct 10 14:35:58 2012 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 1999, 2012, 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 @@ -151,11 +151,6 @@ CFLAGS += -DCC_INTERP endif -# Build for embedded targets -ifdef JAVASE_EMBEDDED - CFLAGS += -DJAVASE_EMBEDDED -endif - # Keep temporary files (.ii, .s) ifdef NEED_ASM CFLAGS += -save-temps @@ -186,20 +181,32 @@ CFLAGS_WARN/os_bsd.o = $(CFLAGS_WARN/DEFAULT) -Wno-deprecated-declarations endif +OPT_CFLAGS/SIZE=-Os +OPT_CFLAGS/SPEED=-O3 + +# Hotspot uses very unstrict aliasing turn this optimization off +# This option is added to CFLAGS rather than OPT_CFLAGS +# so that OPT_CFLAGS overrides get this option too. +CFLAGS += -fno-strict-aliasing # The flags to use for an Optimized g++ build ifeq ($(OS_VENDOR), Darwin) # use -Os by default, unless -O3 can be proved to be worth the cost, as per policy # - OPT_CFLAGS += -Os + OPT_CFLAGS_DEFAULT ?= SIZE else - OPT_CFLAGS += -O3 + OPT_CFLAGS_DEFAULT ?= SPEED endif -# Hotspot uses very unstrict aliasing turn this optimization off -OPT_CFLAGS += -fno-strict-aliasing +ifdef OPT_CFLAGS + ifneq ("$(origin OPT_CFLAGS)", "command line") + $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.") + endif +endif -# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp +OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS) + +# The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp # if we use expensive-optimizations ifeq ($(BUILDARCH), ia64) OPT_CFLAGS += -fno-expensive-optimizations diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/bsd/makefiles/ia64.make --- a/hotspot/make/bsd/makefiles/ia64.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/bsd/makefiles/ia64.make Wed Oct 10 14:35:58 2012 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 @@ -25,8 +25,6 @@ # # IA64 only uses c++ based interpreter CFLAGS += -DCC_INTERP -D_LP64=1 -DVM_LITTLE_ENDIAN -# Hotspot uses very unstrict aliasing turn this optimization off -OPT_CFLAGS += -fno-strict-aliasing ifeq ($(VERSION),debug) ASM_FLAGS= -DDEBUG else diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/bsd/makefiles/minimal1.make --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/bsd/makefiles/minimal1.make Wed Oct 10 14:35:58 2012 -0400 @@ -0,0 +1,46 @@ +# +# Copyright (c) 2012, 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. +# +# + +TYPE=MINIMAL1 + +INCLUDE_JVMTI ?= false +INCLUDE_FPROF ?= false +INCLUDE_VM_STRUCTS ?= false +INCLUDE_JNI_CHECK ?= false +INCLUDE_SERVICES ?= false +INCLUDE_MANAGEMENT ?= false +INCLUDE_ALTERNATE_GCS ?= false +INCLUDE_NMT ?= false +INCLUDE_CDS ?= false + +CXXFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\" +CFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\" + +Src_Dirs/MINIMAL1 = $(CORE_PATHS) $(COMPILER1_PATHS) + +Src_Files_EXCLUDE/MINIMAL1 += $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp + +-include $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make + +.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/bsd/makefiles/vm.make --- a/hotspot/make/bsd/makefiles/vm.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/bsd/makefiles/vm.make Wed Oct 10 14:35:58 2012 -0400 @@ -190,7 +190,7 @@ ZERO_SPECIFIC_FILES := zero # Always exclude these. -Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp +Src_Files_EXCLUDE += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp # Exclude per type. Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/defs.make --- a/hotspot/make/defs.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/defs.make Wed Oct 10 14:35:58 2012 -0400 @@ -22,6 +22,27 @@ # # +# The common definitions for hotspot builds. + +# Optionally include SPEC file generated by configure. +ifneq ($(SPEC),) + include $(SPEC) +endif + +# Directory paths and user name +# Unless GAMMADIR is set on the command line, search upward from +# the current directory for a parent directory containing "src/share/vm". +# If that fails, look for $GAMMADIR in the environment. +# When the tree of subdirs is built, this setting is stored in each flags.make. +GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done) +HS_SRC_DIR=$(GAMMADIR)/src +HS_MAKE_DIR=$(GAMMADIR)/make +HS_BUILD_DIR=$(GAMMADIR)/build + +ifeq ($(USER),) + USER=$(USERNAME) +endif + ifeq ($(HS_ALT_MAKE),) ifneq ($(OPENJDK),true) HS_ALT_MAKE=$(GAMMADIR)/make/closed @@ -30,12 +51,10 @@ endif endif -# The common definitions for hotspot builds. - -# Optionally include SPEC file generated by configure. -ifneq ($(SPEC),) - include $(SPEC) -endif +# +# Include alternate defs.make if it exists +# +-include $(HS_ALT_MAKE)/defs.make # Default to verbose build logs (show all compile lines): MAKE_VERBOSE=y @@ -84,20 +103,6 @@ endif endif -# Directory paths and user name -# Unless GAMMADIR is set on the command line, search upward from -# the current directory for a parent directory containing "src/share/vm". -# If that fails, look for $GAMMADIR in the environment. -# When the tree of subdirs is built, this setting is stored in each flags.make. -GAMMADIR := $(shell until ([ -d dev ]&&echo $${GAMMADIR:-/GAMMADIR/}) || ([ -d src/share/vm ]&&pwd); do cd ..; done) -HS_SRC_DIR=$(GAMMADIR)/src -HS_MAKE_DIR=$(GAMMADIR)/make -HS_BUILD_DIR=$(GAMMADIR)/build - -ifeq ($(USER),) - USER=$(USERNAME) -endif - # hotspot version definitions include $(GAMMADIR)/make/hotspot_version @@ -339,3 +344,4 @@ EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h endif +.PHONY: $(HS_ALT_MAKE)/defs.make diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/excludeSrc.make --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/excludeSrc.make Wed Oct 10 14:35:58 2012 -0400 @@ -0,0 +1,110 @@ +# +# Copyright (c) 2012, 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. +# +# +ifeq ($(INCLUDE_JVMTI), false) + CXXFLAGS += -DINCLUDE_JVMTI=0 + CFLAGS += -DINCLUDE_JVMTI=0 + + Src_Files_EXCLUDE += jvmtiGetLoadedClasses.cpp forte.cpp jvmtiThreadState.cpp jvmtiExtensions.cpp \ + jvmtiImpl.cpp jvmtiManageCapabilities.cpp jvmtiRawMonitor.cpp jvmtiUtil.cpp jvmtiTrace.cpp \ + jvmtiCodeBlobEvents.cpp jvmtiEnv.cpp jvmtiRedefineClasses.cpp jvmtiEnvBase.cpp jvmtiEnvThreadState.cpp \ + jvmtiTagMap.cpp jvmtiEventController.cpp evmCompat.cpp jvmtiEnter.xsl jvmtiExport.cpp +endif + +ifeq ($(INCLUDE_FPROF), false) + CXXFLAGS += -DINCLUDE_FPROF=0 + CFLAGS += -DINCLUDE_FPROF=0 + + Src_Files_EXCLUDE += fprofiler.cpp +endif + +ifeq ($(INCLUDE_VM_STRUCTS), false) + CXXFLAGS += -DINCLUDE_VM_STRUCTS=0 + CFLAGS += -DINCLUDE_VM_STRUCTS=0 + + Src_Files_EXCLUDE += vmStructs.cpp +endif + +ifeq ($(INCLUDE_JNI_CHECK), false) + CXXFLAGS += -DINCLUDE_JNI_CHECK=0 + CFLAGS += -DINCLUDE_JNI_CHECK=0 + + Src_Files_EXCLUDE += jniCheck.cpp +endif + +ifeq ($(INCLUDE_SERVICES), false) + CXXFLAGS += -DINCLUDE_SERVICES=0 + CFLAGS += -DINCLUDE_SERVICES=0 + + Src_Files_EXCLUDE += heapDumper.cpp heapInspection.cpp \ + attachListener_linux.cpp attachListener.cpp +endif + +ifeq ($(INCLUDE_MANAGEMENT), false) + CXXFLAGS += -DINCLUDE_MANAGEMENT=0 + CFLAGS += -DINCLUDE_MANAGEMENT=0 +endif + +ifeq ($(INCLUDE_CDS), false) + CXXFLAGS += -DINCLUDE_CDS=0 + CFLAGS += -DINCLUDE_CDS=0 + + Src_Files_EXCLUDE += metaspaceShared.cpp +endif + +ifeq ($(INCLUDE_ALTERNATE_GCS), false) + CXXFLAGS += -DINCLUDE_ALTERNATE_GCS=0 + CFLAGS += -DINCLUDE_ALTERNATE_GCS=0 + + CXXFLAGS += -DSERIALGC + CFLAGS += -DSERIALGC + Src_Files_EXCLUDE += \ + binaryTreeDictionary.cpp cmsAdaptiveSizePolicy.cpp cmsCollectorPolicy.cpp \ + cmsGCAdaptivePolicyCounters.cpp cmsLockVerifier.cpp cmsPermGen.cpp compactibleFreeListSpace.cpp \ + concurrentMarkSweepGeneration.cpp concurrentMarkSweepThread.cpp freeBlockDictionary.cpp \ + freeChunk.cpp freeList.cpp promotionInfo.cpp vmCMSOperations.cpp collectionSetChooser.cpp \ + concurrentG1Refine.cpp concurrentG1RefineThread.cpp concurrentMark.cpp concurrentMarkThread.cpp \ + dirtyCardQueue.cpp g1AllocRegion.cpp g1BlockOffsetTable.cpp g1CollectedHeap.cpp g1GCPhaseTimes.cpp \ + g1CollectorPolicy.cpp g1ErgoVerbose.cpp g1_globals.cpp g1HRPrinter.cpp g1MarkSweep.cpp \ + g1MMUTracker.cpp g1MonitoringSupport.cpp g1RemSet.cpp g1SATBCardTableModRefBS.cpp heapRegion.cpp \ + heapRegionRemSet.cpp heapRegionSeq.cpp heapRegionSet.cpp heapRegionSets.cpp ptrQueue.cpp \ + satbQueue.cpp sparsePRT.cpp survRateGroup.cpp vm_operations_g1.cpp adjoiningGenerations.cpp \ + adjoiningVirtualSpaces.cpp asPSOldGen.cpp asPSYoungGen.cpp cardTableExtension.cpp \ + gcTaskManager.cpp gcTaskThread.cpp objectStartArray.cpp parallelScavengeHeap.cpp parMarkBitMap.cpp \ + pcTasks.cpp psAdaptiveSizePolicy.cpp psCompactionManager.cpp psGCAdaptivePolicyCounters.cpp \ + psGenerationCounters.cpp psMarkSweep.cpp psMarkSweepDecorator.cpp psOldGen.cpp psParallelCompact.cpp \ + psPermGen.cpp psPromotionLAB.cpp psPromotionManager.cpp psScavenge.cpp psTasks.cpp psVirtualspace.cpp \ + psYoungGen.cpp vmPSOperations.cpp asParNewGeneration.cpp parCardTableModRefBS.cpp \ + parGCAllocBuffer.cpp parNewGeneration.cpp mutableSpace.cpp gSpaceCounters.cpp allocationStats.cpp \ + spaceCounters.cpp gcAdaptivePolicyCounters.cpp mutableNUMASpace.cpp immutableSpace.cpp \ + immutableSpace.cpp g1MemoryPool.cpp psMemoryPool.cpp yieldWorkingGroup.cpp g1Log.cpp +endif + +ifeq ($(INCLUDE_NMT), false) + CXXFLAGS += -DINCLUDE_NMT=0 + CFLAGS += -DINCLUDE_NMT=0 + + Src_Files_EXCLUDE += \ + memBaseline.cpp memPtr.cpp memRecorder.cpp memReporter.cpp memSnapshot.cpp memTrackWorker.cpp \ + memTracker.cpp nmtDCmd.cpp +endif diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/linux/Makefile --- a/hotspot/make/linux/Makefile Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/linux/Makefile Wed Oct 10 14:35:58 2012 -0400 @@ -175,6 +175,10 @@ # profiledshark shark __shark/profiled # productshark shark __shark/product # +# fastdebugminimal1 minimal1 __minimal1/fastdebug +# jvmgminimal1 minimal1 __minimal1/jvmg +# productminimal1 minimal1 __minimal1/product +# # What you get with each target: # # debug* - "thin" libjvm_g - debug info linked into the gamma_g launcher @@ -199,6 +203,7 @@ SUBDIRS_CORE = $(addprefix $(OSNAME)_$(BUILDARCH)_core/,$(TARGETS)) SUBDIRS_ZERO = $(addprefix $(OSNAME)_$(VARIANTARCH)_zero/,$(TARGETS)) SUBDIRS_SHARK = $(addprefix $(OSNAME)_$(VARIANTARCH)_shark/,$(TARGETS)) +SUBDIRS_MINIMAL1 = $(addprefix $(OSNAME)_$(BUILDARCH)_minimal1/,$(TARGETS)) TARGETS_C2 = $(TARGETS) TARGETS_C1 = $(addsuffix 1,$(TARGETS)) @@ -206,6 +211,7 @@ TARGETS_CORE = $(addsuffix core,$(TARGETS)) TARGETS_ZERO = $(addsuffix zero,$(TARGETS)) TARGETS_SHARK = $(addsuffix shark,$(TARGETS)) +TARGETS_MINIMAL1 = $(addsuffix minimal1,$(TARGETS)) BUILDTREE_MAKE = $(GAMMADIR)/make/$(OSNAME)/makefiles/buildtree.make BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OSNAME) SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) @@ -224,6 +230,7 @@ @echo " $(TARGETS_CORE)" @echo " $(TARGETS_ZERO)" @echo " $(TARGETS_SHARK)" + @echo " $(TARGETS_MINIMAL1)" checks: check_os_version check_j2se_version @@ -281,6 +288,11 @@ $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks $(BUILDTREE) VARIANT=shark VARIANTARCH=$(VARIANTARCH) +$(SUBDIRS_MINIMAL1): $(BUILDTREE_MAKE) + $(QUIETLY) $(MAKE) -f $(GAMMADIR)/make/$(OSNAME)/Makefile checks + $(BUILDTREE) VARIANT=minimal1 + + platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in $(SED) 's/@ZERO_ARCHDEF@/$(ZERO_ARCHDEF)/g;s/@ZERO_LIBARCH@/$(ZERO_LIBARCH)/g;' < $< > $@ @@ -340,12 +352,22 @@ cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install endif +$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1) + cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) +ifeq ($(TEST_IN_BUILD),true) + cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma +endif +ifdef INSTALL + cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install +endif + # Just build the tree, and nothing else: tree: $(SUBDIRS_C2) tree1: $(SUBDIRS_C1) treecore: $(SUBDIRS_CORE) treezero: $(SUBDIRS_ZERO) treeshark: $(SUBDIRS_SHARK) +treeminimal1: $(SUBDIRS_MINIMAL1) # Doc target. This is the same for all build options. # Hence create a docs directory beside ...$(ARCH)_[...] @@ -369,17 +391,23 @@ clean_docs: rm -rf $(SUBDIR_DOCS) -clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark: +clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark clean_minimal1: rm -rf $(OSNAME)_$(BUILDARCH)_$(subst clean_,,$@) -clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_docs +clean: clean_compiler2 clean_compiler1 clean_core clean_zero clean_shark clean_minimal1 clean_docs include $(GAMMADIR)/make/cscope.make +# +# Include alternate Makefile if it exists. +# +-include $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make + #------------------------------------------------------------------------------- -.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) +.PHONY: $(TARGETS_C2) $(TARGETS_C1) $(TARGETS_CORE) $(TARGETS_ZERO) $(TARGETS_SHARK) $(TARGETS_MINIMAL1) .PHONY: tree tree1 treecore treezero treeshark .PHONY: all compiler1 compiler2 core zero shark .PHONY: clean clean_compiler1 clean_compiler2 clean_core clean_zero clean_shark docs clean_docs .PHONY: checks check_os_version check_j2se_version +.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/Makefile.make diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/linux/makefiles/buildtree.make --- a/hotspot/make/linux/makefiles/buildtree.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/linux/makefiles/buildtree.make Wed Oct 10 14:35:58 2012 -0400 @@ -57,6 +57,7 @@ -include $(SPEC) include $(GAMMADIR)/make/scm.make +include $(GAMMADIR)/make/defs.make include $(GAMMADIR)/make/altsrc.make @@ -188,6 +189,8 @@ sed -n '/=/s/^ */Platform_/p' < $(PLATFORM_FILE); \ echo; \ echo "GAMMADIR = $(GAMMADIR)"; \ + echo "HS_ALT_MAKE = $(HS_ALT_MAKE)"; \ + echo "OSNAME = $(OSNAME)"; \ echo "SYSDEFS = \$$(Platform_sysdefs)"; \ echo "SRCARCH = $(SRCARCH)"; \ echo "BUILDARCH = $(BUILDARCH)"; \ @@ -254,6 +257,7 @@ [ -n "$(SPEC)" ] && \ echo "include $(SPEC)"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(VARIANT).make"; \ + echo "include \$$(GAMMADIR)/make/excludeSrc.make"; \ echo "include \$$(GAMMADIR)/make/$(OS_FAMILY)/makefiles/$(COMPILER).make"; \ ) > $@ diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/linux/makefiles/defs.make --- a/hotspot/make/linux/makefiles/defs.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/linux/makefiles/defs.make Wed Oct 10 14:35:58 2012 -0400 @@ -254,6 +254,7 @@ endif EXPORT_SERVER_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/server EXPORT_CLIENT_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/client +EXPORT_MINIMAL_DIR = $(EXPORT_JRE_LIB_ARCH_DIR)/minimal EXPORT_LIST += $(EXPORT_JRE_LIB_DIR)/wb.jar @@ -281,6 +282,19 @@ endif endif +ifeq ($(JVM_VARIANT_MINIMAL1),true) + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/Xusage.txt + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.$(LIBRARY_SUFFIX) + + ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) + ifeq ($(ZIP_DEBUGINFO_FILES),1) + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.diz + else + EXPORT_LIST += $(EXPORT_MINIMAL_DIR)/libjvm.debuginfo + endif + endif +endif + # Serviceability Binaries # No SA Support for PPC, IA64, ARM or zero ADD_SA_BINARIES/x86 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/linux/makefiles/gcc.make --- a/hotspot/make/linux/makefiles/gcc.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/linux/makefiles/gcc.make Wed Oct 10 14:35:58 2012 -0400 @@ -116,11 +116,6 @@ CFLAGS += -DCC_INTERP endif -# Build for embedded targets -ifdef JAVASE_EMBEDDED - CFLAGS += -DJAVASE_EMBEDDED -endif - # Keep temporary files (.ii, .s) ifdef NEED_ASM CFLAGS += -save-temps @@ -146,10 +141,23 @@ CFLAGS_WARN/BYFILE = $(CFLAGS_WARN/$@)$(CFLAGS_WARN/DEFAULT$(CFLAGS_WARN/$@)) # The flags to use for an Optimized g++ build -OPT_CFLAGS += -O3 +OPT_CFLAGS/SIZE=-Os +OPT_CFLAGS/SPEED=-O3 # Hotspot uses very unstrict aliasing turn this optimization off -OPT_CFLAGS += -fno-strict-aliasing +# This option is added to CFLAGS rather than OPT_CFLAGS +# so that OPT_CFLAGS overrides get this option too. +CFLAGS += -fno-strict-aliasing + +OPT_CFLAGS_DEFAULT ?= SPEED + +ifdef OPT_CFLAGS + ifneq ("$(origin OPT_CFLAGS)", "command line") + $(error " Use OPT_EXTRAS instead of OPT_CFLAGS to add extra flags to OPT_CFLAGS.") + endif +endif + +OPT_CFLAGS = $(OPT_CFLAGS/$(OPT_CFLAGS_DEFAULT)) $(OPT_EXTRAS) # The gcc compiler segv's on ia64 when compiling bytecodeInterpreter.cpp # if we use expensive-optimizations diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/linux/makefiles/ia64.make --- a/hotspot/make/linux/makefiles/ia64.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/linux/makefiles/ia64.make Wed Oct 10 14:35:58 2012 -0400 @@ -1,5 +1,5 @@ # -# Copyright (c) 2005, 2008, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2005, 2012, 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 @@ -25,8 +25,6 @@ # # IA64 only uses c++ based interpreter CFLAGS += -DCC_INTERP -D_LP64=1 -DVM_LITTLE_ENDIAN -# Hotspot uses very unstrict aliasing turn this optimization off -OPT_CFLAGS += -fno-strict-aliasing ifeq ($(VERSION),debug) ASM_FLAGS= -DDEBUG else diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/linux/makefiles/minimal1.make --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/hotspot/make/linux/makefiles/minimal1.make Wed Oct 10 14:35:58 2012 -0400 @@ -0,0 +1,46 @@ +# +# Copyright (c) 2012, 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. +# +# + +TYPE=MINIMAL1 + +INCLUDE_JVMTI ?= false +INCLUDE_FPROF ?= false +INCLUDE_VM_STRUCTS ?= false +INCLUDE_JNI_CHECK ?= false +INCLUDE_SERVICES ?= false +INCLUDE_MANAGEMENT ?= false +INCLUDE_ALTERNATE_GCS ?= false +INCLUDE_NMT ?= false +INCLUDE_CDS ?= false + +CXXFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\" +CFLAGS += -DMINIMAL_JVM -DCOMPILER1 -DVMTYPE=\"Minimal\" + +Src_Dirs/MINIMAL1 = $(CORE_PATHS) $(COMPILER1_PATHS) + +Src_Files_EXCLUDE/MINIMAL1 += $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp + +-include $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make + +.PHONY: $(HS_ALT_MAKE)/$(OSNAME)/makefiles/minimal1.make diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/linux/makefiles/vm.make --- a/hotspot/make/linux/makefiles/vm.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/linux/makefiles/vm.make Wed Oct 10 14:35:58 2012 -0400 @@ -192,7 +192,7 @@ ZERO_SPECIFIC_FILES := zero # Always exclude these. -Src_Files_EXCLUDE := jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp +Src_Files_EXCLUDE += jsig.c jvmtiEnvRecommended.cpp jvmtiEnvStub.cpp # Exclude per type. Src_Files_EXCLUDE/CORE := $(COMPILER1_SPECIFIC_FILES) $(COMPILER2_SPECIFIC_FILES) $(ZERO_SPECIFIC_FILES) $(SHARK_SPECIFIC_FILES) ciTypeFlow.cpp diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/make/windows/makefiles/defs.make --- a/hotspot/make/windows/makefiles/defs.make Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/make/windows/makefiles/defs.make Wed Oct 10 14:35:58 2012 -0400 @@ -154,10 +154,9 @@ # On 32 bit windows we build server, client and kernel, on 64 bit just server. ifeq ($(JVM_VARIANTS),) ifeq ($(ARCH_DATA_MODEL), 32) - JVM_VARIANTS:=client,server,kernel + JVM_VARIANTS:=client,server JVM_VARIANT_CLIENT:=true JVM_VARIANT_SERVER:=true - JVM_VARIANT_KERNEL:=true else JVM_VARIANTS:=server JVM_VARIANT_SERVER:=true diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/os/solaris/vm/os_solaris.cpp --- a/hotspot/src/os/solaris/vm/os_solaris.cpp Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp Wed Oct 10 14:35:58 2012 -0400 @@ -5870,15 +5870,6 @@ } } -// Just to get the Kernel build to link on solaris for testing. - -extern "C" { -class ASGCT_CallTrace; -void AsyncGetCallTrace(ASGCT_CallTrace *trace, jint depth, void* ucontext) - KERNEL_RETURN; -} - - // ObjectMonitor park-unpark infrastructure ... // // We implement Solaris and Linux PlatformEvents with the diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/share/vm/memory/allocation.hpp --- a/hotspot/src/share/vm/memory/allocation.hpp Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/share/vm/memory/allocation.hpp Wed Oct 10 14:35:58 2012 -0400 @@ -27,6 +27,7 @@ #include "runtime/globals.hpp" #include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" #ifdef COMPILER1 #include "c1/c1_globals.hpp" #endif @@ -157,8 +158,16 @@ typedef unsigned short MEMFLAGS; +#if INCLUDE_NMT + extern bool NMT_track_callsite; +#else + +const bool NMT_track_callsite = false; + +#endif // INCLUDE_NMT + // debug build does not inline #if defined(_DEBUG_) #define CURRENT_PC (NMT_track_callsite ? os::get_caller_pc(1) : 0) diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/share/vm/memory/heapInspection.hpp --- a/hotspot/src/share/vm/memory/heapInspection.hpp Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/share/vm/memory/heapInspection.hpp Wed Oct 10 14:35:58 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2010, 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 @@ -28,7 +28,7 @@ #include "memory/allocation.inline.hpp" #include "oops/oop.inline.hpp" -#ifndef SERVICES_KERNEL +#if INCLUDE_SERVICES // HeapInspection @@ -129,12 +129,12 @@ void sort(); }; -#endif // SERVICES_KERNEL +#endif // INCLUDE_SERVICES class HeapInspection : public AllStatic { public: - static void heap_inspection(outputStream* st, bool need_prologue) KERNEL_RETURN; - static void find_instances_at_safepoint(Klass* k, GrowableArray* result) KERNEL_RETURN; + static void heap_inspection(outputStream* st, bool need_prologue) NOT_SERVICES_RETURN; + static void find_instances_at_safepoint(Klass* k, GrowableArray* result) NOT_SERVICES_RETURN; }; #endif // SHARE_VM_MEMORY_HEAPINSPECTION_HPP diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/share/vm/memory/metaspaceShared.cpp --- a/hotspot/src/share/vm/memory/metaspaceShared.cpp Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/share/vm/memory/metaspaceShared.cpp Wed Oct 10 14:35:58 2012 -0400 @@ -42,14 +42,8 @@ int MetaspaceShared::_max_alignment = 0; -int MetaspaceShared::max_alignment() { return _max_alignment; } -void MetaspaceShared::set_max_alignment(int alignment) { _max_alignment = alignment; } -// Accessor functions to save shared space created for metadata, which has -// extra space allocated at the end for miscellaneous data and code. ReservedSpace* MetaspaceShared::_shared_rs = NULL; -ReservedSpace* MetaspaceShared::shared_rs() { return _shared_rs; } -void MetaspaceShared::set_shared_rs(ReservedSpace* rs) { _shared_rs = rs; } // Read/write a data stream for restoring/preserving metadata pointers and // miscellaneous data from/to the shared archive file. diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/share/vm/memory/metaspaceShared.hpp --- a/hotspot/src/share/vm/memory/metaspaceShared.hpp Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp Wed Oct 10 14:35:58 2012 -0400 @@ -56,18 +56,33 @@ n_regions = 4 }; - static void set_max_alignment(int alignment) KERNEL_RETURN; - static int max_alignment() KERNEL_RETURN_(0); + // Accessor functions to save shared space created for metadata, which has + // extra space allocated at the end for miscellaneous data and code. + static void set_max_alignment(int alignment) { + CDS_ONLY(_max_alignment = alignment); + } + + static int max_alignment() { + CDS_ONLY(return _max_alignment); + NOT_CDS(return 0); + } - static void preload_and_dump(TRAPS) KERNEL_RETURN; - static ReservedSpace* shared_rs(); - static void set_shared_rs(ReservedSpace* rs) KERNEL_RETURN; + static void preload_and_dump(TRAPS) NOT_CDS_RETURN; + + static ReservedSpace* shared_rs() { + CDS_ONLY(return _shared_rs); + NOT_CDS(return NULL); + } - static bool map_shared_spaces(FileMapInfo* mapinfo) KERNEL_RETURN_(false); - static void initialize_shared_spaces() KERNEL_RETURN; + static void set_shared_rs(ReservedSpace* rs) { + CDS_ONLY(_shared_rs = rs;) + } + + static bool map_shared_spaces(FileMapInfo* mapinfo) NOT_CDS_RETURN_(false); + static void initialize_shared_spaces() NOT_CDS_RETURN; // Return true if given address is in the mapped shared space. - static bool is_in_shared_space(const void* p) KERNEL_RETURN_(false); + static bool is_in_shared_space(const void* p) NOT_CDS_RETURN_(false); static void generate_vtable_methods(void** vtbl_list, void** vtable, @@ -79,7 +94,7 @@ // Remap the shared readonly space to shared readwrite, private if // sharing is enabled. Simply returns true if sharing is not enabled // or if the remapping has already been done by a prior call. - static bool remap_shared_readonly_as_readwrite() KERNEL_RETURN_(true); + static bool remap_shared_readonly_as_readwrite() NOT_CDS_RETURN_(true); static void print_shared_spaces(); }; diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/share/vm/memory/universe.cpp --- a/hotspot/src/share/vm/memory/universe.cpp Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/share/vm/memory/universe.cpp Wed Oct 10 14:35:58 2012 -0400 @@ -752,7 +752,7 @@ #ifndef SERIALGC Universe::_collectedHeap = new ParallelScavengeHeap(); #else // SERIALGC - fatal("UseParallelGC not supported in java kernel vm."); + fatal("UseParallelGC not supported in this VM."); #endif // SERIALGC } else if (UseG1GC) { @@ -777,7 +777,7 @@ gc_policy = new ConcurrentMarkSweepPolicy(); } #else // SERIALGC - fatal("UseConcMarkSweepGC not supported in java kernel vm."); + fatal("UseConcMarkSweepGC not supported in this VM."); #endif // SERIALGC } else { // default old generation gc_policy = new MarkSweepPolicy(); diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/share/vm/prims/forte.hpp --- a/hotspot/src/share/vm/prims/forte.hpp Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/share/vm/prims/forte.hpp Wed Oct 10 14:35:58 2012 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2012, 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 @@ -30,7 +30,7 @@ class Forte : AllStatic { public: static void register_stub(const char* name, address start, address end) - KERNEL_RETURN; + NOT_JVMTI_RETURN; // register internal VM stub }; diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/share/vm/prims/jni.cpp --- a/hotspot/src/share/vm/prims/jni.cpp Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/share/vm/prims/jni.cpp Wed Oct 10 14:35:58 2012 -0400 @@ -3003,9 +3003,9 @@ HOTSPOT_JNI_GETSTATICOBJECTFIELD_ENTRY( env, clazz, (uintptr_t) fieldID); #endif /* USDT2 */ -#ifndef JNICHECK_KERNEL +#if INCLUDE_JNI_CHECK DEBUG_ONLY(Klass* param_k = jniCheck::validate_class(thread, clazz);) -#endif // JNICHECK_KERNEL +#endif // INCLUDE_JNI_CHECK JNIid* id = jfieldIDWorkaround::from_static_jfieldID(fieldID); assert(id->is_static_field_id(), "invalid static field id"); // Keep JVMTI addition small and only check enabled flag here. @@ -3951,6 +3951,7 @@ // SetNativeMethodPrefix(es) functions in the JVM TI Spec for details. static Method* find_prefixed_native(KlassHandle k, Symbol* name, Symbol* signature, TRAPS) { +#if INCLUDE_JVMTI ResourceMark rm(THREAD); Method* method; int name_len = name->utf8_length(); @@ -3982,6 +3983,7 @@ name_len = trial_len; name_str = trial_name_str; } +#endif // INCLUDE_JVMTI return NULL; // not found } @@ -4975,11 +4977,9 @@ // Returns the function structure struct JNINativeInterface_* jni_functions() { -#ifndef JNICHECK_KERNEL +#if INCLUDE_JNI_CHECK if (CheckJNICalls) return jni_functions_check(); -#else // JNICHECK_KERNEL - if (CheckJNICalls) warning("-Xcheck:jni is not supported in kernel vm."); -#endif // JNICHECK_KERNEL +#endif // INCLUDE_JNI_CHECK return &jni_NativeInterface; } diff -r 3fc49366dc15 -r 2f7431485cfa hotspot/src/share/vm/prims/jvmtiEnter.xsl --- a/hotspot/src/share/vm/prims/jvmtiEnter.xsl Fri Oct 05 13:37:08 2012 -0700 +++ b/hotspot/src/share/vm/prims/jvmtiEnter.xsl Wed Oct 10 14:35:58 2012 -0400 @@ -1,6 +1,6 @@