--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java Fri Mar 22 17:23:31 2013 -0700
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2013, 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
@@ -148,7 +148,7 @@
if (doVMFields) {
visitor.doCInt(mark, true);
if (VM.getVM().isCompressedKlassPointersEnabled()) {
- throw new InternalError("unimplemented");
+ visitor.doMetadata(compressedKlass, true);
} else {
visitor.doMetadata(klass, true);
}
--- a/hotspot/make/Makefile Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/make/Makefile Fri Mar 22 17:23:31 2013 -0700
@@ -532,6 +532,39 @@
$(TAR) -cf - *) | \
($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
+
+# Testing the built JVM
+RUN_JVM=JAVA_HOME=$(JDK_IMPORT_PATH) $(JDK_IMPORT_PATH)/bin/java -d$(ARCH_DATA_MODEL) -Dsun.java.launcher=gamma
+generic_test:
+ @$(ECHO) "Running with: $(ALTJVM_DIR)"
+ @$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -Xinternalversion
+ @$(RUN_JVM) -XXaltjvm=$(ALTJVM_DIR) -showversion -help
+
+# C2 test targets
+test_product test_optimized test_fastdebug test_jvmg:
+ @$(MAKE) generic_test ALTJVM_DIR="$(C2_DIR)/$(@:test_%=%)"
+
+# C1 test targets
+test_product1 test_optimized1 test_fastdebug1 test_jvmg1:
+ ifeq ($(ARCH_DATA_MODEL), 32)
+ @$(MAKE) generic_test ALTJVM_DIR="$(C1_DIR)/$(@:test_%1=%)"
+ else
+ @$(ECHO) "No compiler1 ($(@:test_%=%)) for ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)"
+ endif
+
+# Zero test targets
+test_productzero test_optimizedzero test_fastdebugzero test_jvmgzero:
+ @$(MAKE) generic_test ALTJVM_DIR="$(ZERO_DIR)/$(@:test_%zero=%)"
+
+# Shark test targets
+test_productshark test_optimizedshark test_fastdebugshark test_jvmgshark:
+ @$(MAKE) generic_test ALTJVM_DIR="$(SHARK_DIR)/$(@:test_%shark=%)"
+
+# Minimal1 test targets
+test_productminimal1 test_optimizedminimal1 test_fastdebugminimal1 test_jvmgminimal1:
+ @$(MAKE) generic_test ALTJVM_DIR="$(MINIMAL1_DIR)/$(@:test_%minimal1=%)"
+
+
test_jdk:
ifeq ($(JVM_VARIANT_CLIENT), true)
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -Xinternalversion
--- a/hotspot/make/bsd/Makefile Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/make/bsd/Makefile Fri Mar 22 17:23:31 2013 -0700
@@ -299,63 +299,42 @@
$(TARGETS_C2): $(SUBDIRS_C2)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_C1): $(SUBDIRS_C1)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_CORE): $(SUBDIRS_CORE)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
-endif
ifdef INSTALL
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
--- a/hotspot/make/bsd/makefiles/buildtree.make Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/make/bsd/makefiles/buildtree.make Fri Mar 22 17:23:31 2013 -0700
@@ -50,7 +50,6 @@
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# sa.make - generate SA jar file and natives
# env.[ck]sh - environment settings
-# test_gamma - script to run the Queens program
#
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
@@ -67,9 +66,6 @@
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
QUIETLY$(MAKE_VERBOSE) = @
-# For now, until the compiler is less wobbly:
-TESTFLAGS = -Xbatch -showversion
-
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
else
@@ -135,7 +131,7 @@
# dtrace.make is used on BSD versions that implement Dtrace (like MacOS X)
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make \
jvmti.make sa.make dtrace.make \
- env.sh env.csh jdkpath.sh .dbxrc test_gamma
+ env.sh env.csh jdkpath.sh
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -352,7 +348,7 @@
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
- [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
+ { echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
{ \
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
@@ -364,8 +360,7 @@
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
- [ -n "$$JAVA_HOME" ] && \
- { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
+ { echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
) > $@
@@ -376,119 +371,6 @@
echo "JDK=${JAVA_HOME}"; \
) > $@
-.dbxrc: $(BUILDTREE_MAKE)
- @echo Creating $@ ...
- $(QUIETLY) ( \
- echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
- echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
- echo "then"; \
- echo " source \"\$${HOTSPOT_DBXWARE}\""; \
- echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
- echo "then"; \
- echo " source \"\$$HOME/.dbxrc\""; \
- echo "fi"; \
- ) > $@
-
-# Skip the test for product builds (which only work when installed in a JDK), to
-# avoid exiting with an error and causing make to halt.
-NO_TEST_MSG = \
- echo "$@: skipping the test--this build must be tested in a JDK."
-
-NO_JAVA_HOME_MSG = \
- echo "JAVA_HOME must be set to run this test."
-
-DATA_MODE = $(DATA_MODE/$(BUILDARCH))
-JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
-
-DATA_MODE/i486 = 32
-DATA_MODE/sparc = 32
-DATA_MODE/sparcv9 = 64
-DATA_MODE/amd64 = 64
-DATA_MODE/ia64 = 64
-DATA_MODE/zero = $(ARCH_DATA_MODEL)
-
-JAVA_FLAG/32 = -d32
-JAVA_FLAG/64 = -d64
-
-WRONG_DATA_MODE_MSG = \
- echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
-
-CROSS_COMPILING_MSG = \
- echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
-
-test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
- @echo Creating $@ ...
- $(QUIETLY) ( \
- echo "#!/bin/sh"; \
- echo ""; \
- $(BUILDTREE_COMMENT); \
- echo ""; \
- echo "# Include environment settings for gamma run"; \
- echo ""; \
- echo ". ./env.sh"; \
- echo ""; \
- echo "# Do not run gamma test for cross compiles"; \
- echo ""; \
- echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
- echo " $(CROSS_COMPILING_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
- echo ""; \
- echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
- echo " $(NO_JAVA_HOME_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "# Check JAVA_HOME version to be used for the test"; \
- echo ""; \
- echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
- echo "if [ \$$? -ne 0 ]; then "; \
- echo " $(WRONG_DATA_MODE_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "GAMMA_PROG=gamma"; \
- echo ""; \
- echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
- echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
- echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
- echo ""; \
- echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
- echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
- echo " if [ ! -f \$${JVM_LIB} ]; then"; \
- echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
- echo " fi"; \
- echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
- echo " $(WRONG_DATA_MODE_MSG)"; \
- echo " exit 0"; \
- echo " fi"; \
- echo "fi"; \
- echo ""; \
- echo "# Compile Queens program for test"; \
- echo ""; \
- echo "rm -f Queens.class"; \
- echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
- echo ""; \
- echo "# Set library path solely for gamma launcher test run"; \
- echo ""; \
- echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
- echo "export LD_LIBRARY_PATH"; \
- echo "unset LD_LIBRARY_PATH_32"; \
- echo "unset LD_LIBRARY_PATH_64"; \
- echo ""; \
- echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
- echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
- echo " export DYLD_LIBRARY_PATH"; \
- echo "fi"; \
- echo ""; \
- echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
- echo ""; \
- echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
- ) > $@
- $(QUIETLY) chmod +x $@
-
FORCE:
.PHONY: all FORCE
--- a/hotspot/make/defs.make Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/make/defs.make Fri Mar 22 17:23:31 2013 -0700
@@ -302,7 +302,7 @@
endif
# Required make macro settings for all platforms
-MAKE_ARGS += JAVA_HOME=$(ABS_BOOTDIR)
+MAKE_ARGS += BOOTDIR=$(ABS_BOOTDIR)
MAKE_ARGS += OUTPUTDIR=$(ABS_OUTPUTDIR)
MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR)
MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)
@@ -337,9 +337,6 @@
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
-# By default, run Queens test after building
-TEST_IN_BUILD ?= true
-
ifndef JAVASE_EMBEDDED
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h
endif
--- a/hotspot/make/linux/Makefile Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/make/linux/Makefile Fri Mar 22 17:23:31 2013 -0700
@@ -300,63 +300,42 @@
$(TARGETS_C2): $(SUBDIRS_C2)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_C1): $(SUBDIRS_C1)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_CORE): $(SUBDIRS_CORE)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
-endif
ifdef INSTALL
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
--- a/hotspot/make/linux/makefiles/buildtree.make Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/make/linux/makefiles/buildtree.make Fri Mar 22 17:23:31 2013 -0700
@@ -50,7 +50,6 @@
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# sa.make - generate SA jar file and natives
# env.[ck]sh - environment settings
-# test_gamma - script to run the Queens program
#
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
@@ -64,9 +63,6 @@
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
QUIETLY$(MAKE_VERBOSE) = @
-# For now, until the compiler is less wobbly:
-TESTFLAGS = -Xbatch -showversion
-
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
else
@@ -128,7 +124,7 @@
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
- env.sh env.csh jdkpath.sh .dbxrc test_gamma
+ env.sh env.csh jdkpath.sh
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -345,7 +341,7 @@
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
- [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
+ { echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
{ \
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
@@ -357,8 +353,7 @@
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
- [ -n "$$JAVA_HOME" ] && \
- { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
+ { echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
) > $@
@@ -369,119 +364,6 @@
echo "JDK=${JAVA_HOME}"; \
) > $@
-.dbxrc: $(BUILDTREE_MAKE)
- @echo Creating $@ ...
- $(QUIETLY) ( \
- echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
- echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
- echo "then"; \
- echo " source \"\$${HOTSPOT_DBXWARE}\""; \
- echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
- echo "then"; \
- echo " source \"\$$HOME/.dbxrc\""; \
- echo "fi"; \
- ) > $@
-
-# Skip the test for product builds (which only work when installed in a JDK), to
-# avoid exiting with an error and causing make to halt.
-NO_TEST_MSG = \
- echo "$@: skipping the test--this build must be tested in a JDK."
-
-NO_JAVA_HOME_MSG = \
- echo "JAVA_HOME must be set to run this test."
-
-DATA_MODE = $(DATA_MODE/$(BUILDARCH))
-JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
-
-DATA_MODE/i486 = 32
-DATA_MODE/sparc = 32
-DATA_MODE/sparcv9 = 64
-DATA_MODE/amd64 = 64
-DATA_MODE/ia64 = 64
-DATA_MODE/zero = $(ARCH_DATA_MODEL)
-
-JAVA_FLAG/32 = -d32
-JAVA_FLAG/64 = -d64
-
-WRONG_DATA_MODE_MSG = \
- echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
-
-CROSS_COMPILING_MSG = \
- echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
-
-test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
- @echo Creating $@ ...
- $(QUIETLY) ( \
- echo "#!/bin/sh"; \
- echo ""; \
- $(BUILDTREE_COMMENT); \
- echo ""; \
- echo "# Include environment settings for gamma run"; \
- echo ""; \
- echo ". ./env.sh"; \
- echo ""; \
- echo "# Do not run gamma test for cross compiles"; \
- echo ""; \
- echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
- echo " $(CROSS_COMPILING_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
- echo ""; \
- echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
- echo " $(NO_JAVA_HOME_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "# Check JAVA_HOME version to be used for the test"; \
- echo ""; \
- echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
- echo "if [ \$$? -ne 0 ]; then "; \
- echo " $(WRONG_DATA_MODE_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "GAMMA_PROG=gamma"; \
- echo ""; \
- echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
- echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
- echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
- echo ""; \
- echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
- echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
- echo " if [ ! -f \$${JVM_LIB} ]; then"; \
- echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
- echo " fi"; \
- echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
- echo " $(WRONG_DATA_MODE_MSG)"; \
- echo " exit 0"; \
- echo " fi"; \
- echo "fi"; \
- echo ""; \
- echo "# Compile Queens program for test"; \
- echo ""; \
- echo "rm -f Queens.class"; \
- echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
- echo ""; \
- echo "# Set library path solely for gamma launcher test run"; \
- echo ""; \
- echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
- echo "export LD_LIBRARY_PATH"; \
- echo "unset LD_LIBRARY_PATH_32"; \
- echo "unset LD_LIBRARY_PATH_64"; \
- echo ""; \
- echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
- echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
- echo " export DYLD_LIBRARY_PATH"; \
- echo "fi"; \
- echo ""; \
- echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
- echo ""; \
- echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
- ) > $@
- $(QUIETLY) chmod +x $@
-
FORCE:
.PHONY: all FORCE
--- a/hotspot/make/solaris/Makefile Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/make/solaris/Makefile Fri Mar 22 17:23:31 2013 -0700
@@ -231,36 +231,24 @@
$(TARGETS_C2): $(SUBDIRS_C2)
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_C1): $(SUBDIRS_C1)
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
endif
$(TARGETS_CORE): $(SUBDIRS_CORE)
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
-ifeq ($(TEST_IN_BUILD),true)
- cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
-endif
ifdef INSTALL
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
endif
--- a/hotspot/make/solaris/makefiles/buildtree.make Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/make/solaris/makefiles/buildtree.make Fri Mar 22 17:23:31 2013 -0700
@@ -50,21 +50,19 @@
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
# sa.make - generate SA jar file and natives
# env.[ck]sh - environment settings
-# test_gamma - script to run the Queens program
#
# The makefiles are split this way so that "make foo" will run faster by not
# having to read the dependency files for the vm.
-include $(SPEC)
include $(GAMMADIR)/make/scm.make
+include $(GAMMADIR)/make/defs.make
include $(GAMMADIR)/make/altsrc.make
+
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
QUIETLY$(MAKE_VERBOSE) = @
-# For now, until the compiler is less wobbly:
-TESTFLAGS = -Xbatch -Xmx32m -showversion
-
### maye ARCH_XXX instead?
ifdef USE_GCC
PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).gcc
@@ -119,7 +117,7 @@
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make jvmti.make sa.make \
- env.sh env.csh jdkpath.sh .dbxrc test_gamma
+ env.sh env.csh jdkpath.sh
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
@@ -334,7 +332,7 @@
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
- [ -n "$$JAVA_HOME" ] && { echo ": \$${JAVA_HOME:=$${JAVA_HOME}}"; }; \
+ { echo "JAVA_HOME=$(JDK_IMPORT_PATH)"; }; \
{ \
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
@@ -346,8 +344,7 @@
@echo Creating $@ ...
$(QUIETLY) ( \
$(BUILDTREE_COMMENT); \
- [ -n "$$JAVA_HOME" ] && \
- { echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
+ { echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
) > $@
@@ -358,124 +355,6 @@
echo "JDK=${JAVA_HOME}"; \
) > $@
-.dbxrc: $(BUILDTREE_MAKE)
- @echo Creating $@ ...
- $(QUIETLY) ( \
- echo "echo '# Loading $(PLATFORM_DIR)/$(TARGET)/.dbxrc'"; \
- echo "if [ -f \"\$${HOTSPOT_DBXWARE}\" ]"; \
- echo "then"; \
- echo " source \"\$${HOTSPOT_DBXWARE}\""; \
- echo "elif [ -f \"\$$HOME/.dbxrc\" ]"; \
- echo "then"; \
- echo " source \"\$$HOME/.dbxrc\""; \
- echo "fi"; \
- ) > $@
-
-# Skip the test for product builds (which only work when installed in a JDK), to
-# avoid exiting with an error and causing make to halt.
-NO_TEST_MSG = \
- echo "$@: skipping the test--this build must be tested in a JDK."
-
-NO_JAVA_HOME_MSG = \
- echo "JAVA_HOME must be set to run this test."
-
-DATA_MODE = $(DATA_MODE/$(BUILDARCH))
-JAVA_FLAG = $(JAVA_FLAG/$(DATA_MODE))
-
-DATA_MODE/i486 = 32
-DATA_MODE/sparc = 32
-DATA_MODE/sparcv9 = 64
-DATA_MODE/amd64 = 64
-DATA_MODE/ia64 = 64
-
-# This bit is needed to enable local rebuilds.
-# Unless the makefile itself sets LP64, any environmental
-# setting of LP64 will interfere with the build.
-LP64_SETTING/32 = LP64 = \#empty
-LP64_SETTING/64 = LP64 = 1
-
-JAVA_FLAG/32 = -d32
-JAVA_FLAG/64 = -d64
-
-WRONG_DATA_MODE_MSG = \
- echo "JAVA_HOME must point to a $(DATA_MODE)-bit OpenJDK."
-
-CROSS_COMPILING_MSG = \
- echo "Cross compiling for ARCH $(CROSS_COMPILE_ARCH), skipping gamma run."
-
-test_gamma: $(BUILDTREE_MAKE) $(GAMMADIR)/make/test/Queens.java
- @echo Creating $@ ...
- $(QUIETLY) ( \
- echo "#!/bin/sh"; \
- echo ""; \
- $(BUILDTREE_COMMENT); \
- echo ""; \
- echo "# Include environment settings for gamma run"; \
- echo ""; \
- echo ". ./env.sh"; \
- echo ""; \
- echo "# Do not run gamma test for cross compiles"; \
- echo ""; \
- echo "if [ -n \"$(CROSS_COMPILE_ARCH)\" ]; then "; \
- echo " $(CROSS_COMPILING_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "# Make sure JAVA_HOME is set as it is required for gamma"; \
- echo ""; \
- echo "if [ -z \"\$${JAVA_HOME}\" ]; then "; \
- echo " $(NO_JAVA_HOME_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "# Check JAVA_HOME version to be used for the test"; \
- echo ""; \
- echo "\$${JAVA_HOME}/bin/java $(JAVA_FLAG) -fullversion > /dev/null 2>&1"; \
- echo "if [ \$$? -ne 0 ]; then "; \
- echo " $(WRONG_DATA_MODE_MSG)"; \
- echo " exit 0"; \
- echo "fi"; \
- echo ""; \
- echo "GAMMA_PROG=gamma"; \
- echo ""; \
- echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
- echo " # Ensure architecture for gamma and JAVA_HOME is the same."; \
- echo " # NOTE: gamma assumes the OpenJDK directory layout."; \
- echo ""; \
- echo " GAMMA_ARCH=\"\`file \$${GAMMA_PROG} | awk '{print \$$NF}'\`\""; \
- echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/libjava.$(LIBRARY_SUFFIX)\""; \
- echo " if [ ! -f \$${JVM_LIB} ]; then"; \
- echo " JVM_LIB=\"\$${JAVA_HOME}/jre/lib/$${LIBARCH}/libjava.$(LIBRARY_SUFFIX)\""; \
- echo " fi"; \
- echo " if [ ! -f \$${JVM_LIB} ] || [ -z \"\`file \$${JVM_LIB} | grep \$${GAMMA_ARCH}\`\" ]; then "; \
- echo " $(WRONG_DATA_MODE_MSG)"; \
- echo " exit 0"; \
- echo " fi"; \
- echo "fi"; \
- echo ""; \
- echo "# Compile Queens program for test"; \
- echo ""; \
- echo "rm -f Queens.class"; \
- echo "\$${JAVA_HOME}/bin/javac -d . $(GAMMADIR)/make/test/Queens.java"; \
- echo ""; \
- echo "# Set library path solely for gamma launcher test run"; \
- echo ""; \
- echo "LD_LIBRARY_PATH=.:$${LD_LIBRARY_PATH:+$$LD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
- echo "export LD_LIBRARY_PATH"; \
- echo "unset LD_LIBRARY_PATH_32"; \
- echo "unset LD_LIBRARY_PATH_64"; \
- echo ""; \
- echo "if [ \"$(OS_VENDOR)\" = \"Darwin\" ]; then "; \
- echo " DYLD_LIBRARY_PATH=.:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/native_threads:\$${JAVA_HOME}/jre/lib:$${DYLD_LIBRARY_PATH:+$$DYLD_LIBRARY_PATH:}\$${JAVA_HOME}/jre/lib/${LIBARCH}/native_threads:\$${JAVA_HOME}/jre/lib/${LIBARCH}:${GCC_LIB}"; \
- echo " export DYLD_LIBRARY_PATH"; \
- echo "fi"; \
- echo ""; \
- echo "# Use the gamma launcher and JAVA_HOME to run the test"; \
- echo ""; \
- echo "./\$${GAMMA_PROG} $(TESTFLAGS) Queens < /dev/null"; \
- ) > $@
- $(QUIETLY) chmod +x $@
-
FORCE:
.PHONY: all FORCE
--- a/hotspot/make/test/Queens.java Fri Mar 22 10:09:47 2013 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2006, 2008, 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.
- *
- */
-
-import java.util.*;
-
-// Copyright 1996, Animorphic Systems
-// gri 28 Aug 92 / 15 Jan 93 / 8 Dec 95
-
-class Queens {
-
- static void try_i(boolean a[], boolean b[], boolean c[], int x[], int i) {
- int adj = 7;
-
- for (int j = 1; j <= 8; j++) {
- if (b[j] && a[i+j] && c[adj+i-j]) {
- x[i] = j;
- b[j] = false;
- a[i+j] = false;
- c[adj+i-j] = false;
- if (i < 8) try_i(a, b, c, x, i+1);
- else print(x);
- b[j] = true;
- a[i+j] = true;
- c[adj+i-j] = true;
- }
- }
- }
-
- public static void main(String s[]) {
- boolean a[] = new boolean[16+1];
- boolean b[] = new boolean[ 8+1];
- boolean c[] = new boolean[14+1];
- int x[] = new int[8+1];
- int adj = 7;
-
- for (int i = -7; i <= 16; i++) {
- if (i >= 1 && i <= 8) b[i] = true;
- if (i >= 2) a[i] = true;
- if (i <= 7) c[adj+i] = true;
- }
-
- x[0] = 0; // solution counter
-
- try_i(a, b, c, x, 1);
- }
-
- static void print(int x[]) {
- // first correct solution: A1 B5 C8 D6 E3 F7 G2 H4
-
- char LF = (char)0xA;
- char CR = (char)0xD;
-
- x[0]++;
- if (x[0] < 10)
- System.out.print(" ");
- System.out.print(x[0] + ". ");
- for (int i = 1; i <= 8; i++) {
- char p = (char)('A' + i - 1);
- System.out.print(p);
- System.out.print (x[i] + " ");
- }
- System.out.println();
- }
-
-};
--- a/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/cpu/sparc/vm/macroAssembler_sparc.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -1385,13 +1385,13 @@
}
#endif
- int len = strlen(file) + strlen(msg) + 1 + 4;
- sprintf(buffer, "%d", line);
- len += strlen(buffer);
- sprintf(buffer, " at offset %d ", offset());
- len += strlen(buffer);
- char * real_msg = new char[len];
- sprintf(real_msg, "%s%s(%s:%d)", msg, buffer, file, line);
+ const char* real_msg = NULL;
+ {
+ ResourceMark rm;
+ stringStream ss;
+ ss.print("%s at offset %d (%s:%d)", msg, offset(), file, line);
+ real_msg = code_string(ss.as_string());
+ }
// Call indirectly to solve generation ordering problem
AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
@@ -1423,13 +1423,13 @@
// plausibility check for oops
if (!VerifyOops) return;
- char buffer[64];
- sprintf(buffer, "%d", line);
- int len = strlen(file) + strlen(msg) + 1 + 4 + strlen(buffer);
- sprintf(buffer, " at SP+%d ", addr.disp());
- len += strlen(buffer);
- char * real_msg = new char[len];
- sprintf(real_msg, "%s at SP+%d (%s:%d)", msg, addr.disp(), file, line);
+ const char* real_msg = NULL;
+ {
+ ResourceMark rm;
+ stringStream ss;
+ ss.print("%s at SP+%d (%s:%d)", msg, addr.disp(), file, line);
+ real_msg = code_string(ss.as_string());
+ }
// Call indirectly to solve generation ordering problem
AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
@@ -1622,9 +1622,13 @@
// in order to run automated test scripts on the VM
// Use the flag ShowMessageBoxOnError
- char* b = new char[1024];
- sprintf(b, "untested: %s", what);
-
+ const char* b = NULL;
+ {
+ ResourceMark rm;
+ stringStream ss;
+ ss.print("untested: %s", what);
+ b = code_string(ss.as_string());
+ }
if (ShowMessageBoxOnError) { STOP(b); }
else { warn(b); }
}
--- a/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/cpu/x86/vm/frame_x86.inline.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -295,14 +295,18 @@
return true;
}
-
+inline oop frame::saved_oop_result(RegisterMap* map) const {
+ oop* result_adr = (oop *)map->location(rax->as_VMReg());
+ guarantee(result_adr != NULL, "bad register save location");
-inline oop frame::saved_oop_result(RegisterMap* map) const {
- return *((oop*) map->location(rax->as_VMReg()));
+ return (*result_adr);
}
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
- *((oop*) map->location(rax->as_VMReg())) = obj;
+ oop* result_adr = (oop *)map->location(rax->as_VMReg());
+ guarantee(result_adr != NULL, "bad register save location");
+
+ *result_adr = obj;
}
#endif // CPU_X86_VM_FRAME_X86_INLINE_HPP
--- a/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/cpu/x86/vm/macroAssembler_x86.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -4262,8 +4262,13 @@
if (!VerifyOops) return;
// Pass register number to verify_oop_subroutine
- char* b = new char[strlen(s) + 50];
- sprintf(b, "verify_oop: %s: %s", reg->name(), s);
+ const char* b = NULL;
+ {
+ ResourceMark rm;
+ stringStream ss;
+ ss.print("verify_oop: %s: %s", reg->name(), s);
+ b = code_string(ss.as_string());
+ }
BLOCK_COMMENT("verify_oop {");
#ifdef _LP64
push(rscratch1); // save r10, trashed by movptr()
@@ -4297,9 +4302,14 @@
{ Label L;
testptr(tmp, tmp);
if (WizardMode) {
+ const char* buf = NULL;
+ {
+ ResourceMark rm;
+ stringStream ss;
+ ss.print("DelayedValue="INTPTR_FORMAT, delayed_value_addr[1]);
+ buf = code_string(ss.as_string());
+ }
jcc(Assembler::notZero, L);
- char* buf = new char[40];
- sprintf(buf, "DelayedValue="INTPTR_FORMAT, delayed_value_addr[1]);
STOP(buf);
} else {
jccb(Assembler::notZero, L);
@@ -4343,9 +4353,13 @@
// Address adjust(addr.base(), addr.index(), addr.scale(), addr.disp() + BytesPerWord);
// Pass register number to verify_oop_subroutine
- char* b = new char[strlen(s) + 50];
- sprintf(b, "verify_oop_addr: %s", s);
-
+ const char* b = NULL;
+ {
+ ResourceMark rm;
+ stringStream ss;
+ ss.print("verify_oop_addr: %s", s);
+ b = code_string(ss.as_string());
+ }
#ifdef _LP64
push(rscratch1); // save r10, trashed by movptr()
#endif
--- a/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/cpu/x86/vm/relocInfo_x86.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -145,12 +145,9 @@
assert(which == Assembler::disp32_operand ||
which == Assembler::call32_operand ||
which == Assembler::imm_operand, "format unpacks ok");
- if (which != Assembler::imm_operand) {
- // The "address" in the code is a displacement can't return it as
- // and address* since it is really a jint*
- ShouldNotReachHere();
- return NULL;
- }
+ // The "address" in the code is a displacement can't return it as
+ // and address* since it is really a jint*
+ guarantee(which == Assembler::imm_operand, "must be immediate operand");
#else
assert(which == Assembler::disp32_operand || which == Assembler::imm_operand, "format unpacks ok");
#endif // AMD64
--- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -340,7 +340,7 @@
// here if the underlying file has been truncated.
// Do not crash the VM in such a case.
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
- nmethod* nm = cb->is_nmethod() ? (nmethod*)cb : NULL;
+ nmethod* nm = (cb != NULL && cb->is_nmethod()) ? (nmethod*)cb : NULL;
if (nm != NULL && nm->has_unsafe_access()) {
stub = StubRoutines::handler_for_unsafe_access();
}
--- a/hotspot/src/share/vm/asm/assembler.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/asm/assembler.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -284,15 +284,19 @@
DelayedConstant::update_all();
}
-
-
-
void AbstractAssembler::block_comment(const char* comment) {
if (sect() == CodeBuffer::SECT_INSTS) {
code_section()->outer()->block_comment(offset(), comment);
}
}
+const char* AbstractAssembler::code_string(const char* str) {
+ if (sect() == CodeBuffer::SECT_INSTS || sect() == CodeBuffer::SECT_STUBS) {
+ return code_section()->outer()->code_string(str);
+ }
+ return NULL;
+}
+
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
// Exception handler checks the nmethod's implicit null checks table
// only when this method returns false.
--- a/hotspot/src/share/vm/asm/assembler.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/asm/assembler.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -336,6 +336,8 @@
// along with the disassembly when printing nmethods. Currently
// only supported in the instruction section of the code buffer.
void block_comment(const char* comment);
+ // Copy str to a buffer that has the same lifetime as the CodeBuffer
+ const char* code_string(const char* str);
// Label functions
void bind(Label& L); // binds an unbound label L to the current code position
--- a/hotspot/src/share/vm/asm/codeBuffer.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -703,8 +703,8 @@
this->compute_final_layout(&dest);
relocate_code_to(&dest);
- // transfer comments from buffer to blob
- dest_blob->set_comments(_comments);
+ // transfer strings and comments from buffer to blob
+ dest_blob->set_strings(_strings);
// Done moving code bytes; were they the right size?
assert(round_to(dest.total_content_size(), oopSize) == dest_blob->content_size(), "sanity");
@@ -1003,58 +1003,78 @@
void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
- _comments.add_comment(offset, comment);
+ _strings.add_comment(offset, comment);
+}
+
+const char* CodeBuffer::code_string(const char* str) {
+ return _strings.add_string(str);
}
-class CodeComment: public CHeapObj<mtCode> {
+class CodeString: public CHeapObj<mtCode> {
private:
- friend class CodeComments;
+ friend class CodeStrings;
+ const char * _string;
+ CodeString* _next;
intptr_t _offset;
- const char * _comment;
- CodeComment* _next;
- ~CodeComment() {
+ ~CodeString() {
assert(_next == NULL, "wrong interface for freeing list");
- os::free((void*)_comment, mtCode);
- }
-
- public:
- CodeComment(intptr_t offset, const char * comment) {
- _offset = offset;
- _comment = os::strdup(comment, mtCode);
- _next = NULL;
+ os::free((void*)_string, mtCode);
}
- intptr_t offset() const { return _offset; }
- const char * comment() const { return _comment; }
- CodeComment* next() { return _next; }
-
- void set_next(CodeComment* next) { _next = next; }
+ bool is_comment() const { return _offset >= 0; }
- CodeComment* find(intptr_t offset) {
- CodeComment* a = this;
- while (a != NULL && a->_offset != offset) {
- a = a->_next;
- }
- return a;
+ public:
+ CodeString(const char * string, intptr_t offset = -1)
+ : _next(NULL), _offset(offset) {
+ _string = os::strdup(string, mtCode);
}
- // Convenience for add_comment.
- CodeComment* find_last(intptr_t offset) {
- CodeComment* a = find(offset);
- if (a != NULL) {
- while ((a->_next != NULL) && (a->_next->_offset == offset)) {
- a = a->_next;
- }
+ const char * string() const { return _string; }
+ intptr_t offset() const { assert(_offset >= 0, "offset for non comment?"); return _offset; }
+ CodeString* next() const { return _next; }
+
+ void set_next(CodeString* next) { _next = next; }
+
+ CodeString* first_comment() {
+ if (is_comment()) {
+ return this;
+ } else {
+ return next_comment();
}
- return a;
+ }
+ CodeString* next_comment() const {
+ CodeString* s = _next;
+ while (s != NULL && !s->is_comment()) {
+ s = s->_next;
+ }
+ return s;
}
};
+CodeString* CodeStrings::find(intptr_t offset) const {
+ CodeString* a = _strings->first_comment();
+ while (a != NULL && a->offset() != offset) {
+ a = a->next_comment();
+ }
+ return a;
+}
-void CodeComments::add_comment(intptr_t offset, const char * comment) {
- CodeComment* c = new CodeComment(offset, comment);
- CodeComment* inspos = (_comments == NULL) ? NULL : _comments->find_last(offset);
+// Convenience for add_comment.
+CodeString* CodeStrings::find_last(intptr_t offset) const {
+ CodeString* a = find(offset);
+ if (a != NULL) {
+ CodeString* c = NULL;
+ while (((c = a->next_comment()) != NULL) && (c->offset() == offset)) {
+ a = c;
+ }
+ }
+ return a;
+}
+
+void CodeStrings::add_comment(intptr_t offset, const char * comment) {
+ CodeString* c = new CodeString(comment, offset);
+ CodeString* inspos = (_strings == NULL) ? NULL : find_last(offset);
if (inspos) {
// insert after already existing comments with same offset
@@ -1062,43 +1082,47 @@
inspos->set_next(c);
} else {
// no comments with such offset, yet. Insert before anything else.
- c->set_next(_comments);
- _comments = c;
+ c->set_next(_strings);
+ _strings = c;
}
}
-
-void CodeComments::assign(CodeComments& other) {
- _comments = other._comments;
+void CodeStrings::assign(CodeStrings& other) {
+ _strings = other._strings;
}
-
-void CodeComments::print_block_comment(outputStream* stream, intptr_t offset) const {
- if (_comments != NULL) {
- CodeComment* c = _comments->find(offset);
+void CodeStrings::print_block_comment(outputStream* stream, intptr_t offset) const {
+ if (_strings != NULL) {
+ CodeString* c = find(offset);
while (c && c->offset() == offset) {
stream->bol();
stream->print(" ;; ");
- stream->print_cr(c->comment());
- c = c->next();
+ stream->print_cr(c->string());
+ c = c->next_comment();
}
}
}
-void CodeComments::free() {
- CodeComment* n = _comments;
+void CodeStrings::free() {
+ CodeString* n = _strings;
while (n) {
// unlink the node from the list saving a pointer to the next
- CodeComment* p = n->_next;
- n->_next = NULL;
+ CodeString* p = n->next();
+ n->set_next(NULL);
delete n;
n = p;
}
- _comments = NULL;
+ _strings = NULL;
}
-
+const char* CodeStrings::add_string(const char * string) {
+ CodeString* s = new CodeString(string);
+ s->set_next(_strings);
+ _strings = s;
+ assert(s->string() != NULL, "should have a string");
+ return s->string();
+}
void CodeBuffer::decode() {
ttyLocker ttyl;
--- a/hotspot/src/share/vm/asm/codeBuffer.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/asm/codeBuffer.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -28,7 +28,7 @@
#include "code/oopRecorder.hpp"
#include "code/relocInfo.hpp"
-class CodeComments;
+class CodeStrings;
class PhaseCFG;
class Compile;
class BufferBlob;
@@ -240,27 +240,31 @@
#endif //PRODUCT
};
-class CodeComment;
-class CodeComments VALUE_OBJ_CLASS_SPEC {
+class CodeString;
+class CodeStrings VALUE_OBJ_CLASS_SPEC {
private:
#ifndef PRODUCT
- CodeComment* _comments;
+ CodeString* _strings;
#endif
+ CodeString* find(intptr_t offset) const;
+ CodeString* find_last(intptr_t offset) const;
+
public:
- CodeComments() {
+ CodeStrings() {
#ifndef PRODUCT
- _comments = NULL;
+ _strings = NULL;
#endif
}
+ const char* add_string(const char * string) PRODUCT_RETURN_(return NULL;);
+
void add_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
void print_block_comment(outputStream* stream, intptr_t offset) const PRODUCT_RETURN;
- void assign(CodeComments& other) PRODUCT_RETURN;
+ void assign(CodeStrings& other) PRODUCT_RETURN;
void free() PRODUCT_RETURN;
};
-
// A CodeBuffer describes a memory space into which assembly
// code is generated. This memory space usually occupies the
// interior of a single BufferBlob, but in some cases it may be
@@ -326,7 +330,7 @@
csize_t _total_size; // size in bytes of combined memory buffer
OopRecorder* _oop_recorder;
- CodeComments _comments;
+ CodeStrings _strings;
OopRecorder _default_oop_recorder; // override with initialize_oop_recorder
Arena* _overflow_arena;
@@ -527,7 +531,7 @@
void initialize_oop_recorder(OopRecorder* r);
OopRecorder* oop_recorder() const { return _oop_recorder; }
- CodeComments& comments() { return _comments; }
+ CodeStrings& strings() { return _strings; }
// Code generation
void relocate(address at, RelocationHolder const& rspec, int format = 0) {
@@ -556,6 +560,7 @@
address transform_address(const CodeBuffer &cb, address addr) const;
void block_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
+ const char* code_string(const char* str) PRODUCT_RETURN_(return NULL;);
// Log a little info about section usage in the CodeBuffer
void log_section_sizes(const char* name);
--- a/hotspot/src/share/vm/ci/ciEnv.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -802,6 +802,7 @@
// require checks to make sure the expected type was found. Given that this
// only occurs for clone() the more extensive fix seems like overkill so
// instead we simply smear the array type into Object.
+ guarantee(method_holder != NULL, "no method holder");
if (method_holder->is_instance_klass()) {
return method_holder->as_instance_klass();
} else if (method_holder->is_array_klass()) {
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -348,7 +348,7 @@
void disqualify_method(Method* method) {
int* index = _member_index.get(method);
- assert(index != NULL && *index >= 0 && *index < _members.length(), "bad index");
+ guarantee(index != NULL && *index >= 0 && *index < _members.length(), "bad index");
_members.at(*index).second = DISQUALIFIED;
}
--- a/hotspot/src/share/vm/code/codeBlob.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/code/codeBlob.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -186,7 +186,7 @@
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps, mtCode);
_oop_maps = NULL;
}
- _comments.free();
+ _strings.free();
}
--- a/hotspot/src/share/vm/code/codeBlob.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/code/codeBlob.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -66,7 +66,7 @@
int _data_offset; // offset to where data region begins
int _frame_size; // size of stack frame
OopMapSet* _oop_maps; // OopMap for this CodeBlob
- CodeComments _comments;
+ CodeStrings _strings;
public:
// Returns the space needed for CodeBlob
@@ -186,12 +186,12 @@
// Print the comment associated with offset on stream, if there is one
virtual void print_block_comment(outputStream* stream, address block_begin) const {
intptr_t offset = (intptr_t)(block_begin - code_begin());
- _comments.print_block_comment(stream, offset);
+ _strings.print_block_comment(stream, offset);
}
// Transfer ownership of comments to this CodeBlob
- void set_comments(CodeComments& comments) {
- _comments.assign(comments);
+ void set_strings(CodeStrings& strings) {
+ _strings.assign(strings);
}
};
--- a/hotspot/src/share/vm/code/compiledIC.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/code/compiledIC.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -552,7 +552,7 @@
void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry) {
address stub=find_stub();
- assert(stub!=NULL, "stub not found");
+ guarantee(stub != NULL, "stub not found");
if (TraceICs) {
ResourceMark rm;
--- a/hotspot/src/share/vm/code/icBuffer.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/code/icBuffer.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -50,7 +50,7 @@
friend class ICStubInterface;
// This will be called only by ICStubInterface
void initialize(int size,
- CodeComments comments) { _size = size; _ic_site = NULL; }
+ CodeStrings strings) { _size = size; _ic_site = NULL; }
void finalize(); // called when a method is removed
// General info
--- a/hotspot/src/share/vm/code/stubs.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/code/stubs.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -101,8 +101,8 @@
Stub* StubQueue::request_committed(int code_size) {
Stub* s = request(code_size);
- CodeComments comments;
- if (s != NULL) commit(code_size, comments);
+ CodeStrings strings;
+ if (s != NULL) commit(code_size, strings);
return s;
}
@@ -119,8 +119,8 @@
assert(_buffer_limit == _buffer_size, "buffer must be fully usable");
if (_queue_end + requested_size <= _buffer_size) {
// code fits in at the end => nothing to do
- CodeComments comments;
- stub_initialize(s, requested_size, comments);
+ CodeStrings strings;
+ stub_initialize(s, requested_size, strings);
return s;
} else {
// stub doesn't fit in at the queue end
@@ -137,8 +137,8 @@
// Queue: |XXX|.......|XXXXXXX|.......|
// ^0 ^end ^begin ^limit ^size
s = current_stub();
- CodeComments comments;
- stub_initialize(s, requested_size, comments);
+ CodeStrings strings;
+ stub_initialize(s, requested_size, strings);
return s;
}
// Not enough space left
@@ -147,12 +147,12 @@
}
-void StubQueue::commit(int committed_code_size, CodeComments& comments) {
+void StubQueue::commit(int committed_code_size, CodeStrings& strings) {
assert(committed_code_size > 0, "committed_code_size must be > 0");
int committed_size = round_to(stub_code_size_to_size(committed_code_size), CodeEntryAlignment);
Stub* s = current_stub();
assert(committed_size <= stub_size(s), "committed size must not exceed requested size");
- stub_initialize(s, committed_size, comments);
+ stub_initialize(s, committed_size, strings);
_queue_end += committed_size;
_number_of_stubs++;
if (_mutex != NULL) _mutex->unlock();
--- a/hotspot/src/share/vm/code/stubs.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/code/stubs.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -73,7 +73,7 @@
public:
// Initialization/finalization
void initialize(int size,
- CodeComments& comments) { ShouldNotCallThis(); } // called to initialize/specify the stub's size
+ CodeStrings& strings) { ShouldNotCallThis(); } // called to initialize/specify the stub's size
void finalize() { ShouldNotCallThis(); } // called before the stub is deallocated
// General info/converters
@@ -107,7 +107,7 @@
public:
// Initialization/finalization
virtual void initialize(Stub* self, int size,
- CodeComments& comments) = 0; // called after creation (called twice if allocated via (request, commit))
+ CodeStrings& strings) = 0; // called after creation (called twice if allocated via (request, commit))
virtual void finalize(Stub* self) = 0; // called before deallocation
// General info/converters
@@ -136,7 +136,7 @@
public: \
/* Initialization/finalization */ \
virtual void initialize(Stub* self, int size, \
- CodeComments& comments) { cast(self)->initialize(size, comments); } \
+ CodeStrings& strings) { cast(self)->initialize(size, strings); } \
virtual void finalize(Stub* self) { cast(self)->finalize(); } \
\
/* General info */ \
@@ -176,7 +176,7 @@
// Stub functionality accessed via interface
void stub_initialize(Stub* s, int size,
- CodeComments& comments) { assert(size % CodeEntryAlignment == 0, "size not aligned"); _stub_interface->initialize(s, size, comments); }
+ CodeStrings& strings) { assert(size % CodeEntryAlignment == 0, "size not aligned"); _stub_interface->initialize(s, size, strings); }
void stub_finalize(Stub* s) { _stub_interface->finalize(s); }
int stub_size(Stub* s) const { return _stub_interface->size(s); }
bool stub_contains(Stub* s, address pc) const { return _stub_interface->code_begin(s) <= pc && pc < _stub_interface->code_end(s); }
@@ -206,7 +206,7 @@
Stub* request_committed(int code_size); // request a stub that provides exactly code_size space for code
Stub* request(int requested_code_size); // request a stub with a (maximum) code space - locks the queue
void commit (int committed_code_size,
- CodeComments& comments); // commit the previously requested stub - unlocks the queue
+ CodeStrings& strings); // commit the previously requested stub - unlocks the queue
// Stub deallocation
void remove_first(); // remove the first stub in the queue
--- a/hotspot/src/share/vm/compiler/compileBroker.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/compiler/compileBroker.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -65,9 +65,8 @@
HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t, bool);
-#define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method) \
+#define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method, comp_name) \
{ \
- char* comp_name = (char*)(compiler)->name(); \
Symbol* klass_name = (method)->klass_name(); \
Symbol* name = (method)->name(); \
Symbol* signature = (method)->signature(); \
@@ -78,9 +77,9 @@
signature->bytes(), signature->utf8_length()); \
}
-#define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, success) \
+#define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, \
+ comp_name, success) \
{ \
- char* comp_name = (char*)(compiler)->name(); \
Symbol* klass_name = (method)->klass_name(); \
Symbol* name = (method)->name(); \
Symbol* signature = (method)->signature(); \
@@ -93,22 +92,21 @@
#else /* USDT2 */
-#define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method) \
+#define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method, comp_name) \
{ \
- char* comp_name = (char*)(compiler)->name(); \
Symbol* klass_name = (method)->klass_name(); \
Symbol* name = (method)->name(); \
Symbol* signature = (method)->signature(); \
- HOTSPOT_METHOD_COMPILE_BEGIN( \
+ HOTSPOT_METHOD_COMPILE_BEGIN( \
comp_name, strlen(comp_name), \
- (char *) klass_name->bytes(), klass_name->utf8_length(), \
+ (char *) klass_name->bytes(), klass_name->utf8_length(), \
(char *) name->bytes(), name->utf8_length(), \
(char *) signature->bytes(), signature->utf8_length()); \
}
-#define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, success) \
+#define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, \
+ comp_name, success) \
{ \
- char* comp_name = (char*)(compiler)->name(); \
Symbol* klass_name = (method)->klass_name(); \
Symbol* name = (method)->name(); \
Symbol* signature = (method)->signature(); \
@@ -122,8 +120,8 @@
#else // ndef DTRACE_ENABLED
-#define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method)
-#define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, success)
+#define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method, comp_name)
+#define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, comp_name, success)
#endif // ndef DTRACE_ENABLED
@@ -359,7 +357,7 @@
//
void CompileTask::print_line_on_error(outputStream* st, char* buf, int buflen) {
// print compiler name
- st->print("%s:", CompileBroker::compiler(comp_level())->name());
+ st->print("%s:", CompileBroker::compiler_name(comp_level()));
print_compilation(st);
}
@@ -368,7 +366,7 @@
void CompileTask::print_line() {
ttyLocker ttyl; // keep the following output all in one block
// print compiler name if requested
- if (CIPrintCompilerName) tty->print("%s:", CompileBroker::compiler(comp_level())->name());
+ if (CIPrintCompilerName) tty->print("%s:", CompileBroker::compiler_name(comp_level()));
print_compilation();
}
@@ -1217,8 +1215,9 @@
// lock, make sure that the compilation
// isn't prohibited in a straightforward way.
-
- if (compiler(comp_level) == NULL || !compiler(comp_level)->can_compile_method(method) || compilation_is_prohibited(method, osr_bci, comp_level)) {
+ AbstractCompiler *comp = CompileBroker::compiler(comp_level);
+ if (comp == NULL || !comp->can_compile_method(method) ||
+ compilation_is_prohibited(method, osr_bci, comp_level)) {
return NULL;
}
@@ -1255,7 +1254,7 @@
assert(!HAS_PENDING_EXCEPTION, "No exception should be present");
// some prerequisites that are compiler specific
- if (compiler(comp_level)->is_c2() || compiler(comp_level)->is_shark()) {
+ if (comp->is_c2() || comp->is_shark()) {
method->constants()->resolve_string_constants(CHECK_AND_CLEAR_NULL);
// Resolve all classes seen in the signature of the method
// we are compiling.
@@ -1372,8 +1371,9 @@
bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level) {
bool is_native = method->is_native();
// Some compilers may not support the compilation of natives.
+ AbstractCompiler *comp = compiler(comp_level);
if (is_native &&
- (!CICompileNatives || !compiler(comp_level)->supports_native())) {
+ (!CICompileNatives || comp == NULL || !comp->supports_native())) {
method->set_not_compilable_quietly(comp_level);
return true;
}
@@ -1381,7 +1381,7 @@
bool is_osr = (osr_bci != standard_entry_bci);
// Some compilers may not support on stack replacement.
if (is_osr &&
- (!CICompileOSR || !compiler(comp_level)->supports_osr())) {
+ (!CICompileOSR || comp == NULL || !comp->supports_osr())) {
method->set_not_osr_compilable(comp_level);
return true;
}
@@ -1753,6 +1753,7 @@
bool is_osr = (osr_bci != standard_entry_bci);
bool should_log = (thread->log() != NULL);
bool should_break = false;
+ int task_level = task->comp_level();
{
// create the handle inside it's own block so it can't
// accidentally be referenced once the thread transitions to
@@ -1766,9 +1767,10 @@
assert(!method->is_native(), "no longer compile natives");
// Save information about this method in case of failure.
- set_last_compile(thread, method, is_osr, task->comp_level());
+ set_last_compile(thread, method, is_osr, task_level);
- DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler(task->comp_level()), method);
+ DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler(task_level), method,
+ compiler_name(task_level));
}
// Allocate a new set of JNI handles.
@@ -1805,7 +1807,12 @@
TraceTime t1("compilation", &time);
- compiler(task->comp_level())->compile_method(&ci_env, target, osr_bci);
+ AbstractCompiler *comp = compiler(task_level);
+ if (comp == NULL) {
+ ci_env.record_method_not_compilable("no compiler", !TieredCompilation);
+ } else {
+ comp->compile_method(&ci_env, target, osr_bci);
+ }
if (!ci_env.failing() && task->code() == NULL) {
//assert(false, "compiler should always document failure");
@@ -1843,7 +1850,8 @@
methodHandle method(thread, task->method());
- DTRACE_METHOD_COMPILE_END_PROBE(compiler(task->comp_level()), method, task->is_success());
+ DTRACE_METHOD_COMPILE_END_PROBE(compiler(task_level), method,
+ compiler_name(task_level), task->is_success());
collect_statistics(thread, time, task);
@@ -1868,9 +1876,9 @@
break;
case ciEnv::MethodCompilable_not_at_tier:
if (is_osr)
- method->set_not_osr_compilable_quietly(task->comp_level());
+ method->set_not_osr_compilable_quietly(task_level);
else
- method->set_not_compilable_quietly(task->comp_level());
+ method->set_not_compilable_quietly(task_level);
break;
}
@@ -2128,7 +2136,14 @@
if (UsePerfData) counters->set_current_method("");
}
-
+const char* CompileBroker::compiler_name(int comp_level) {
+ AbstractCompiler *comp = CompileBroker::compiler(comp_level);
+ if (comp == NULL) {
+ return "no compiler";
+ } else {
+ return (comp->name());
+ }
+}
void CompileBroker::print_times() {
tty->cr();
@@ -2142,11 +2157,13 @@
CompileBroker::_t_standard_compilation.seconds() / CompileBroker::_total_standard_compile_count);
tty->print_cr(" On stack replacement : %6.3f s, Average : %2.3f", CompileBroker::_t_osr_compilation.seconds(), CompileBroker::_t_osr_compilation.seconds() / CompileBroker::_total_osr_compile_count);
- if (compiler(CompLevel_simple) != NULL) {
- compiler(CompLevel_simple)->print_timers();
+ AbstractCompiler *comp = compiler(CompLevel_simple);
+ if (comp != NULL) {
+ comp->print_timers();
}
- if (compiler(CompLevel_full_optimization) != NULL) {
- compiler(CompLevel_full_optimization)->print_timers();
+ comp = compiler(CompLevel_full_optimization);
+ if (comp != NULL) {
+ comp->print_timers();
}
tty->cr();
int tcb = CompileBroker::_sum_osr_bytes_compiled + CompileBroker::_sum_standard_bytes_compiled;
--- a/hotspot/src/share/vm/compiler/compileBroker.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/compiler/compileBroker.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -418,6 +418,9 @@
static void print_last_compile();
static void print_compiler_threads_on(outputStream* st);
+
+ // compiler name for debugging
+ static const char* compiler_name(int comp_level);
};
#endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP
--- a/hotspot/src/share/vm/compiler/disassembler.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/compiler/disassembler.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -158,7 +158,7 @@
private:
nmethod* _nm;
CodeBlob* _code;
- CodeComments _comments;
+ CodeStrings _strings;
outputStream* _output;
address _start, _end;
@@ -198,7 +198,7 @@
void print_address(address value);
public:
- decode_env(CodeBlob* code, outputStream* output, CodeComments c = CodeComments());
+ decode_env(CodeBlob* code, outputStream* output, CodeStrings c = CodeStrings());
address decode_instructions(address start, address end);
@@ -242,13 +242,13 @@
const char* options() { return _option_buf; }
};
-decode_env::decode_env(CodeBlob* code, outputStream* output, CodeComments c) {
+decode_env::decode_env(CodeBlob* code, outputStream* output, CodeStrings c) {
memset(this, 0, sizeof(*this));
_output = output ? output : tty;
_code = code;
if (code != NULL && code->is_nmethod())
_nm = (nmethod*) code;
- _comments.assign(c);
+ _strings.assign(c);
// by default, output pc but not bytes:
_print_pc = true;
@@ -370,7 +370,7 @@
if (cb != NULL) {
cb->print_block_comment(st, p);
}
- _comments.print_block_comment(st, (intptr_t)(p - _start));
+ _strings.print_block_comment(st, (intptr_t)(p - _start));
if (_print_pc) {
st->print(" " PTR_FORMAT ": ", p);
}
@@ -498,7 +498,7 @@
env.decode_instructions(cb->code_begin(), cb->code_end());
}
-void Disassembler::decode(address start, address end, outputStream* st, CodeComments c) {
+void Disassembler::decode(address start, address end, outputStream* st, CodeStrings c) {
if (!load_library()) return;
decode_env env(CodeCache::find_blob_unsafe(start), st, c);
env.decode_instructions(start, end);
--- a/hotspot/src/share/vm/compiler/disassembler.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/compiler/disassembler.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -100,7 +100,7 @@
}
static void decode(CodeBlob *cb, outputStream* st = NULL);
static void decode(nmethod* nm, outputStream* st = NULL);
- static void decode(address begin, address end, outputStream* st = NULL, CodeComments c = CodeComments());
+ static void decode(address begin, address end, outputStream* st = NULL, CodeStrings c = CodeStrings());
};
#endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -6068,6 +6068,10 @@
verify_work_stacks_empty();
verify_overflow_empty();
+ if (should_unload_classes()) {
+ ClassLoaderDataGraph::purge();
+ }
+
_intra_sweep_timer.stop();
_intra_sweep_estimate.sample(_intra_sweep_timer.seconds());
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -784,7 +784,7 @@
}
}
-void ConcurrentMark::set_phase(uint active_tasks, bool concurrent) {
+void ConcurrentMark::set_concurrency(uint active_tasks) {
assert(active_tasks <= _max_worker_id, "we should not have more");
_active_tasks = active_tasks;
@@ -793,6 +793,10 @@
_terminator = ParallelTaskTerminator((int) active_tasks, _task_queues);
_first_overflow_barrier_sync.set_n_workers((int) active_tasks);
_second_overflow_barrier_sync.set_n_workers((int) active_tasks);
+}
+
+void ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) {
+ set_concurrency(active_tasks);
_concurrent = concurrent;
// We propagate this to all tasks, not just the active ones.
@@ -806,7 +810,9 @@
// false before we start remark. At this point we should also be
// in a STW phase.
assert(!concurrent_marking_in_progress(), "invariant");
- assert(_finger == _heap_end, "only way to get here");
+ assert(_finger == _heap_end,
+ err_msg("only way to get here: _finger: "PTR_FORMAT", _heap_end: "PTR_FORMAT,
+ _finger, _heap_end));
update_g1_committed(true);
}
}
@@ -974,20 +980,28 @@
gclog_or_tty->print_cr("[%u] leaving first barrier", worker_id);
}
- // let the task associated with with worker 0 do this
- if (worker_id == 0) {
- // task 0 is responsible for clearing the global data structures
- // We should be here because of an overflow. During STW we should
- // not clear the overflow flag since we rely on it being true when
- // we exit this method to abort the pause and restart concurent
- // marking.
- reset_marking_state(concurrent() /* clear_overflow */);
- force_overflow()->update();
-
- if (G1Log::fine()) {
- gclog_or_tty->date_stamp(PrintGCDateStamps);
- gclog_or_tty->stamp(PrintGCTimeStamps);
- gclog_or_tty->print_cr("[GC concurrent-mark-reset-for-overflow]");
+ // If we're executing the concurrent phase of marking, reset the marking
+ // state; otherwise the marking state is reset after reference processing,
+ // during the remark pause.
+ // If we reset here as a result of an overflow during the remark we will
+ // see assertion failures from any subsequent set_concurrency_and_phase()
+ // calls.
+ if (concurrent()) {
+ // let the task associated with with worker 0 do this
+ if (worker_id == 0) {
+ // task 0 is responsible for clearing the global data structures
+ // We should be here because of an overflow. During STW we should
+ // not clear the overflow flag since we rely on it being true when
+ // we exit this method to abort the pause and restart concurent
+ // marking.
+ reset_marking_state(true /* clear_overflow */);
+ force_overflow()->update();
+
+ if (G1Log::fine()) {
+ gclog_or_tty->date_stamp(PrintGCDateStamps);
+ gclog_or_tty->stamp(PrintGCTimeStamps);
+ gclog_or_tty->print_cr("[GC concurrent-mark-reset-for-overflow]");
+ }
}
}
@@ -1007,7 +1021,7 @@
if (concurrent()) {
ConcurrentGCThread::stsJoin();
}
- // at this point everything should be re-initialised and ready to go
+ // at this point everything should be re-initialized and ready to go
if (verbose_low()) {
gclog_or_tty->print_cr("[%u] leaving second barrier", worker_id);
@@ -1065,8 +1079,8 @@
double mark_step_duration_ms = G1ConcMarkStepDurationMillis;
the_task->do_marking_step(mark_step_duration_ms,
- true /* do_stealing */,
- true /* do_termination */);
+ true /* do_termination */,
+ false /* is_serial*/);
double end_time_sec = os::elapsedTime();
double end_vtime_sec = os::elapsedVTime();
@@ -1222,8 +1236,8 @@
uint active_workers = MAX2(1U, parallel_marking_threads());
- // Parallel task terminator is set in "set_phase()"
- set_phase(active_workers, true /* concurrent */);
+ // Parallel task terminator is set in "set_concurrency_and_phase()"
+ set_concurrency_and_phase(active_workers, true /* concurrent */);
CMConcurrentMarkingTask markingTask(this, cmThread());
if (use_parallel_marking_threads()) {
@@ -1275,12 +1289,22 @@
if (has_overflown()) {
// Oops. We overflowed. Restart concurrent marking.
_restart_for_overflow = true;
+ if (G1TraceMarkStackOverflow) {
+ gclog_or_tty->print_cr("\nRemark led to restart for overflow.");
+ }
+
+ // Verify the heap w.r.t. the previous marking bitmap.
+ if (VerifyDuringGC) {
+ HandleMark hm; // handle scope
+ gclog_or_tty->print(" VerifyDuringGC:(overflow)");
+ Universe::heap()->prepare_for_verify();
+ Universe::verify(/* silent */ false,
+ /* option */ VerifyOption_G1UsePrevMarking);
+ }
+
// Clear the marking state because we will be restarting
// marking due to overflowing the global mark stack.
reset_marking_state();
- if (G1TraceMarkStackOverflow) {
- gclog_or_tty->print_cr("\nRemark led to restart for overflow.");
- }
} else {
// Aggregate the per-task counting data that we have accumulated
// while marking.
@@ -2184,14 +2208,17 @@
// operating on the global stack.
class G1CMKeepAliveAndDrainClosure: public OopClosure {
- ConcurrentMark* _cm;
- CMTask* _task;
- int _ref_counter_limit;
- int _ref_counter;
+ ConcurrentMark* _cm;
+ CMTask* _task;
+ int _ref_counter_limit;
+ int _ref_counter;
+ bool _is_serial;
public:
- G1CMKeepAliveAndDrainClosure(ConcurrentMark* cm, CMTask* task) :
- _cm(cm), _task(task), _ref_counter_limit(G1RefProcDrainInterval) {
+ G1CMKeepAliveAndDrainClosure(ConcurrentMark* cm, CMTask* task, bool is_serial) :
+ _cm(cm), _task(task), _is_serial(is_serial),
+ _ref_counter_limit(G1RefProcDrainInterval) {
assert(_ref_counter_limit > 0, "sanity");
+ assert(!_is_serial || _task->worker_id() == 0, "only task 0 for serial code");
_ref_counter = _ref_counter_limit;
}
@@ -2230,8 +2257,8 @@
do {
double mark_step_duration_ms = G1ConcMarkStepDurationMillis;
_task->do_marking_step(mark_step_duration_ms,
- false /* do_stealing */,
- false /* do_termination */);
+ false /* do_termination */,
+ _is_serial);
} while (_task->has_aborted() && !_cm->has_overflown());
_ref_counter = _ref_counter_limit;
}
@@ -2253,27 +2280,18 @@
class G1CMDrainMarkingStackClosure: public VoidClosure {
ConcurrentMark* _cm;
CMTask* _task;
- bool _do_stealing;
- bool _do_termination;
+ bool _is_serial;
public:
- G1CMDrainMarkingStackClosure(ConcurrentMark* cm, CMTask* task, bool is_par) :
- _cm(cm), _task(task) {
- assert(is_par || _task->worker_id() == 0,
- "Only task for worker 0 should be used if ref processing is single threaded");
- // We only allow stealing and only enter the termination protocol
- // in CMTask::do_marking_step() if this closure is being instantiated
- // for parallel reference processing.
- _do_stealing = _do_termination = is_par;
+ G1CMDrainMarkingStackClosure(ConcurrentMark* cm, CMTask* task, bool is_serial) :
+ _cm(cm), _task(task), _is_serial(is_serial) {
+ assert(!_is_serial || _task->worker_id() == 0, "only task 0 for serial code");
}
void do_void() {
do {
if (_cm->verbose_high()) {
- gclog_or_tty->print_cr("\t[%u] Drain: Calling do_marking_step - "
- "stealing: %s, termination: %s",
- _task->worker_id(),
- BOOL_TO_STR(_do_stealing),
- BOOL_TO_STR(_do_termination));
+ gclog_or_tty->print_cr("\t[%u] Drain: Calling do_marking_step - serial: %s",
+ _task->worker_id(), BOOL_TO_STR(_is_serial));
}
// We call CMTask::do_marking_step() to completely drain the local
@@ -2294,8 +2312,8 @@
// has_aborted() flag that the marking step has completed.
_task->do_marking_step(1000000000.0 /* something very large */,
- _do_stealing,
- _do_termination);
+ true /* do_termination */,
+ _is_serial);
} while (_task->has_aborted() && !_cm->has_overflown());
}
};
@@ -2328,7 +2346,6 @@
ProcessTask& _proc_task;
G1CollectedHeap* _g1h;
ConcurrentMark* _cm;
- bool _processing_is_mt;
public:
G1CMRefProcTaskProxy(ProcessTask& proc_task,
@@ -2336,15 +2353,15 @@
ConcurrentMark* cm) :
AbstractGangTask("Process reference objects in parallel"),
_proc_task(proc_task), _g1h(g1h), _cm(cm) {
- ReferenceProcessor* rp = _g1h->ref_processor_cm();
- _processing_is_mt = rp->processing_is_mt();
- }
+ ReferenceProcessor* rp = _g1h->ref_processor_cm();
+ assert(rp->processing_is_mt(), "shouldn't be here otherwise");
+ }
virtual void work(uint worker_id) {
- CMTask* marking_task = _cm->task(worker_id);
+ CMTask* task = _cm->task(worker_id);
G1CMIsAliveClosure g1_is_alive(_g1h);
- G1CMKeepAliveAndDrainClosure g1_par_keep_alive(_cm, marking_task);
- G1CMDrainMarkingStackClosure g1_par_drain(_cm, marking_task, _processing_is_mt);
+ G1CMKeepAliveAndDrainClosure g1_par_keep_alive(_cm, task, false /* is_serial */);
+ G1CMDrainMarkingStackClosure g1_par_drain(_cm, task, false /* is_serial */);
_proc_task.work(worker_id, g1_is_alive, g1_par_keep_alive, g1_par_drain);
}
@@ -2356,9 +2373,11 @@
G1CMRefProcTaskProxy proc_task_proxy(proc_task, _g1h, _cm);
- // We need to reset the phase for each task execution so that
- // the termination protocol of CMTask::do_marking_step works.
- _cm->set_phase(_active_workers, false /* concurrent */);
+ // We need to reset the concurrency level before each
+ // proxy task execution, so that the termination protocol
+ // and overflow handling in CMTask::do_marking_step() knows
+ // how many workers to wait for.
+ _cm->set_concurrency(_active_workers);
_g1h->set_par_threads(_active_workers);
_workers->run_task(&proc_task_proxy);
_g1h->set_par_threads(0);
@@ -2384,12 +2403,29 @@
G1CMRefEnqueueTaskProxy enq_task_proxy(enq_task);
+ // Not strictly necessary but...
+ //
+ // We need to reset the concurrency level before each
+ // proxy task execution, so that the termination protocol
+ // and overflow handling in CMTask::do_marking_step() knows
+ // how many workers to wait for.
+ _cm->set_concurrency(_active_workers);
_g1h->set_par_threads(_active_workers);
_workers->run_task(&enq_task_proxy);
_g1h->set_par_threads(0);
}
void ConcurrentMark::weakRefsWork(bool clear_all_soft_refs) {
+ if (has_overflown()) {
+ // Skip processing the discovered references if we have
+ // overflown the global marking stack. Reference objects
+ // only get discovered once so it is OK to not
+ // de-populate the discovered reference lists. We could have,
+ // but the only benefit would be that, when marking restarts,
+ // less reference objects are discovered.
+ return;
+ }
+
ResourceMark rm;
HandleMark hm;
@@ -2415,26 +2451,39 @@
rp->setup_policy(clear_all_soft_refs);
assert(_markStack.isEmpty(), "mark stack should be empty");
- // Non-MT instances 'Keep Alive' and 'Complete GC' oop closures.
- G1CMKeepAliveAndDrainClosure g1_keep_alive(this, task(0));
- G1CMDrainMarkingStackClosure g1_drain_mark_stack(this, task(0), false);
-
- // We need at least one active thread. If reference processing is
- // not multi-threaded we use the current (ConcurrentMarkThread) thread,
- // otherwise we use the work gang from the G1CollectedHeap and we
- // utilize all the worker threads we can.
- uint active_workers = (rp->processing_is_mt() && g1h->workers() != NULL
- ? g1h->workers()->active_workers()
- : 1U);
-
+ // Instances of the 'Keep Alive' and 'Complete GC' closures used
+ // in serial reference processing. Note these closures are also
+ // used for serially processing (by the the current thread) the
+ // JNI references during parallel reference processing.
+ //
+ // These closures do not need to synchronize with the worker
+ // threads involved in parallel reference processing as these
+ // instances are executed serially by the current thread (e.g.
+ // reference processing is not multi-threaded and is thus
+ // performed by the current thread instead of a gang worker).
+ //
+ // The gang tasks involved in parallel reference procssing create
+ // their own instances of these closures, which do their own
+ // synchronization among themselves.
+ G1CMKeepAliveAndDrainClosure g1_keep_alive(this, task(0), true /* is_serial */);
+ G1CMDrainMarkingStackClosure g1_drain_mark_stack(this, task(0), true /* is_serial */);
+
+ // We need at least one active thread. If reference processing
+ // is not multi-threaded we use the current (VMThread) thread,
+ // otherwise we use the work gang from the G1CollectedHeap and
+ // we utilize all the worker threads we can.
+ bool processing_is_mt = rp->processing_is_mt() && g1h->workers() != NULL;
+ uint active_workers = (processing_is_mt ? g1h->workers()->active_workers() : 1U);
active_workers = MAX2(MIN2(active_workers, _max_worker_id), 1U);
+ // Parallel processing task executor.
G1CMRefProcTaskExecutor par_task_executor(g1h, this,
g1h->workers(), active_workers);
-
- AbstractRefProcTaskExecutor* executor = (rp->processing_is_mt()
- ? &par_task_executor
- : NULL);
+ AbstractRefProcTaskExecutor* executor = (processing_is_mt ? &par_task_executor : NULL);
+
+ // Set the concurrency level. The phase was already set prior to
+ // executing the remark task.
+ set_concurrency(active_workers);
// Set the degree of MT processing here. If the discovery was done MT,
// the number of threads involved during discovery could differ from
@@ -2454,6 +2503,7 @@
assert(_markStack.overflow() || _markStack.isEmpty(),
"mark stack should be empty (unless it overflowed)");
+
if (_markStack.overflow()) {
// This should have been done already when we tried to push an
// entry on to the global mark stack. But let's do it again.
@@ -2482,8 +2532,8 @@
class CMRemarkTask: public AbstractGangTask {
private:
- ConcurrentMark *_cm;
-
+ ConcurrentMark* _cm;
+ bool _is_serial;
public:
void work(uint worker_id) {
// Since all available tasks are actually started, we should
@@ -2493,8 +2543,8 @@
task->record_start_time();
do {
task->do_marking_step(1000000000.0 /* something very large */,
- true /* do_stealing */,
- true /* do_termination */);
+ true /* do_termination */,
+ _is_serial);
} while (task->has_aborted() && !_cm->has_overflown());
// If we overflow, then we do not want to restart. We instead
// want to abort remark and do concurrent marking again.
@@ -2502,8 +2552,8 @@
}
}
- CMRemarkTask(ConcurrentMark* cm, int active_workers) :
- AbstractGangTask("Par Remark"), _cm(cm) {
+ CMRemarkTask(ConcurrentMark* cm, int active_workers, bool is_serial) :
+ AbstractGangTask("Par Remark"), _cm(cm), _is_serial(is_serial) {
_cm->terminator()->reset_for_reuse(active_workers);
}
};
@@ -2524,30 +2574,40 @@
active_workers = (uint) ParallelGCThreads;
g1h->workers()->set_active_workers(active_workers);
}
- set_phase(active_workers, false /* concurrent */);
+ set_concurrency_and_phase(active_workers, false /* concurrent */);
// Leave _parallel_marking_threads at it's
// value originally calculated in the ConcurrentMark
// constructor and pass values of the active workers
// through the gang in the task.
- CMRemarkTask remarkTask(this, active_workers);
+ CMRemarkTask remarkTask(this, active_workers, false /* is_serial */);
+ // We will start all available threads, even if we decide that the
+ // active_workers will be fewer. The extra ones will just bail out
+ // immediately.
g1h->set_par_threads(active_workers);
g1h->workers()->run_task(&remarkTask);
g1h->set_par_threads(0);
} else {
G1CollectedHeap::StrongRootsScope srs(g1h);
- // this is remark, so we'll use up all available threads
uint active_workers = 1;
- set_phase(active_workers, false /* concurrent */);
-
- CMRemarkTask remarkTask(this, active_workers);
- // We will start all available threads, even if we decide that the
- // active_workers will be fewer. The extra ones will just bail out
- // immediately.
+ set_concurrency_and_phase(active_workers, false /* concurrent */);
+
+ // Note - if there's no work gang then the VMThread will be
+ // the thread to execute the remark - serially. We have
+ // to pass true for the is_serial parameter so that
+ // CMTask::do_marking_step() doesn't enter the sync
+ // barriers in the event of an overflow. Doing so will
+ // cause an assert that the current thread is not a
+ // concurrent GC thread.
+ CMRemarkTask remarkTask(this, active_workers, true /* is_serial*/);
remarkTask.work(0);
}
SATBMarkQueueSet& satb_mq_set = JavaThread::satb_mark_queue_set();
- guarantee(satb_mq_set.completed_buffers_num() == 0, "invariant");
+ guarantee(has_overflown() ||
+ satb_mq_set.completed_buffers_num() == 0,
+ err_msg("Invariant: has_overflown = %s, num buffers = %d",
+ BOOL_TO_STR(has_overflown()),
+ satb_mq_set.completed_buffers_num()));
print_stats();
}
@@ -3854,8 +3914,8 @@
/*****************************************************************************
- The do_marking_step(time_target_ms) method is the building block
- of the parallel marking framework. It can be called in parallel
+ The do_marking_step(time_target_ms, ...) method is the building
+ block of the parallel marking framework. It can be called in parallel
with other invocations of do_marking_step() on different tasks
(but only one per task, obviously) and concurrently with the
mutator threads, or during remark, hence it eliminates the need
@@ -3865,7 +3925,7 @@
pauses too, since do_marking_step() ensures that it aborts before
it needs to yield.
- The data structures that is uses to do marking work are the
+ The data structures that it uses to do marking work are the
following:
(1) Marking Bitmap. If there are gray objects that appear only
@@ -3914,7 +3974,7 @@
(2) When a global overflow (on the global stack) has been
triggered. Before the task aborts, it will actually sync up with
the other tasks to ensure that all the marking data structures
- (local queues, stacks, fingers etc.) are re-initialised so that
+ (local queues, stacks, fingers etc.) are re-initialized so that
when do_marking_step() completes, the marking phase can
immediately restart.
@@ -3951,11 +4011,25 @@
place, it was natural to piggy-back all the other conditions on it
too and not constantly check them throughout the code.
+ If do_termination is true then do_marking_step will enter its
+ termination protocol.
+
+ The value of is_serial must be true when do_marking_step is being
+ called serially (i.e. by the VMThread) and do_marking_step should
+ skip any synchronization in the termination and overflow code.
+ Examples include the serial remark code and the serial reference
+ processing closures.
+
+ The value of is_serial must be false when do_marking_step is
+ being called by any of the worker threads in a work gang.
+ Examples include the concurrent marking code (CMMarkingTask),
+ the MT remark code, and the MT reference processing closures.
+
*****************************************************************************/
void CMTask::do_marking_step(double time_target_ms,
- bool do_stealing,
- bool do_termination) {
+ bool do_termination,
+ bool is_serial) {
assert(time_target_ms >= 1.0, "minimum granularity is 1ms");
assert(concurrent() == _cm->concurrent(), "they should be the same");
@@ -3976,6 +4050,12 @@
_start_time_ms = os::elapsedVTime() * 1000.0;
statsOnly( _interval_start_time_ms = _start_time_ms );
+ // If do_stealing is true then do_marking_step will attempt to
+ // steal work from the other CMTasks. It only makes sense to
+ // enable stealing when the termination protocol is enabled
+ // and do_marking_step() is not being called serially.
+ bool do_stealing = do_termination && !is_serial;
+
double diff_prediction_ms =
g1_policy->get_new_prediction(&_marking_step_diffs_ms);
_time_target_ms = time_target_ms - diff_prediction_ms;
@@ -4237,10 +4317,12 @@
}
_termination_start_time_ms = os::elapsedVTime() * 1000.0;
+
// The CMTask class also extends the TerminatorTerminator class,
// hence its should_exit_termination() method will also decide
// whether to exit the termination protocol or not.
- bool finished = _cm->terminator()->offer_termination(this);
+ bool finished = (is_serial ||
+ _cm->terminator()->offer_termination(this));
double termination_end_time_ms = os::elapsedVTime() * 1000.0;
_termination_time_ms +=
termination_end_time_ms - _termination_start_time_ms;
@@ -4320,20 +4402,28 @@
gclog_or_tty->print_cr("[%u] detected overflow", _worker_id);
}
- _cm->enter_first_sync_barrier(_worker_id);
- // When we exit this sync barrier we know that all tasks have
- // stopped doing marking work. So, it's now safe to
- // re-initialise our data structures. At the end of this method,
- // task 0 will clear the global data structures.
+ if (!is_serial) {
+ // We only need to enter the sync barrier if being called
+ // from a parallel context
+ _cm->enter_first_sync_barrier(_worker_id);
+
+ // When we exit this sync barrier we know that all tasks have
+ // stopped doing marking work. So, it's now safe to
+ // re-initialise our data structures. At the end of this method,
+ // task 0 will clear the global data structures.
+ }
statsOnly( ++_aborted_overflow );
// We clear the local state of this task...
clear_region_fields();
- // ...and enter the second barrier.
- _cm->enter_second_sync_barrier(_worker_id);
- // At this point everything has bee re-initialised and we're
+ if (!is_serial) {
+ // ...and enter the second barrier.
+ _cm->enter_second_sync_barrier(_worker_id);
+ }
+ // At this point, if we're during the concurrent phase of
+ // marking, everything has been re-initialized and we're
// ready to restart.
}
--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -166,7 +166,7 @@
class CMMarkStack VALUE_OBJ_CLASS_SPEC {
VirtualSpace _virtual_space; // Underlying backing store for actual stack
ConcurrentMark* _cm;
- oop* _base; // bottom of stack
+ oop* _base; // bottom of stack
jint _index; // one more than last occupied index
jint _capacity; // max #elements
jint _saved_index; // value of _index saved at start of GC
@@ -491,9 +491,12 @@
// structures are initialised to a sensible and predictable state.
void set_non_marking_state();
+ // Called to indicate how many threads are currently active.
+ void set_concurrency(uint active_tasks);
+
// It should be called to indicate which phase we're in (concurrent
// mark or remark) and how many threads are currently active.
- void set_phase(uint active_tasks, bool concurrent);
+ void set_concurrency_and_phase(uint active_tasks, bool concurrent);
// prints all gathered CM-related statistics
void print_stats();
@@ -1146,7 +1149,9 @@
// trying not to exceed the given duration. However, it might exit
// prematurely, according to some conditions (i.e. SATB buffers are
// available for processing).
- void do_marking_step(double target_ms, bool do_stealing, bool do_termination);
+ void do_marking_step(double target_ms,
+ bool do_termination,
+ bool is_serial);
// These two calls start and stop the timer
void record_start_time() {
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parallelScavengeHeap.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -656,7 +656,7 @@
tty->print_cr("[Accumulated GC generation 0 time %3.7f secs]", time);
}
if (TraceGen1Time) {
- double time = PSMarkSweep::accumulated_time()->seconds();
+ double time = UseParallelOldGC ? PSParallelCompact::accumulated_time()->seconds() : PSMarkSweep::accumulated_time()->seconds();
tty->print_cr("[Accumulated GC generation 1 time %3.7f secs]", time);
}
}
--- a/hotspot/src/share/vm/interpreter/interpreter.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/interpreter/interpreter.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -76,7 +76,7 @@
if (PrintInterpreter) {
st->cr();
- Disassembler::decode(code_begin(), code_end(), st, DEBUG_ONLY(_comments) NOT_DEBUG(CodeComments()));
+ Disassembler::decode(code_begin(), code_end(), st, DEBUG_ONLY(_strings) NOT_DEBUG(CodeStrings()));
}
}
--- a/hotspot/src/share/vm/interpreter/interpreter.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/interpreter/interpreter.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -48,12 +48,12 @@
int _size; // the size in bytes
const char* _description; // a description of the codelet, for debugging & printing
Bytecodes::Code _bytecode; // associated bytecode if any
- DEBUG_ONLY(CodeComments _comments;) // Comments for annotating assembler output.
+ DEBUG_ONLY(CodeStrings _strings;) // Comments for annotating assembler output.
public:
// Initialization/finalization
void initialize(int size,
- CodeComments& comments) { _size = size; DEBUG_ONLY(_comments.assign(comments);) }
+ CodeStrings& strings) { _size = size; DEBUG_ONLY(_strings.assign(strings);) }
void finalize() { ShouldNotCallThis(); }
// General info/converters
@@ -131,7 +131,7 @@
// commit Codelet
- AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->comments());
+ AbstractInterpreter::code()->commit((*_masm)->code()->pure_insts_size(), (*_masm)->code()->strings());
// make sure nobody can use _masm outside a CodeletMark lifespan
*_masm = NULL;
}
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -554,6 +554,8 @@
}
if (complete) {
+ // Delete metaspaces for unloaded class loaders and clean up loader_data graph
+ ClassLoaderDataGraph::purge();
// Resize the metaspace capacity after full collections
MetaspaceGC::compute_new_size();
update_full_collections_completed();
@@ -564,11 +566,6 @@
gc_epilogue(complete);
- // Delete metaspaces for unloaded class loaders and clean up loader_data graph
- if (complete) {
- ClassLoaderDataGraph::purge();
- }
-
if (must_restore_marks_for_biased_locking) {
BiasedLocking::restore_marks();
}
--- a/hotspot/src/share/vm/memory/metaspace.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/memory/metaspace.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -1103,25 +1103,24 @@
}
bool MetaspaceGC::should_expand(VirtualSpaceList* vsl, size_t word_size) {
+ // If the user wants a limit, impose one.
+ if (!FLAG_IS_DEFAULT(MaxMetaspaceSize) &&
+ MetaspaceAux::reserved_in_bytes() >= MaxMetaspaceSize) {
+ return false;
+ }
// Class virtual space should always be expanded. Call GC for the other
// metadata virtual space.
if (vsl == Metaspace::class_space_list()) return true;
- // If the user wants a limit, impose one.
- size_t max_metaspace_size_words = MaxMetaspaceSize / BytesPerWord;
- size_t metaspace_size_words = MetaspaceSize / BytesPerWord;
- if (!FLAG_IS_DEFAULT(MaxMetaspaceSize) &&
- vsl->capacity_words_sum() >= max_metaspace_size_words) {
- return false;
- }
-
// If this is part of an allocation after a GC, expand
// unconditionally.
if(MetaspaceGC::expand_after_GC()) {
return true;
}
+ size_t metaspace_size_words = MetaspaceSize / BytesPerWord;
+
// If the capacity is below the minimum capacity, allow the
// expansion. Also set the high-water-mark (capacity_until_GC)
// to that minimum capacity so that a GC will not be induced
@@ -1311,8 +1310,7 @@
gclog_or_tty->print_cr(" metaspace HWM: %.1fK", new_capacity_until_GC / (double) K);
}
}
- assert(vsl->used_bytes_sum() == used_after_gc &&
- used_after_gc <= vsl->capacity_bytes_sum(),
+ assert(used_after_gc <= vsl->capacity_bytes_sum(),
"sanity check");
}
@@ -1972,6 +1970,9 @@
}
SpaceManager::~SpaceManager() {
+ // This call this->_lock which can't be done while holding expand_lock()
+ const size_t in_use_before = sum_capacity_in_chunks_in_use();
+
MutexLockerEx fcl(SpaceManager::expand_lock(),
Mutex::_no_safepoint_check_flag);
@@ -1989,7 +1990,7 @@
// Have to update before the chunks_in_use lists are emptied
// below.
- chunk_manager->inc_free_chunks_total(sum_capacity_in_chunks_in_use(),
+ chunk_manager->inc_free_chunks_total(in_use_before,
sum_count_in_chunks_in_use());
// Add all the chunks in use by this space manager
--- a/hotspot/src/share/vm/memory/sharedHeap.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/memory/sharedHeap.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -178,7 +178,7 @@
SystemDictionary::always_strong_oops_do(roots);
ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, !is_scavenging);
} else {
- ShouldNotReachHere2("We should always have selected either SO_AllClasses or SO_SystemClasses");
+ fatal("We should always have selected either SO_AllClasses or SO_SystemClasses");
}
}
--- a/hotspot/src/share/vm/oops/constantPool.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/oops/constantPool.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -1852,6 +1852,7 @@
switch (tag_at(index).value()) {
case JVM_CONSTANT_Class :
{ Klass* k = klass_at(index, CATCH);
+ guarantee(k != NULL, "need klass");
k->print_value_on(st);
st->print(" {0x%lx}", (address)k);
}
--- a/hotspot/src/share/vm/oops/fieldInfo.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/oops/fieldInfo.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -108,11 +108,11 @@
return build_int_from_shorts(_shorts[low_packed_offset], _shorts[high_packed_offset]) >> FIELDINFO_TAG_SIZE;
#ifndef PRODUCT
case FIELDINFO_TAG_TYPE_PLAIN:
- ShouldNotReachHere2("Asking offset for the plain type field");
+ fatal("Asking offset for the plain type field");
case FIELDINFO_TAG_TYPE_CONTENDED:
- ShouldNotReachHere2("Asking offset for the contended type field");
+ fatal("Asking offset for the contended type field");
case FIELDINFO_TAG_BLANK:
- ShouldNotReachHere2("Asking offset for the blank field");
+ fatal("Asking offset for the blank field");
#endif
}
ShouldNotReachHere();
@@ -128,9 +128,9 @@
return true;
#ifndef PRODUCT
case FIELDINFO_TAG_OFFSET:
- ShouldNotReachHere2("Asking contended flag for the field with offset");
+ fatal("Asking contended flag for the field with offset");
case FIELDINFO_TAG_BLANK:
- ShouldNotReachHere2("Asking contended flag for the blank field");
+ fatal("Asking contended flag for the blank field");
#endif
}
ShouldNotReachHere();
@@ -146,9 +146,9 @@
return _shorts[high_packed_offset];
#ifndef PRODUCT
case FIELDINFO_TAG_OFFSET:
- ShouldNotReachHere2("Asking the contended group for the field with offset");
+ fatal("Asking the contended group for the field with offset");
case FIELDINFO_TAG_BLANK:
- ShouldNotReachHere2("Asking the contended group for the blank field");
+ fatal("Asking the contended group for the blank field");
#endif
}
ShouldNotReachHere();
@@ -163,9 +163,9 @@
return (lo >> FIELDINFO_TAG_SIZE);
#ifndef PRODUCT
case FIELDINFO_TAG_OFFSET:
- ShouldNotReachHere2("Asking the field type for field with offset");
+ fatal("Asking the field type for field with offset");
case FIELDINFO_TAG_BLANK:
- ShouldNotReachHere2("Asking the field type for the blank field");
+ fatal("Asking the field type for the blank field");
#endif
}
ShouldNotReachHere();
@@ -211,7 +211,7 @@
case FIELDINFO_TAG_TYPE_PLAIN:
case FIELDINFO_TAG_TYPE_CONTENDED:
case FIELDINFO_TAG_OFFSET:
- ShouldNotReachHere2("Setting the field type with overwriting");
+ fatal("Setting the field type with overwriting");
#endif
}
ShouldNotReachHere();
@@ -226,11 +226,11 @@
return;
#ifndef PRODUCT
case FIELDINFO_TAG_TYPE_CONTENDED:
- ShouldNotReachHere2("Overwriting contended group");
+ fatal("Overwriting contended group");
case FIELDINFO_TAG_BLANK:
- ShouldNotReachHere2("Setting contended group for the blank field");
+ fatal("Setting contended group for the blank field");
case FIELDINFO_TAG_OFFSET:
- ShouldNotReachHere2("Setting contended group for field with offset");
+ fatal("Setting contended group for field with offset");
#endif
}
ShouldNotReachHere();
--- a/hotspot/src/share/vm/oops/generateOopMap.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/oops/generateOopMap.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -762,6 +762,7 @@
// monitor matching is purely informational and doesn't say anything
// about the correctness of the code.
void GenerateOopMap::merge_state_into_bb(BasicBlock *bb) {
+ guarantee(bb != NULL, "null basicblock");
assert(bb->is_alive(), "merging state into a dead basicblock");
if (_stack_top == bb->_stack_top) {
@@ -1189,6 +1190,7 @@
if (start_pc <= bci && bci < end_pc) {
BasicBlock *excBB = get_basic_block_at(handler_pc);
+ guarantee(excBB != NULL, "no basic block for exception");
CellTypeState *excStk = excBB->stack();
CellTypeState *cOpStck = stack();
CellTypeState cOpStck_0 = cOpStck[0];
@@ -1803,6 +1805,7 @@
// possibility that this bytecode will throw an
// exception.
BasicBlock* bb = get_basic_block_containing(bci);
+ guarantee(bb != NULL, "no basic block for bci");
bb->set_changed(true);
bb->_monitor_top = bad_monitors;
@@ -2190,6 +2193,7 @@
// Find basicblock and report results
BasicBlock* bb = get_basic_block_containing(bci);
+ guarantee(bb != NULL, "no basic block for bci");
assert(bb->is_reachable(), "getting result from unreachable basicblock");
bb->set_changed(true);
interp_bb(bb);
--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -157,9 +157,10 @@
} else {
// Not hot. Check for medium-sized pre-existing nmethod at cold sites.
if (callee_method->has_compiled_code() &&
- callee_method->instructions_size() > inline_small_code_size)
+ callee_method->instructions_size() > inline_small_code_size) {
set_msg("already compiled into a medium method");
return false;
+ }
}
if (size > max_inline_size) {
if (max_inline_size > default_max_inline_size) {
--- a/hotspot/src/share/vm/opto/loopTransform.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/opto/loopTransform.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -888,6 +888,7 @@
CountedLoopNode *main_head = loop->_head->as_CountedLoop();
assert( main_head->is_normal_loop(), "" );
CountedLoopEndNode *main_end = main_head->loopexit();
+ guarantee(main_end != NULL, "no loop exit node");
assert( main_end->outcnt() == 2, "1 true, 1 false path only" );
uint dd_main_head = dom_depth(main_head);
uint max = main_head->outcnt();
@@ -2554,13 +2555,16 @@
ok.set(store->_idx);
ok.set(store->in(MemNode::Memory)->_idx);
+ CountedLoopEndNode* loop_exit = head->loopexit();
+ guarantee(loop_exit != NULL, "no loop exit node");
+
// Loop structure is ok
ok.set(head->_idx);
- ok.set(head->loopexit()->_idx);
+ ok.set(loop_exit->_idx);
ok.set(head->phi()->_idx);
ok.set(head->incr()->_idx);
- ok.set(head->loopexit()->cmp_node()->_idx);
- ok.set(head->loopexit()->in(1)->_idx);
+ ok.set(loop_exit->cmp_node()->_idx);
+ ok.set(loop_exit->in(1)->_idx);
// Address elements are ok
if (con) ok.set(con->_idx);
@@ -2572,7 +2576,7 @@
if (n->outcnt() == 0) continue; // Ignore dead
if (ok.test(n->_idx)) continue;
// Backedge projection is ok
- if (n->is_IfTrue() && n->in(0) == head->loopexit()) continue;
+ if (n->is_IfTrue() && n->in(0) == loop_exit) continue;
if (!n->is_AddP()) {
msg = "unhandled node";
msg_node = n;
@@ -2585,7 +2589,7 @@
Node* n = lpt->_body.at(i);
// These values can be replaced with other nodes if they are used
// outside the loop.
- if (n == store || n == head->loopexit() || n == head->incr() || n == store->in(MemNode::Memory)) continue;
+ if (n == store || n == loop_exit || n == head->incr() || n == store->in(MemNode::Memory)) continue;
for (SimpleDUIterator iter(n); iter.has_next(); iter.next()) {
Node* use = iter.get();
if (!lpt->_body.contains(use)) {
--- a/hotspot/src/share/vm/opto/loopnode.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/opto/loopnode.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -603,7 +603,10 @@
}
public:
- bool has_node( Node* n ) const { return _nodes[n->_idx] != NULL; }
+ bool has_node( Node* n ) const {
+ guarantee(n != NULL, "No Node.");
+ return _nodes[n->_idx] != NULL;
+ }
// check if transform created new nodes that need _ctrl recorded
Node *get_late_ctrl( Node *n, Node *early );
Node *get_early_ctrl( Node *n );
@@ -737,7 +740,8 @@
return n;
}
uint dom_depth(Node* d) const {
- assert(d->_idx < _idom_size, "");
+ guarantee(d != NULL, "Null dominator info.");
+ guarantee(d->_idx < _idom_size, "");
return _dom_depth[d->_idx];
}
void set_idom(Node* d, Node* n, uint dom_depth);
--- a/hotspot/src/share/vm/opto/loopopts.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/opto/loopopts.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -232,7 +232,11 @@
// Loop predicates may have depending checks which should not
// be skipped. For example, range check predicate has two checks
// for lower and upper bounds.
- ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp->as_Proj()->_con)->as_Proj();
+ if (dp == NULL)
+ return;
+
+ ProjNode* dp_proj = dp->as_Proj();
+ ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp_proj->_con)->as_Proj();
if (exclude_loop_predicate &&
is_uncommon_trap_proj(unc_proj, Deoptimization::Reason_predicate))
return; // Let IGVN transformation change control dependence.
@@ -866,8 +870,11 @@
// Now split the bool up thru the phi
Node *bolphi = split_thru_phi( bol, n_ctrl, -1 );
+ guarantee(bolphi != NULL, "null boolean phi node");
+
_igvn.replace_node( bol, bolphi );
assert( iff->in(1) == bolphi, "" );
+
if( bolphi->Value(&_igvn)->singleton() )
return;
@@ -1628,6 +1635,7 @@
//------------------------------ short_circuit_if -------------------------------------
// Force the iff control output to be the live_proj
Node* PhaseIdealLoop::short_circuit_if(IfNode* iff, ProjNode* live_proj) {
+ guarantee(live_proj != NULL, "null projection");
int proj_con = live_proj->_con;
assert(proj_con == 0 || proj_con == 1, "false or true projection");
Node *con = _igvn.intcon(proj_con);
@@ -1686,6 +1694,7 @@
set_idom(proj, new_if, ddepth);
ProjNode* new_exit = proj_clone(other_proj, new_if)->as_Proj();
+ guarantee(new_exit != NULL, "null exit node");
register_node(new_exit, get_loop(other_proj), new_if, ddepth);
return new_exit;
@@ -1793,7 +1802,10 @@
int stride = stride_of_possible_iv(if_cmpu);
if (stride == 0) return NULL;
- ProjNode* lp_continue = stay_in_loop(if_cmpu, loop)->as_Proj();
+ Node* lp_proj = stay_in_loop(if_cmpu, loop);
+ guarantee(lp_proj != NULL, "null loop node");
+
+ ProjNode* lp_continue = lp_proj->as_Proj();
ProjNode* lp_exit = if_cmpu->proj_out(!lp_continue->is_IfTrue())->as_Proj();
Node* limit = NULL;
@@ -1805,6 +1817,7 @@
}
// Create a new region on the exit path
RegionNode* reg = insert_region_before_proj(lp_exit);
+ guarantee(reg != NULL, "null region node");
// Clone the if-cmpu-true-false using a signed compare
BoolTest::mask rel_i = stride > 0 ? bol->_test._test : BoolTest::ge;
--- a/hotspot/src/share/vm/opto/output.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/opto/output.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -2518,6 +2518,7 @@
// Schedule the remaining instructions in the block
while ( _available.size() > 0 ) {
Node *n = ChooseNodeToBundle();
+ guarantee(n != NULL, "no nodes available");
AddNodeToBundle(n,bb);
}
--- a/hotspot/src/share/vm/opto/type.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/opto/type.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -4193,6 +4193,7 @@
bool xk = klass_is_exact();
//return TypeInstPtr::make(TypePtr::NotNull, k, xk, NULL, 0);
const TypeOopPtr* toop = TypeOopPtr::make_from_klass_raw(k);
+ guarantee(toop != NULL, "need type for given klass");
toop = toop->cast_to_ptr_type(TypePtr::NotNull)->is_oopptr();
return toop->cast_to_exactness(xk)->is_oopptr();
}
--- a/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -87,7 +87,7 @@
CodeBuffer* cbuf = _masm->code();
CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
if (blob != NULL) {
- blob->set_comments(cbuf->comments());
+ blob->set_strings(cbuf->strings());
}
bool saw_first = false;
StubCodeDesc* toprint[1000];
--- a/hotspot/src/share/vm/runtime/vm_version.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/runtime/vm_version.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -211,6 +211,10 @@
#define HOTSPOT_BUILD_COMPILER "MS VC++ 8.0 (VS2005)"
#elif _MSC_VER == 1500
#define HOTSPOT_BUILD_COMPILER "MS VC++ 9.0 (VS2008)"
+ #elif _MSC_VER == 1600
+ #define HOTSPOT_BUILD_COMPILER "MS VC++ 10.0 (VS2010)"
+ #elif _MSC_VER == 1700
+ #define HOTSPOT_BUILD_COMPILER "MS VC++ 11.0 (VS2012)"
#else
#define HOTSPOT_BUILD_COMPILER "unknown MS VC++:" XSTR(_MSC_VER)
#endif
--- a/hotspot/src/share/vm/services/memoryService.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/services/memoryService.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -240,6 +240,7 @@
void MemoryService::add_generation_memory_pool(Generation* gen,
MemoryManager* major_mgr,
MemoryManager* minor_mgr) {
+ guarantee(gen != NULL, "No generation for memory pool");
Generation::Name kind = gen->kind();
int index = _pools_list->length();
--- a/hotspot/src/share/vm/utilities/debug.cpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/utilities/debug.cpp Fri Mar 22 17:23:31 2013 -0700
@@ -248,10 +248,6 @@
report_vm_error(file, line, "ShouldNotReachHere()");
}
-void report_should_not_reach_here2(const char* file, int line, const char* message) {
- report_vm_error(file, line, "ShouldNotReachHere()", message);
-}
-
void report_unimplemented(const char* file, int line) {
report_vm_error(file, line, "Unimplemented()");
}
--- a/hotspot/src/share/vm/utilities/debug.hpp Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/src/share/vm/utilities/debug.hpp Fri Mar 22 17:23:31 2013 -0700
@@ -192,12 +192,6 @@
BREAKPOINT; \
} while (0)
-#define ShouldNotReachHere2(message) \
-do { \
- report_should_not_reach_here2(__FILE__, __LINE__, message); \
- BREAKPOINT; \
-} while (0)
-
#define Unimplemented() \
do { \
report_unimplemented(__FILE__, __LINE__); \
@@ -218,7 +212,6 @@
const char* message);
void report_should_not_call(const char* file, int line);
void report_should_not_reach_here(const char* file, int line);
-void report_should_not_reach_here2(const char* file, int line, const char* message);
void report_unimplemented(const char* file, int line);
void report_untested(const char* file, int line, const char* message);
--- a/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/test/compiler/whitebox/CompilerWhiteBoxTest.java Fri Mar 22 17:23:31 2013 -0700
@@ -35,6 +35,8 @@
protected static final Method METHOD = getMethod("method");
protected static final int COMPILE_THRESHOLD
= Integer.parseInt(getVMOption("CompileThreshold", "10000"));
+ protected static final boolean BACKGROUND_COMPILATION
+ = Boolean.valueOf(getVMOption("BackgroundCompilation", "true"));
protected static Method getMethod(String name) {
try {
@@ -45,11 +47,16 @@
}
}
- protected static String getVMOption(String name, String defaultValue) {
+ protected static String getVMOption(String name) {
String result;
HotSpotDiagnosticMXBean diagnostic
= ManagementFactoryHelper.getDiagnosticMXBean();
result = diagnostic.getVMOption(name).getValue();
+ return result;
+ }
+
+ protected static String getVMOption(String name, String defaultValue) {
+ String result = getVMOption(name);
return result == null ? defaultValue : result;
}
@@ -66,6 +73,7 @@
} catch (Exception e) {
System.out.printf("on exception '%s':", e.getMessage());
printInfo(METHOD);
+ e.printStackTrace();
throw new RuntimeException(e);
}
System.out.println("at test's end:");
@@ -100,6 +108,9 @@
protected static void waitBackgroundCompilation(Method method)
throws InterruptedException {
+ if (!BACKGROUND_COMPILATION) {
+ return;
+ }
final Object obj = new Object();
synchronized (obj) {
for (int i = 0; i < 10; ++i) {
@@ -129,13 +140,14 @@
protected final int compile() {
int result = 0;
- for (int i = 0; i < COMPILE_THRESHOLD; ++i) {
+ int count = Math.max(COMPILE_THRESHOLD, 150000);
+ for (int i = 0; i < count; ++i) {
result += method();
}
+ System.out.println("method was invoked " + count + " times");
return result;
}
-
protected int method() {
return 42;
}
--- a/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/test/compiler/whitebox/DeoptimizeAllTest.java Fri Mar 22 17:23:31 2013 -0700
@@ -32,12 +32,12 @@
public class DeoptimizeAllTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception {
+ // to prevent inlining #method into #compile()
+ WHITE_BOX.setDontInlineMethod(METHOD, true);
new DeoptimizeAllTest().runTest();
}
protected void test() throws Exception {
- // to prevent inlining #method into #compile()
- WHITE_BOX.setDontInlineMethod(METHOD, true);
compile();
checkCompiled(METHOD);
WHITE_BOX.deoptimizeAll();
--- a/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/test/compiler/whitebox/DeoptimizeMethodTest.java Fri Mar 22 17:23:31 2013 -0700
@@ -32,12 +32,12 @@
public class DeoptimizeMethodTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception {
+ // to prevent inlining #method into #compile()
+ WHITE_BOX.setDontInlineMethod(METHOD, true);
new DeoptimizeMethodTest().runTest();
}
protected void test() throws Exception {
- // to prevent inlining #method into #compile()
- WHITE_BOX.setDontInlineMethod(METHOD, true);
compile();
checkCompiled(METHOD);
WHITE_BOX.deoptimizeMethod(METHOD);
--- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java Fri Mar 22 17:23:31 2013 -0700
@@ -44,6 +44,8 @@
}
public static void main(String[] args) throws Exception {
+ // to prevent inlining #method into #compile()
+ WHITE_BOX.setDontInlineMethod(METHOD, true);
new IsMethodCompilableTest().runTest();
}
@@ -58,8 +60,6 @@
"Warning: test is not applicable if PerMethodRecompilationCutoff == Inf");
return;
}
- // to prevent inlining #method into #compile()
- WHITE_BOX.setDontInlineMethod(METHOD, true);
boolean madeNotCompilable = false;
for (long i = 0; i < PER_METHOD_RECOMPILATION_CUTOFF; ++i) {
--- a/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java Fri Mar 22 10:09:47 2013 -0400
+++ b/hotspot/test/compiler/whitebox/MakeMethodNotCompilableTest.java Fri Mar 22 17:23:31 2013 -0700
@@ -32,6 +32,8 @@
public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
public static void main(String[] args) throws Exception {
+ // to prevent inlining #method into #compile()
+ WHITE_BOX.setDontInlineMethod(METHOD, true);
new MakeMethodNotCompilableTest().runTest();
}