Merge
This commit is contained in:
commit
8d607b2446
@ -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.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -148,7 +148,7 @@ public class Oop {
|
|||||||
if (doVMFields) {
|
if (doVMFields) {
|
||||||
visitor.doCInt(mark, true);
|
visitor.doCInt(mark, true);
|
||||||
if (VM.getVM().isCompressedKlassPointersEnabled()) {
|
if (VM.getVM().isCompressedKlassPointersEnabled()) {
|
||||||
throw new InternalError("unimplemented");
|
visitor.doMetadata(compressedKlass, true);
|
||||||
} else {
|
} else {
|
||||||
visitor.doMetadata(klass, true);
|
visitor.doMetadata(klass, true);
|
||||||
}
|
}
|
||||||
|
@ -532,6 +532,39 @@ $(JDK_IMAGE_DIR)/jre/lib/rt.jar:
|
|||||||
$(TAR) -cf - *) | \
|
$(TAR) -cf - *) | \
|
||||||
($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xf -)
|
($(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:
|
test_jdk:
|
||||||
ifeq ($(JVM_VARIANT_CLIENT), true)
|
ifeq ($(JVM_VARIANT_CLIENT), true)
|
||||||
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -Xinternalversion
|
$(JDK_IMAGE_DIR)/bin/java -d$(ARCH_DATA_MODEL) -client -Xinternalversion
|
||||||
|
@ -299,63 +299,42 @@ platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
|
|||||||
|
|
||||||
$(TARGETS_C2): $(SUBDIRS_C2)
|
$(TARGETS_C2): $(SUBDIRS_C2)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_C1): $(SUBDIRS_C1)
|
$(TARGETS_C1): $(SUBDIRS_C1)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
|
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
|
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
|
$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||||
# sa.make - generate SA jar file and natives
|
# sa.make - generate SA jar file and natives
|
||||||
# env.[ck]sh - environment settings
|
# 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
|
# The makefiles are split this way so that "make foo" will run faster by not
|
||||||
# having to read the dependency files for the vm.
|
# having to read the dependency files for the vm.
|
||||||
@ -67,9 +66,6 @@ include $(GAMMADIR)/make/altsrc.make
|
|||||||
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
||||||
QUIETLY$(MAKE_VERBOSE) = @
|
QUIETLY$(MAKE_VERBOSE) = @
|
||||||
|
|
||||||
# For now, until the compiler is less wobbly:
|
|
||||||
TESTFLAGS = -Xbatch -showversion
|
|
||||||
|
|
||||||
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
|
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
|
||||||
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
|
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
|
||||||
else
|
else
|
||||||
@ -135,7 +131,7 @@ BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
|||||||
# dtrace.make is used on BSD versions that implement Dtrace (like MacOS X)
|
# 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 \
|
BUILDTREE_TARGETS = Makefile flags.make flags_vm.make vm.make adlc.make \
|
||||||
jvmti.make sa.make dtrace.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) \
|
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||||
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||||
@ -352,7 +348,7 @@ env.sh: $(BUILDTREE_MAKE)
|
|||||||
@echo Creating $@ ...
|
@echo Creating $@ ...
|
||||||
$(QUIETLY) ( \
|
$(QUIETLY) ( \
|
||||||
$(BUILDTREE_COMMENT); \
|
$(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"; \
|
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
||||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
||||||
@ -364,8 +360,7 @@ env.csh: env.sh
|
|||||||
@echo Creating $@ ...
|
@echo Creating $@ ...
|
||||||
$(QUIETLY) ( \
|
$(QUIETLY) ( \
|
||||||
$(BUILDTREE_COMMENT); \
|
$(BUILDTREE_COMMENT); \
|
||||||
[ -n "$$JAVA_HOME" ] && \
|
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
||||||
{ echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
|
|
||||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
||||||
) > $@
|
) > $@
|
||||||
|
|
||||||
@ -376,119 +371,6 @@ jdkpath.sh: $(BUILDTREE_MAKE)
|
|||||||
echo "JDK=${JAVA_HOME}"; \
|
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:
|
FORCE:
|
||||||
|
|
||||||
.PHONY: all FORCE
|
.PHONY: all FORCE
|
||||||
|
@ -302,7 +302,7 @@ ifneq ($(OSNAME),windows)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Required make macro settings for all platforms
|
# 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 += OUTPUTDIR=$(ABS_OUTPUTDIR)
|
||||||
MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR)
|
MAKE_ARGS += GAMMADIR=$(ABS_GAMMADIR)
|
||||||
MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)
|
MAKE_ARGS += MAKE_VERBOSE=$(MAKE_VERBOSE)
|
||||||
@ -337,9 +337,6 @@ EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jni.h
|
|||||||
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
|
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/$(JDK_INCLUDE_SUBDIR)/jni_md.h
|
||||||
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
|
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jmm.h
|
||||||
|
|
||||||
# By default, run Queens test after building
|
|
||||||
TEST_IN_BUILD ?= true
|
|
||||||
|
|
||||||
ifndef JAVASE_EMBEDDED
|
ifndef JAVASE_EMBEDDED
|
||||||
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h
|
EXPORT_LIST += $(EXPORT_INCLUDE_DIR)/jfr.h
|
||||||
endif
|
endif
|
||||||
|
@ -300,63 +300,42 @@ platform_zero: $(GAMMADIR)/make/$(OSNAME)/platform_zero.in
|
|||||||
|
|
||||||
$(TARGETS_C2): $(SUBDIRS_C2)
|
$(TARGETS_C2): $(SUBDIRS_C2)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_C1): $(SUBDIRS_C1)
|
$(TARGETS_C1): $(SUBDIRS_C1)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
|
$(TARGETS_ZERO): $(SUBDIRS_ZERO)
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(VARIANTARCH)_zero/$(patsubst %zero,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
|
$(TARGETS_SHARK): $(SUBDIRS_SHARK)
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(VARIANTARCH)_shark/$(patsubst %shark,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
|
$(TARGETS_MINIMAL1): $(SUBDIRS_MINIMAL1)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_minimal1/$(patsubst %minimal1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||||
# sa.make - generate SA jar file and natives
|
# sa.make - generate SA jar file and natives
|
||||||
# env.[ck]sh - environment settings
|
# 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
|
# The makefiles are split this way so that "make foo" will run faster by not
|
||||||
# having to read the dependency files for the vm.
|
# having to read the dependency files for the vm.
|
||||||
@ -64,9 +63,6 @@ include $(GAMMADIR)/make/altsrc.make
|
|||||||
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
||||||
QUIETLY$(MAKE_VERBOSE) = @
|
QUIETLY$(MAKE_VERBOSE) = @
|
||||||
|
|
||||||
# For now, until the compiler is less wobbly:
|
|
||||||
TESTFLAGS = -Xbatch -showversion
|
|
||||||
|
|
||||||
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
|
ifeq ($(findstring true, $(JVM_VARIANT_ZERO) $(JVM_VARIANT_ZEROSHARK)), true)
|
||||||
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
|
PLATFORM_FILE = $(shell dirname $(shell dirname $(shell pwd)))/platform_zero
|
||||||
else
|
else
|
||||||
@ -128,7 +124,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
|
|||||||
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
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 \
|
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) \
|
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||||
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
SRCARCH=$(SRCARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||||
@ -345,7 +341,7 @@ env.sh: $(BUILDTREE_MAKE)
|
|||||||
@echo Creating $@ ...
|
@echo Creating $@ ...
|
||||||
$(QUIETLY) ( \
|
$(QUIETLY) ( \
|
||||||
$(BUILDTREE_COMMENT); \
|
$(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"; \
|
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
||||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
||||||
@ -357,8 +353,7 @@ env.csh: env.sh
|
|||||||
@echo Creating $@ ...
|
@echo Creating $@ ...
|
||||||
$(QUIETLY) ( \
|
$(QUIETLY) ( \
|
||||||
$(BUILDTREE_COMMENT); \
|
$(BUILDTREE_COMMENT); \
|
||||||
[ -n "$$JAVA_HOME" ] && \
|
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
||||||
{ echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
|
|
||||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
||||||
) > $@
|
) > $@
|
||||||
|
|
||||||
@ -369,119 +364,6 @@ jdkpath.sh: $(BUILDTREE_MAKE)
|
|||||||
echo "JDK=${JAVA_HOME}"; \
|
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:
|
FORCE:
|
||||||
|
|
||||||
.PHONY: all FORCE
|
.PHONY: all FORCE
|
||||||
|
@ -231,36 +231,24 @@ $(SUBDIRS_CORE): $(BUILDTREE_MAKE)
|
|||||||
|
|
||||||
$(TARGETS_C2): $(SUBDIRS_C2)
|
$(TARGETS_C2): $(SUBDIRS_C2)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_compiler2/$@ && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
$(TARGETS_TIERED): $(SUBDIRS_TIERED)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_tiered/$(patsubst %tiered,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_C1): $(SUBDIRS_C1)
|
$(TARGETS_C1): $(SUBDIRS_C1)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_compiler1/$(patsubst %1,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
|
||||||
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
$(TARGETS_CORE): $(SUBDIRS_CORE)
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS)
|
||||||
ifeq ($(TEST_IN_BUILD),true)
|
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && ./test_gamma
|
|
||||||
endif
|
|
||||||
ifdef INSTALL
|
ifdef INSTALL
|
||||||
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
cd $(OSNAME)_$(BUILDARCH)_core/$(patsubst %core,%,$@) && $(MAKE) $(MFLAGS) install
|
||||||
endif
|
endif
|
||||||
|
@ -50,21 +50,19 @@
|
|||||||
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
# jvmti.make - generate JVMTI bindings from the spec (JSR-163)
|
||||||
# sa.make - generate SA jar file and natives
|
# sa.make - generate SA jar file and natives
|
||||||
# env.[ck]sh - environment settings
|
# 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
|
# The makefiles are split this way so that "make foo" will run faster by not
|
||||||
# having to read the dependency files for the vm.
|
# having to read the dependency files for the vm.
|
||||||
|
|
||||||
-include $(SPEC)
|
-include $(SPEC)
|
||||||
include $(GAMMADIR)/make/scm.make
|
include $(GAMMADIR)/make/scm.make
|
||||||
|
include $(GAMMADIR)/make/defs.make
|
||||||
include $(GAMMADIR)/make/altsrc.make
|
include $(GAMMADIR)/make/altsrc.make
|
||||||
|
|
||||||
|
|
||||||
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
# 'gmake MAKE_VERBOSE=y' or 'gmake QUIETLY=' gives all the gory details.
|
||||||
QUIETLY$(MAKE_VERBOSE) = @
|
QUIETLY$(MAKE_VERBOSE) = @
|
||||||
|
|
||||||
# For now, until the compiler is less wobbly:
|
|
||||||
TESTFLAGS = -Xbatch -Xmx32m -showversion
|
|
||||||
|
|
||||||
### maye ARCH_XXX instead?
|
### maye ARCH_XXX instead?
|
||||||
ifdef USE_GCC
|
ifdef USE_GCC
|
||||||
PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).gcc
|
PLATFORM_FILE = $(GAMMADIR)/make/$(OS_FAMILY)/platform_$(BUILDARCH).gcc
|
||||||
@ -119,7 +117,7 @@ SUBMAKE_DIRS = $(addprefix $(PLATFORM_DIR)/,$(TARGETS))
|
|||||||
BUILDTREE_MAKE = $(GAMMADIR)/make/$(OS_FAMILY)/makefiles/buildtree.make
|
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 \
|
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) \
|
BUILDTREE_VARS = GAMMADIR=$(GAMMADIR) OS_FAMILY=$(OS_FAMILY) \
|
||||||
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
ARCH=$(ARCH) BUILDARCH=$(BUILDARCH) LIBARCH=$(LIBARCH) VARIANT=$(VARIANT)
|
||||||
@ -334,7 +332,7 @@ env.sh: $(BUILDTREE_MAKE)
|
|||||||
@echo Creating $@ ...
|
@echo Creating $@ ...
|
||||||
$(QUIETLY) ( \
|
$(QUIETLY) ( \
|
||||||
$(BUILDTREE_COMMENT); \
|
$(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"; \
|
echo "CLASSPATH=$${CLASSPATH:+$$CLASSPATH:}.:\$${JAVA_HOME}/jre/lib/rt.jar:\$${JAVA_HOME}/jre/lib/i18n.jar"; \
|
||||||
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
} | sed s:$${JAVA_HOME:--------}:\$${JAVA_HOME}:g; \
|
||||||
@ -346,8 +344,7 @@ env.csh: env.sh
|
|||||||
@echo Creating $@ ...
|
@echo Creating $@ ...
|
||||||
$(QUIETLY) ( \
|
$(QUIETLY) ( \
|
||||||
$(BUILDTREE_COMMENT); \
|
$(BUILDTREE_COMMENT); \
|
||||||
[ -n "$$JAVA_HOME" ] && \
|
{ echo "setenv JAVA_HOME \"$(JDK_IMPORT_PATH)\""; }; \
|
||||||
{ echo "if (! \$$?JAVA_HOME) setenv JAVA_HOME \"$$JAVA_HOME\""; }; \
|
|
||||||
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
sed -n 's/^\([A-Za-z_][A-Za-z0-9_]*\)=/setenv \1 /p' $?; \
|
||||||
) > $@
|
) > $@
|
||||||
|
|
||||||
@ -358,124 +355,6 @@ jdkpath.sh: $(BUILDTREE_MAKE)
|
|||||||
echo "JDK=${JAVA_HOME}"; \
|
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:
|
FORCE:
|
||||||
|
|
||||||
.PHONY: all FORCE
|
.PHONY: all FORCE
|
||||||
|
@ -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();
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
@ -1385,13 +1385,13 @@ void MacroAssembler::_verify_oop(Register reg, const char* msg, const char * fil
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int len = strlen(file) + strlen(msg) + 1 + 4;
|
const char* real_msg = NULL;
|
||||||
sprintf(buffer, "%d", line);
|
{
|
||||||
len += strlen(buffer);
|
ResourceMark rm;
|
||||||
sprintf(buffer, " at offset %d ", offset());
|
stringStream ss;
|
||||||
len += strlen(buffer);
|
ss.print("%s at offset %d (%s:%d)", msg, offset(), file, line);
|
||||||
char * real_msg = new char[len];
|
real_msg = code_string(ss.as_string());
|
||||||
sprintf(real_msg, "%s%s(%s:%d)", msg, buffer, file, line);
|
}
|
||||||
|
|
||||||
// Call indirectly to solve generation ordering problem
|
// Call indirectly to solve generation ordering problem
|
||||||
AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
|
AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
|
||||||
@ -1423,13 +1423,13 @@ void MacroAssembler::_verify_oop_addr(Address addr, const char* msg, const char
|
|||||||
// plausibility check for oops
|
// plausibility check for oops
|
||||||
if (!VerifyOops) return;
|
if (!VerifyOops) return;
|
||||||
|
|
||||||
char buffer[64];
|
const char* real_msg = NULL;
|
||||||
sprintf(buffer, "%d", line);
|
{
|
||||||
int len = strlen(file) + strlen(msg) + 1 + 4 + strlen(buffer);
|
ResourceMark rm;
|
||||||
sprintf(buffer, " at SP+%d ", addr.disp());
|
stringStream ss;
|
||||||
len += strlen(buffer);
|
ss.print("%s at SP+%d (%s:%d)", msg, addr.disp(), file, line);
|
||||||
char * real_msg = new char[len];
|
real_msg = code_string(ss.as_string());
|
||||||
sprintf(real_msg, "%s at SP+%d (%s:%d)", msg, addr.disp(), file, line);
|
}
|
||||||
|
|
||||||
// Call indirectly to solve generation ordering problem
|
// Call indirectly to solve generation ordering problem
|
||||||
AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
|
AddressLiteral a(StubRoutines::verify_oop_subroutine_entry_address());
|
||||||
@ -1622,9 +1622,13 @@ void MacroAssembler::untested(const char* what) {
|
|||||||
// in order to run automated test scripts on the VM
|
// in order to run automated test scripts on the VM
|
||||||
// Use the flag ShowMessageBoxOnError
|
// Use the flag ShowMessageBoxOnError
|
||||||
|
|
||||||
char* b = new char[1024];
|
const char* b = NULL;
|
||||||
sprintf(b, "untested: %s", what);
|
{
|
||||||
|
ResourceMark rm;
|
||||||
|
stringStream ss;
|
||||||
|
ss.print("untested: %s", what);
|
||||||
|
b = code_string(ss.as_string());
|
||||||
|
}
|
||||||
if (ShowMessageBoxOnError) { STOP(b); }
|
if (ShowMessageBoxOnError) { STOP(b); }
|
||||||
else { warn(b); }
|
else { warn(b); }
|
||||||
}
|
}
|
||||||
|
@ -295,14 +295,18 @@ inline bool frame::volatile_across_calls(Register reg) {
|
|||||||
return true;
|
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");
|
||||||
|
|
||||||
|
return (*result_adr);
|
||||||
inline oop frame::saved_oop_result(RegisterMap* map) const {
|
|
||||||
return *((oop*) map->location(rax->as_VMReg()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void frame::set_saved_oop_result(RegisterMap* map, oop obj) {
|
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
|
#endif // CPU_X86_VM_FRAME_X86_INLINE_HPP
|
||||||
|
@ -4262,8 +4262,13 @@ void MacroAssembler::verify_oop(Register reg, const char* s) {
|
|||||||
if (!VerifyOops) return;
|
if (!VerifyOops) return;
|
||||||
|
|
||||||
// Pass register number to verify_oop_subroutine
|
// Pass register number to verify_oop_subroutine
|
||||||
char* b = new char[strlen(s) + 50];
|
const char* b = NULL;
|
||||||
sprintf(b, "verify_oop: %s: %s", reg->name(), s);
|
{
|
||||||
|
ResourceMark rm;
|
||||||
|
stringStream ss;
|
||||||
|
ss.print("verify_oop: %s: %s", reg->name(), s);
|
||||||
|
b = code_string(ss.as_string());
|
||||||
|
}
|
||||||
BLOCK_COMMENT("verify_oop {");
|
BLOCK_COMMENT("verify_oop {");
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
push(rscratch1); // save r10, trashed by movptr()
|
push(rscratch1); // save r10, trashed by movptr()
|
||||||
@ -4297,9 +4302,14 @@ RegisterOrConstant MacroAssembler::delayed_value_impl(intptr_t* delayed_value_ad
|
|||||||
{ Label L;
|
{ Label L;
|
||||||
testptr(tmp, tmp);
|
testptr(tmp, tmp);
|
||||||
if (WizardMode) {
|
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);
|
jcc(Assembler::notZero, L);
|
||||||
char* buf = new char[40];
|
|
||||||
sprintf(buf, "DelayedValue="INTPTR_FORMAT, delayed_value_addr[1]);
|
|
||||||
STOP(buf);
|
STOP(buf);
|
||||||
} else {
|
} else {
|
||||||
jccb(Assembler::notZero, L);
|
jccb(Assembler::notZero, L);
|
||||||
@ -4343,9 +4353,13 @@ void MacroAssembler::verify_oop_addr(Address addr, const char* s) {
|
|||||||
|
|
||||||
// Address adjust(addr.base(), addr.index(), addr.scale(), addr.disp() + BytesPerWord);
|
// Address adjust(addr.base(), addr.index(), addr.scale(), addr.disp() + BytesPerWord);
|
||||||
// Pass register number to verify_oop_subroutine
|
// Pass register number to verify_oop_subroutine
|
||||||
char* b = new char[strlen(s) + 50];
|
const char* b = NULL;
|
||||||
sprintf(b, "verify_oop_addr: %s", s);
|
{
|
||||||
|
ResourceMark rm;
|
||||||
|
stringStream ss;
|
||||||
|
ss.print("verify_oop_addr: %s", s);
|
||||||
|
b = code_string(ss.as_string());
|
||||||
|
}
|
||||||
#ifdef _LP64
|
#ifdef _LP64
|
||||||
push(rscratch1); // save r10, trashed by movptr()
|
push(rscratch1); // save r10, trashed by movptr()
|
||||||
#endif
|
#endif
|
||||||
|
@ -145,12 +145,9 @@ address* Relocation::pd_address_in_code() {
|
|||||||
assert(which == Assembler::disp32_operand ||
|
assert(which == Assembler::disp32_operand ||
|
||||||
which == Assembler::call32_operand ||
|
which == Assembler::call32_operand ||
|
||||||
which == Assembler::imm_operand, "format unpacks ok");
|
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
|
||||||
// The "address" in the code is a displacement can't return it as
|
// and address* since it is really a jint*
|
||||||
// and address* since it is really a jint*
|
guarantee(which == Assembler::imm_operand, "must be immediate operand");
|
||||||
ShouldNotReachHere();
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
assert(which == Assembler::disp32_operand || which == Assembler::imm_operand, "format unpacks ok");
|
assert(which == Assembler::disp32_operand || which == Assembler::imm_operand, "format unpacks ok");
|
||||||
#endif // AMD64
|
#endif // AMD64
|
||||||
|
@ -340,7 +340,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
// here if the underlying file has been truncated.
|
// here if the underlying file has been truncated.
|
||||||
// Do not crash the VM in such a case.
|
// Do not crash the VM in such a case.
|
||||||
CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
|
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()) {
|
if (nm != NULL && nm->has_unsafe_access()) {
|
||||||
stub = StubRoutines::handler_for_unsafe_access();
|
stub = StubRoutines::handler_for_unsafe_access();
|
||||||
}
|
}
|
||||||
|
@ -284,15 +284,19 @@ void AbstractAssembler::update_delayed_values() {
|
|||||||
DelayedConstant::update_all();
|
DelayedConstant::update_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void AbstractAssembler::block_comment(const char* comment) {
|
void AbstractAssembler::block_comment(const char* comment) {
|
||||||
if (sect() == CodeBuffer::SECT_INSTS) {
|
if (sect() == CodeBuffer::SECT_INSTS) {
|
||||||
code_section()->outer()->block_comment(offset(), comment);
|
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) {
|
bool MacroAssembler::needs_explicit_null_check(intptr_t offset) {
|
||||||
// Exception handler checks the nmethod's implicit null checks table
|
// Exception handler checks the nmethod's implicit null checks table
|
||||||
// only when this method returns false.
|
// only when this method returns false.
|
||||||
|
@ -336,6 +336,8 @@ class AbstractAssembler : public ResourceObj {
|
|||||||
// along with the disassembly when printing nmethods. Currently
|
// along with the disassembly when printing nmethods. Currently
|
||||||
// only supported in the instruction section of the code buffer.
|
// only supported in the instruction section of the code buffer.
|
||||||
void block_comment(const char* comment);
|
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
|
// Label functions
|
||||||
void bind(Label& L); // binds an unbound label L to the current code position
|
void bind(Label& L); // binds an unbound label L to the current code position
|
||||||
|
@ -703,8 +703,8 @@ void CodeBuffer::copy_code_to(CodeBlob* dest_blob) {
|
|||||||
this->compute_final_layout(&dest);
|
this->compute_final_layout(&dest);
|
||||||
relocate_code_to(&dest);
|
relocate_code_to(&dest);
|
||||||
|
|
||||||
// transfer comments from buffer to blob
|
// transfer strings and comments from buffer to blob
|
||||||
dest_blob->set_comments(_comments);
|
dest_blob->set_strings(_strings);
|
||||||
|
|
||||||
// Done moving code bytes; were they the right size?
|
// Done moving code bytes; were they the right size?
|
||||||
assert(round_to(dest.total_content_size(), oopSize) == dest_blob->content_size(), "sanity");
|
assert(round_to(dest.total_content_size(), oopSize) == dest_blob->content_size(), "sanity");
|
||||||
@ -1003,58 +1003,78 @@ void CodeSection::decode() {
|
|||||||
|
|
||||||
|
|
||||||
void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
|
void CodeBuffer::block_comment(intptr_t offset, const char * comment) {
|
||||||
_comments.add_comment(offset, comment);
|
_strings.add_comment(offset, comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
class CodeComment: public CHeapObj<mtCode> {
|
const char* CodeBuffer::code_string(const char* str) {
|
||||||
private:
|
return _strings.add_string(str);
|
||||||
friend class CodeComments;
|
}
|
||||||
intptr_t _offset;
|
|
||||||
const char * _comment;
|
|
||||||
CodeComment* _next;
|
|
||||||
|
|
||||||
~CodeComment() {
|
class CodeString: public CHeapObj<mtCode> {
|
||||||
|
private:
|
||||||
|
friend class CodeStrings;
|
||||||
|
const char * _string;
|
||||||
|
CodeString* _next;
|
||||||
|
intptr_t _offset;
|
||||||
|
|
||||||
|
~CodeString() {
|
||||||
assert(_next == NULL, "wrong interface for freeing list");
|
assert(_next == NULL, "wrong interface for freeing list");
|
||||||
os::free((void*)_comment, mtCode);
|
os::free((void*)_string, mtCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_comment() const { return _offset >= 0; }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CodeComment(intptr_t offset, const char * comment) {
|
CodeString(const char * string, intptr_t offset = -1)
|
||||||
_offset = offset;
|
: _next(NULL), _offset(offset) {
|
||||||
_comment = os::strdup(comment, mtCode);
|
_string = os::strdup(string, mtCode);
|
||||||
_next = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
intptr_t offset() const { return _offset; }
|
const char * string() const { return _string; }
|
||||||
const char * comment() const { return _comment; }
|
intptr_t offset() const { assert(_offset >= 0, "offset for non comment?"); return _offset; }
|
||||||
CodeComment* next() { return _next; }
|
CodeString* next() const { return _next; }
|
||||||
|
|
||||||
void set_next(CodeComment* next) { _next = next; }
|
void set_next(CodeString* next) { _next = next; }
|
||||||
|
|
||||||
CodeComment* find(intptr_t offset) {
|
CodeString* first_comment() {
|
||||||
CodeComment* a = this;
|
if (is_comment()) {
|
||||||
while (a != NULL && a->_offset != offset) {
|
return this;
|
||||||
a = a->_next;
|
} else {
|
||||||
|
return next_comment();
|
||||||
}
|
}
|
||||||
return a;
|
|
||||||
}
|
}
|
||||||
|
CodeString* next_comment() const {
|
||||||
// Convenience for add_comment.
|
CodeString* s = _next;
|
||||||
CodeComment* find_last(intptr_t offset) {
|
while (s != NULL && !s->is_comment()) {
|
||||||
CodeComment* a = find(offset);
|
s = s->_next;
|
||||||
if (a != NULL) {
|
|
||||||
while ((a->_next != NULL) && (a->_next->_offset == offset)) {
|
|
||||||
a = a->_next;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return a;
|
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) {
|
// Convenience for add_comment.
|
||||||
CodeComment* c = new CodeComment(offset, comment);
|
CodeString* CodeStrings::find_last(intptr_t offset) const {
|
||||||
CodeComment* inspos = (_comments == NULL) ? NULL : _comments->find_last(offset);
|
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) {
|
if (inspos) {
|
||||||
// insert after already existing comments with same offset
|
// insert after already existing comments with same offset
|
||||||
@ -1062,43 +1082,47 @@ void CodeComments::add_comment(intptr_t offset, const char * comment) {
|
|||||||
inspos->set_next(c);
|
inspos->set_next(c);
|
||||||
} else {
|
} else {
|
||||||
// no comments with such offset, yet. Insert before anything else.
|
// no comments with such offset, yet. Insert before anything else.
|
||||||
c->set_next(_comments);
|
c->set_next(_strings);
|
||||||
_comments = c;
|
_strings = c;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CodeStrings::assign(CodeStrings& other) {
|
||||||
void CodeComments::assign(CodeComments& other) {
|
_strings = other._strings;
|
||||||
_comments = other._comments;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CodeStrings::print_block_comment(outputStream* stream, intptr_t offset) const {
|
||||||
void CodeComments::print_block_comment(outputStream* stream, intptr_t offset) const {
|
if (_strings != NULL) {
|
||||||
if (_comments != NULL) {
|
CodeString* c = find(offset);
|
||||||
CodeComment* c = _comments->find(offset);
|
|
||||||
while (c && c->offset() == offset) {
|
while (c && c->offset() == offset) {
|
||||||
stream->bol();
|
stream->bol();
|
||||||
stream->print(" ;; ");
|
stream->print(" ;; ");
|
||||||
stream->print_cr(c->comment());
|
stream->print_cr(c->string());
|
||||||
c = c->next();
|
c = c->next_comment();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CodeComments::free() {
|
void CodeStrings::free() {
|
||||||
CodeComment* n = _comments;
|
CodeString* n = _strings;
|
||||||
while (n) {
|
while (n) {
|
||||||
// unlink the node from the list saving a pointer to the next
|
// unlink the node from the list saving a pointer to the next
|
||||||
CodeComment* p = n->_next;
|
CodeString* p = n->next();
|
||||||
n->_next = NULL;
|
n->set_next(NULL);
|
||||||
delete n;
|
delete n;
|
||||||
n = p;
|
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() {
|
void CodeBuffer::decode() {
|
||||||
ttyLocker ttyl;
|
ttyLocker ttyl;
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "code/oopRecorder.hpp"
|
#include "code/oopRecorder.hpp"
|
||||||
#include "code/relocInfo.hpp"
|
#include "code/relocInfo.hpp"
|
||||||
|
|
||||||
class CodeComments;
|
class CodeStrings;
|
||||||
class PhaseCFG;
|
class PhaseCFG;
|
||||||
class Compile;
|
class Compile;
|
||||||
class BufferBlob;
|
class BufferBlob;
|
||||||
@ -240,27 +240,31 @@ class CodeSection VALUE_OBJ_CLASS_SPEC {
|
|||||||
#endif //PRODUCT
|
#endif //PRODUCT
|
||||||
};
|
};
|
||||||
|
|
||||||
class CodeComment;
|
class CodeString;
|
||||||
class CodeComments VALUE_OBJ_CLASS_SPEC {
|
class CodeStrings VALUE_OBJ_CLASS_SPEC {
|
||||||
private:
|
private:
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
CodeComment* _comments;
|
CodeString* _strings;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
CodeString* find(intptr_t offset) const;
|
||||||
|
CodeString* find_last(intptr_t offset) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
CodeComments() {
|
CodeStrings() {
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
_comments = NULL;
|
_strings = NULL;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* add_string(const char * string) PRODUCT_RETURN_(return NULL;);
|
||||||
|
|
||||||
void add_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
|
void add_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
|
||||||
void print_block_comment(outputStream* stream, intptr_t offset) const 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;
|
void free() PRODUCT_RETURN;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// A CodeBuffer describes a memory space into which assembly
|
// A CodeBuffer describes a memory space into which assembly
|
||||||
// code is generated. This memory space usually occupies the
|
// code is generated. This memory space usually occupies the
|
||||||
// interior of a single BufferBlob, but in some cases it may be
|
// interior of a single BufferBlob, but in some cases it may be
|
||||||
@ -326,7 +330,7 @@ class CodeBuffer: public StackObj {
|
|||||||
csize_t _total_size; // size in bytes of combined memory buffer
|
csize_t _total_size; // size in bytes of combined memory buffer
|
||||||
|
|
||||||
OopRecorder* _oop_recorder;
|
OopRecorder* _oop_recorder;
|
||||||
CodeComments _comments;
|
CodeStrings _strings;
|
||||||
OopRecorder _default_oop_recorder; // override with initialize_oop_recorder
|
OopRecorder _default_oop_recorder; // override with initialize_oop_recorder
|
||||||
Arena* _overflow_arena;
|
Arena* _overflow_arena;
|
||||||
|
|
||||||
@ -527,7 +531,7 @@ class CodeBuffer: public StackObj {
|
|||||||
void initialize_oop_recorder(OopRecorder* r);
|
void initialize_oop_recorder(OopRecorder* r);
|
||||||
|
|
||||||
OopRecorder* oop_recorder() const { return _oop_recorder; }
|
OopRecorder* oop_recorder() const { return _oop_recorder; }
|
||||||
CodeComments& comments() { return _comments; }
|
CodeStrings& strings() { return _strings; }
|
||||||
|
|
||||||
// Code generation
|
// Code generation
|
||||||
void relocate(address at, RelocationHolder const& rspec, int format = 0) {
|
void relocate(address at, RelocationHolder const& rspec, int format = 0) {
|
||||||
@ -556,6 +560,7 @@ class CodeBuffer: public StackObj {
|
|||||||
address transform_address(const CodeBuffer &cb, address addr) const;
|
address transform_address(const CodeBuffer &cb, address addr) const;
|
||||||
|
|
||||||
void block_comment(intptr_t offset, const char * comment) PRODUCT_RETURN;
|
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
|
// Log a little info about section usage in the CodeBuffer
|
||||||
void log_section_sizes(const char* name);
|
void log_section_sizes(const char* name);
|
||||||
|
@ -802,6 +802,7 @@ ciInstanceKlass* ciEnv::get_instance_klass_for_declared_method_holder(ciKlass* m
|
|||||||
// require checks to make sure the expected type was found. Given that this
|
// 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
|
// only occurs for clone() the more extensive fix seems like overkill so
|
||||||
// instead we simply smear the array type into Object.
|
// instead we simply smear the array type into Object.
|
||||||
|
guarantee(method_holder != NULL, "no method holder");
|
||||||
if (method_holder->is_instance_klass()) {
|
if (method_holder->is_instance_klass()) {
|
||||||
return method_holder->as_instance_klass();
|
return method_holder->as_instance_klass();
|
||||||
} else if (method_holder->is_array_klass()) {
|
} else if (method_holder->is_array_klass()) {
|
||||||
|
@ -348,7 +348,7 @@ class MethodFamily : public ResourceObj {
|
|||||||
|
|
||||||
void disqualify_method(Method* method) {
|
void disqualify_method(Method* method) {
|
||||||
int* index = _member_index.get(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;
|
_members.at(*index).second = DISQUALIFIED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ void CodeBlob::flush() {
|
|||||||
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps, mtCode);
|
FREE_C_HEAP_ARRAY(unsigned char, _oop_maps, mtCode);
|
||||||
_oop_maps = NULL;
|
_oop_maps = NULL;
|
||||||
}
|
}
|
||||||
_comments.free();
|
_strings.free();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
|
|||||||
int _data_offset; // offset to where data region begins
|
int _data_offset; // offset to where data region begins
|
||||||
int _frame_size; // size of stack frame
|
int _frame_size; // size of stack frame
|
||||||
OopMapSet* _oop_maps; // OopMap for this CodeBlob
|
OopMapSet* _oop_maps; // OopMap for this CodeBlob
|
||||||
CodeComments _comments;
|
CodeStrings _strings;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// Returns the space needed for CodeBlob
|
// Returns the space needed for CodeBlob
|
||||||
@ -186,12 +186,12 @@ class CodeBlob VALUE_OBJ_CLASS_SPEC {
|
|||||||
// Print the comment associated with offset on stream, if there is one
|
// Print the comment associated with offset on stream, if there is one
|
||||||
virtual void print_block_comment(outputStream* stream, address block_begin) const {
|
virtual void print_block_comment(outputStream* stream, address block_begin) const {
|
||||||
intptr_t offset = (intptr_t)(block_begin - code_begin());
|
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
|
// Transfer ownership of comments to this CodeBlob
|
||||||
void set_comments(CodeComments& comments) {
|
void set_strings(CodeStrings& strings) {
|
||||||
_comments.assign(comments);
|
_strings.assign(strings);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -552,7 +552,7 @@ bool CompiledStaticCall::is_call_to_interpreted() const {
|
|||||||
|
|
||||||
void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry) {
|
void CompiledStaticCall::set_to_interpreted(methodHandle callee, address entry) {
|
||||||
address stub=find_stub();
|
address stub=find_stub();
|
||||||
assert(stub!=NULL, "stub not found");
|
guarantee(stub != NULL, "stub not found");
|
||||||
|
|
||||||
if (TraceICs) {
|
if (TraceICs) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
|
@ -50,7 +50,7 @@ class ICStub: public Stub {
|
|||||||
friend class ICStubInterface;
|
friend class ICStubInterface;
|
||||||
// This will be called only by ICStubInterface
|
// This will be called only by ICStubInterface
|
||||||
void initialize(int size,
|
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
|
void finalize(); // called when a method is removed
|
||||||
|
|
||||||
// General info
|
// General info
|
||||||
|
@ -101,8 +101,8 @@ Stub* StubQueue::stub_containing(address pc) const {
|
|||||||
|
|
||||||
Stub* StubQueue::request_committed(int code_size) {
|
Stub* StubQueue::request_committed(int code_size) {
|
||||||
Stub* s = request(code_size);
|
Stub* s = request(code_size);
|
||||||
CodeComments comments;
|
CodeStrings strings;
|
||||||
if (s != NULL) commit(code_size, comments);
|
if (s != NULL) commit(code_size, strings);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,8 +119,8 @@ Stub* StubQueue::request(int requested_code_size) {
|
|||||||
assert(_buffer_limit == _buffer_size, "buffer must be fully usable");
|
assert(_buffer_limit == _buffer_size, "buffer must be fully usable");
|
||||||
if (_queue_end + requested_size <= _buffer_size) {
|
if (_queue_end + requested_size <= _buffer_size) {
|
||||||
// code fits in at the end => nothing to do
|
// code fits in at the end => nothing to do
|
||||||
CodeComments comments;
|
CodeStrings strings;
|
||||||
stub_initialize(s, requested_size, comments);
|
stub_initialize(s, requested_size, strings);
|
||||||
return s;
|
return s;
|
||||||
} else {
|
} else {
|
||||||
// stub doesn't fit in at the queue end
|
// stub doesn't fit in at the queue end
|
||||||
@ -137,8 +137,8 @@ Stub* StubQueue::request(int requested_code_size) {
|
|||||||
// Queue: |XXX|.......|XXXXXXX|.......|
|
// Queue: |XXX|.......|XXXXXXX|.......|
|
||||||
// ^0 ^end ^begin ^limit ^size
|
// ^0 ^end ^begin ^limit ^size
|
||||||
s = current_stub();
|
s = current_stub();
|
||||||
CodeComments comments;
|
CodeStrings strings;
|
||||||
stub_initialize(s, requested_size, comments);
|
stub_initialize(s, requested_size, strings);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
// Not enough space left
|
// Not enough space left
|
||||||
@ -147,12 +147,12 @@ Stub* StubQueue::request(int requested_code_size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
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");
|
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);
|
int committed_size = round_to(stub_code_size_to_size(committed_code_size), CodeEntryAlignment);
|
||||||
Stub* s = current_stub();
|
Stub* s = current_stub();
|
||||||
assert(committed_size <= stub_size(s), "committed size must not exceed requested size");
|
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;
|
_queue_end += committed_size;
|
||||||
_number_of_stubs++;
|
_number_of_stubs++;
|
||||||
if (_mutex != NULL) _mutex->unlock();
|
if (_mutex != NULL) _mutex->unlock();
|
||||||
|
@ -73,7 +73,7 @@ class Stub VALUE_OBJ_CLASS_SPEC {
|
|||||||
public:
|
public:
|
||||||
// Initialization/finalization
|
// Initialization/finalization
|
||||||
void initialize(int size,
|
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
|
void finalize() { ShouldNotCallThis(); } // called before the stub is deallocated
|
||||||
|
|
||||||
// General info/converters
|
// General info/converters
|
||||||
@ -107,7 +107,7 @@ class StubInterface: public CHeapObj<mtCode> {
|
|||||||
public:
|
public:
|
||||||
// Initialization/finalization
|
// Initialization/finalization
|
||||||
virtual void initialize(Stub* self, int size,
|
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
|
virtual void finalize(Stub* self) = 0; // called before deallocation
|
||||||
|
|
||||||
// General info/converters
|
// General info/converters
|
||||||
@ -136,7 +136,7 @@ class StubInterface: public CHeapObj<mtCode> {
|
|||||||
public: \
|
public: \
|
||||||
/* Initialization/finalization */ \
|
/* Initialization/finalization */ \
|
||||||
virtual void initialize(Stub* self, int size, \
|
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(); } \
|
virtual void finalize(Stub* self) { cast(self)->finalize(); } \
|
||||||
\
|
\
|
||||||
/* General info */ \
|
/* General info */ \
|
||||||
@ -176,7 +176,7 @@ class StubQueue: public CHeapObj<mtCode> {
|
|||||||
|
|
||||||
// Stub functionality accessed via interface
|
// Stub functionality accessed via interface
|
||||||
void stub_initialize(Stub* s, int size,
|
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); }
|
void stub_finalize(Stub* s) { _stub_interface->finalize(s); }
|
||||||
int stub_size(Stub* s) const { return _stub_interface->size(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); }
|
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 @@ class StubQueue: public CHeapObj<mtCode> {
|
|||||||
Stub* request_committed(int code_size); // request a stub that provides exactly code_size space for code
|
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
|
Stub* request(int requested_code_size); // request a stub with a (maximum) code space - locks the queue
|
||||||
void commit (int committed_code_size,
|
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
|
// Stub deallocation
|
||||||
void remove_first(); // remove the first stub in the queue
|
void remove_first(); // remove the first stub in the queue
|
||||||
|
@ -65,9 +65,8 @@ HS_DTRACE_PROBE_DECL8(hotspot, method__compile__begin,
|
|||||||
HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
|
HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
|
||||||
char*, intptr_t, char*, intptr_t, char*, intptr_t, char*, intptr_t, bool);
|
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* klass_name = (method)->klass_name(); \
|
||||||
Symbol* name = (method)->name(); \
|
Symbol* name = (method)->name(); \
|
||||||
Symbol* signature = (method)->signature(); \
|
Symbol* signature = (method)->signature(); \
|
||||||
@ -78,9 +77,9 @@ HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
|
|||||||
signature->bytes(), signature->utf8_length()); \
|
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* klass_name = (method)->klass_name(); \
|
||||||
Symbol* name = (method)->name(); \
|
Symbol* name = (method)->name(); \
|
||||||
Symbol* signature = (method)->signature(); \
|
Symbol* signature = (method)->signature(); \
|
||||||
@ -93,22 +92,21 @@ HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
|
|||||||
|
|
||||||
#else /* USDT2 */
|
#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* klass_name = (method)->klass_name(); \
|
||||||
Symbol* name = (method)->name(); \
|
Symbol* name = (method)->name(); \
|
||||||
Symbol* signature = (method)->signature(); \
|
Symbol* signature = (method)->signature(); \
|
||||||
HOTSPOT_METHOD_COMPILE_BEGIN( \
|
HOTSPOT_METHOD_COMPILE_BEGIN( \
|
||||||
comp_name, strlen(comp_name), \
|
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 *) name->bytes(), name->utf8_length(), \
|
||||||
(char *) signature->bytes(), signature->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* klass_name = (method)->klass_name(); \
|
||||||
Symbol* name = (method)->name(); \
|
Symbol* name = (method)->name(); \
|
||||||
Symbol* signature = (method)->signature(); \
|
Symbol* signature = (method)->signature(); \
|
||||||
@ -122,8 +120,8 @@ HS_DTRACE_PROBE_DECL9(hotspot, method__compile__end,
|
|||||||
|
|
||||||
#else // ndef DTRACE_ENABLED
|
#else // ndef DTRACE_ENABLED
|
||||||
|
|
||||||
#define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method)
|
#define DTRACE_METHOD_COMPILE_BEGIN_PROBE(compiler, method, comp_name)
|
||||||
#define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, success)
|
#define DTRACE_METHOD_COMPILE_END_PROBE(compiler, method, comp_name, success)
|
||||||
|
|
||||||
#endif // ndef DTRACE_ENABLED
|
#endif // ndef DTRACE_ENABLED
|
||||||
|
|
||||||
@ -359,7 +357,7 @@ void CompileTask::print() {
|
|||||||
//
|
//
|
||||||
void CompileTask::print_line_on_error(outputStream* st, char* buf, int buflen) {
|
void CompileTask::print_line_on_error(outputStream* st, char* buf, int buflen) {
|
||||||
// print compiler name
|
// print compiler name
|
||||||
st->print("%s:", CompileBroker::compiler(comp_level())->name());
|
st->print("%s:", CompileBroker::compiler_name(comp_level()));
|
||||||
print_compilation(st);
|
print_compilation(st);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -368,7 +366,7 @@ void CompileTask::print_line_on_error(outputStream* st, char* buf, int buflen) {
|
|||||||
void CompileTask::print_line() {
|
void CompileTask::print_line() {
|
||||||
ttyLocker ttyl; // keep the following output all in one block
|
ttyLocker ttyl; // keep the following output all in one block
|
||||||
// print compiler name if requested
|
// 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();
|
print_compilation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1217,8 +1215,9 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
|
|||||||
|
|
||||||
// lock, make sure that the compilation
|
// lock, make sure that the compilation
|
||||||
// isn't prohibited in a straightforward way.
|
// isn't prohibited in a straightforward way.
|
||||||
|
AbstractCompiler *comp = CompileBroker::compiler(comp_level);
|
||||||
if (compiler(comp_level) == NULL || !compiler(comp_level)->can_compile_method(method) || compilation_is_prohibited(method, osr_bci, comp_level)) {
|
if (comp == NULL || !comp->can_compile_method(method) ||
|
||||||
|
compilation_is_prohibited(method, osr_bci, comp_level)) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1255,7 +1254,7 @@ nmethod* CompileBroker::compile_method(methodHandle method, int osr_bci,
|
|||||||
|
|
||||||
assert(!HAS_PENDING_EXCEPTION, "No exception should be present");
|
assert(!HAS_PENDING_EXCEPTION, "No exception should be present");
|
||||||
// some prerequisites that are compiler specific
|
// 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);
|
method->constants()->resolve_string_constants(CHECK_AND_CLEAR_NULL);
|
||||||
// Resolve all classes seen in the signature of the method
|
// Resolve all classes seen in the signature of the method
|
||||||
// we are compiling.
|
// we are compiling.
|
||||||
@ -1372,8 +1371,9 @@ bool CompileBroker::compilation_is_in_queue(methodHandle method,
|
|||||||
bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level) {
|
bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci, int comp_level) {
|
||||||
bool is_native = method->is_native();
|
bool is_native = method->is_native();
|
||||||
// Some compilers may not support the compilation of natives.
|
// Some compilers may not support the compilation of natives.
|
||||||
|
AbstractCompiler *comp = compiler(comp_level);
|
||||||
if (is_native &&
|
if (is_native &&
|
||||||
(!CICompileNatives || !compiler(comp_level)->supports_native())) {
|
(!CICompileNatives || comp == NULL || !comp->supports_native())) {
|
||||||
method->set_not_compilable_quietly(comp_level);
|
method->set_not_compilable_quietly(comp_level);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1381,7 +1381,7 @@ bool CompileBroker::compilation_is_prohibited(methodHandle method, int osr_bci,
|
|||||||
bool is_osr = (osr_bci != standard_entry_bci);
|
bool is_osr = (osr_bci != standard_entry_bci);
|
||||||
// Some compilers may not support on stack replacement.
|
// Some compilers may not support on stack replacement.
|
||||||
if (is_osr &&
|
if (is_osr &&
|
||||||
(!CICompileOSR || !compiler(comp_level)->supports_osr())) {
|
(!CICompileOSR || comp == NULL || !comp->supports_osr())) {
|
||||||
method->set_not_osr_compilable(comp_level);
|
method->set_not_osr_compilable(comp_level);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1753,6 +1753,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||||||
bool is_osr = (osr_bci != standard_entry_bci);
|
bool is_osr = (osr_bci != standard_entry_bci);
|
||||||
bool should_log = (thread->log() != NULL);
|
bool should_log = (thread->log() != NULL);
|
||||||
bool should_break = false;
|
bool should_break = false;
|
||||||
|
int task_level = task->comp_level();
|
||||||
{
|
{
|
||||||
// create the handle inside it's own block so it can't
|
// create the handle inside it's own block so it can't
|
||||||
// accidentally be referenced once the thread transitions to
|
// accidentally be referenced once the thread transitions to
|
||||||
@ -1766,9 +1767,10 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||||||
assert(!method->is_native(), "no longer compile natives");
|
assert(!method->is_native(), "no longer compile natives");
|
||||||
|
|
||||||
// Save information about this method in case of failure.
|
// 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.
|
// Allocate a new set of JNI handles.
|
||||||
@ -1805,7 +1807,12 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||||||
|
|
||||||
TraceTime t1("compilation", &time);
|
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) {
|
if (!ci_env.failing() && task->code() == NULL) {
|
||||||
//assert(false, "compiler should always document failure");
|
//assert(false, "compiler should always document failure");
|
||||||
@ -1843,7 +1850,8 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||||||
|
|
||||||
methodHandle method(thread, task->method());
|
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);
|
collect_statistics(thread, time, task);
|
||||||
|
|
||||||
@ -1868,9 +1876,9 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
|
|||||||
break;
|
break;
|
||||||
case ciEnv::MethodCompilable_not_at_tier:
|
case ciEnv::MethodCompilable_not_at_tier:
|
||||||
if (is_osr)
|
if (is_osr)
|
||||||
method->set_not_osr_compilable_quietly(task->comp_level());
|
method->set_not_osr_compilable_quietly(task_level);
|
||||||
else
|
else
|
||||||
method->set_not_compilable_quietly(task->comp_level());
|
method->set_not_compilable_quietly(task_level);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2128,7 +2136,14 @@ void CompileBroker::collect_statistics(CompilerThread* thread, elapsedTimer time
|
|||||||
if (UsePerfData) counters->set_current_method("");
|
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() {
|
void CompileBroker::print_times() {
|
||||||
tty->cr();
|
tty->cr();
|
||||||
@ -2142,11 +2157,13 @@ void CompileBroker::print_times() {
|
|||||||
CompileBroker::_t_standard_compilation.seconds() / CompileBroker::_total_standard_compile_count);
|
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);
|
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) {
|
AbstractCompiler *comp = compiler(CompLevel_simple);
|
||||||
compiler(CompLevel_simple)->print_timers();
|
if (comp != NULL) {
|
||||||
|
comp->print_timers();
|
||||||
}
|
}
|
||||||
if (compiler(CompLevel_full_optimization) != NULL) {
|
comp = compiler(CompLevel_full_optimization);
|
||||||
compiler(CompLevel_full_optimization)->print_timers();
|
if (comp != NULL) {
|
||||||
|
comp->print_timers();
|
||||||
}
|
}
|
||||||
tty->cr();
|
tty->cr();
|
||||||
int tcb = CompileBroker::_sum_osr_bytes_compiled + CompileBroker::_sum_standard_bytes_compiled;
|
int tcb = CompileBroker::_sum_osr_bytes_compiled + CompileBroker::_sum_standard_bytes_compiled;
|
||||||
|
@ -418,6 +418,9 @@ class CompileBroker: AllStatic {
|
|||||||
static void print_last_compile();
|
static void print_last_compile();
|
||||||
|
|
||||||
static void print_compiler_threads_on(outputStream* st);
|
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
|
#endif // SHARE_VM_COMPILER_COMPILEBROKER_HPP
|
||||||
|
@ -158,7 +158,7 @@ class decode_env {
|
|||||||
private:
|
private:
|
||||||
nmethod* _nm;
|
nmethod* _nm;
|
||||||
CodeBlob* _code;
|
CodeBlob* _code;
|
||||||
CodeComments _comments;
|
CodeStrings _strings;
|
||||||
outputStream* _output;
|
outputStream* _output;
|
||||||
address _start, _end;
|
address _start, _end;
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ class decode_env {
|
|||||||
void print_address(address value);
|
void print_address(address value);
|
||||||
|
|
||||||
public:
|
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);
|
address decode_instructions(address start, address end);
|
||||||
|
|
||||||
@ -242,13 +242,13 @@ class decode_env {
|
|||||||
const char* options() { return _option_buf; }
|
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));
|
memset(this, 0, sizeof(*this));
|
||||||
_output = output ? output : tty;
|
_output = output ? output : tty;
|
||||||
_code = code;
|
_code = code;
|
||||||
if (code != NULL && code->is_nmethod())
|
if (code != NULL && code->is_nmethod())
|
||||||
_nm = (nmethod*) code;
|
_nm = (nmethod*) code;
|
||||||
_comments.assign(c);
|
_strings.assign(c);
|
||||||
|
|
||||||
// by default, output pc but not bytes:
|
// by default, output pc but not bytes:
|
||||||
_print_pc = true;
|
_print_pc = true;
|
||||||
@ -370,7 +370,7 @@ void decode_env::print_insn_labels() {
|
|||||||
if (cb != NULL) {
|
if (cb != NULL) {
|
||||||
cb->print_block_comment(st, p);
|
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) {
|
if (_print_pc) {
|
||||||
st->print(" " PTR_FORMAT ": ", p);
|
st->print(" " PTR_FORMAT ": ", p);
|
||||||
}
|
}
|
||||||
@ -498,7 +498,7 @@ void Disassembler::decode(CodeBlob* cb, outputStream* st) {
|
|||||||
env.decode_instructions(cb->code_begin(), cb->code_end());
|
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;
|
if (!load_library()) return;
|
||||||
decode_env env(CodeCache::find_blob_unsafe(start), st, c);
|
decode_env env(CodeCache::find_blob_unsafe(start), st, c);
|
||||||
env.decode_instructions(start, end);
|
env.decode_instructions(start, end);
|
||||||
|
@ -100,7 +100,7 @@ class Disassembler {
|
|||||||
}
|
}
|
||||||
static void decode(CodeBlob *cb, outputStream* st = NULL);
|
static void decode(CodeBlob *cb, outputStream* st = NULL);
|
||||||
static void decode(nmethod* nm, 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
|
#endif // SHARE_VM_COMPILER_DISASSEMBLER_HPP
|
||||||
|
@ -76,7 +76,7 @@ void InterpreterCodelet::print_on(outputStream* st) const {
|
|||||||
|
|
||||||
if (PrintInterpreter) {
|
if (PrintInterpreter) {
|
||||||
st->cr();
|
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()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,12 +48,12 @@ class InterpreterCodelet: public Stub {
|
|||||||
int _size; // the size in bytes
|
int _size; // the size in bytes
|
||||||
const char* _description; // a description of the codelet, for debugging & printing
|
const char* _description; // a description of the codelet, for debugging & printing
|
||||||
Bytecodes::Code _bytecode; // associated bytecode if any
|
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:
|
public:
|
||||||
// Initialization/finalization
|
// Initialization/finalization
|
||||||
void initialize(int size,
|
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(); }
|
void finalize() { ShouldNotCallThis(); }
|
||||||
|
|
||||||
// General info/converters
|
// General info/converters
|
||||||
@ -131,7 +131,7 @@ class CodeletMark: ResourceMark {
|
|||||||
|
|
||||||
|
|
||||||
// commit Codelet
|
// 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
|
// make sure nobody can use _masm outside a CodeletMark lifespan
|
||||||
*_masm = NULL;
|
*_masm = NULL;
|
||||||
}
|
}
|
||||||
|
@ -178,7 +178,7 @@ void SharedHeap::process_strong_roots(bool activate_scope,
|
|||||||
SystemDictionary::always_strong_oops_do(roots);
|
SystemDictionary::always_strong_oops_do(roots);
|
||||||
ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, !is_scavenging);
|
ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, !is_scavenging);
|
||||||
} else {
|
} 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");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1852,6 +1852,7 @@ void ConstantPool::print_entry_on(const int index, outputStream* st) {
|
|||||||
switch (tag_at(index).value()) {
|
switch (tag_at(index).value()) {
|
||||||
case JVM_CONSTANT_Class :
|
case JVM_CONSTANT_Class :
|
||||||
{ Klass* k = klass_at(index, CATCH);
|
{ Klass* k = klass_at(index, CATCH);
|
||||||
|
guarantee(k != NULL, "need klass");
|
||||||
k->print_value_on(st);
|
k->print_value_on(st);
|
||||||
st->print(" {0x%lx}", (address)k);
|
st->print(" {0x%lx}", (address)k);
|
||||||
}
|
}
|
||||||
|
@ -108,11 +108,11 @@ class FieldInfo VALUE_OBJ_CLASS_SPEC {
|
|||||||
return build_int_from_shorts(_shorts[low_packed_offset], _shorts[high_packed_offset]) >> FIELDINFO_TAG_SIZE;
|
return build_int_from_shorts(_shorts[low_packed_offset], _shorts[high_packed_offset]) >> FIELDINFO_TAG_SIZE;
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
case FIELDINFO_TAG_TYPE_PLAIN:
|
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:
|
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:
|
case FIELDINFO_TAG_BLANK:
|
||||||
ShouldNotReachHere2("Asking offset for the blank field");
|
fatal("Asking offset for the blank field");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
@ -128,9 +128,9 @@ class FieldInfo VALUE_OBJ_CLASS_SPEC {
|
|||||||
return true;
|
return true;
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
case FIELDINFO_TAG_OFFSET:
|
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:
|
case FIELDINFO_TAG_BLANK:
|
||||||
ShouldNotReachHere2("Asking contended flag for the blank field");
|
fatal("Asking contended flag for the blank field");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
@ -146,9 +146,9 @@ class FieldInfo VALUE_OBJ_CLASS_SPEC {
|
|||||||
return _shorts[high_packed_offset];
|
return _shorts[high_packed_offset];
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
case FIELDINFO_TAG_OFFSET:
|
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:
|
case FIELDINFO_TAG_BLANK:
|
||||||
ShouldNotReachHere2("Asking the contended group for the blank field");
|
fatal("Asking the contended group for the blank field");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
@ -163,9 +163,9 @@ class FieldInfo VALUE_OBJ_CLASS_SPEC {
|
|||||||
return (lo >> FIELDINFO_TAG_SIZE);
|
return (lo >> FIELDINFO_TAG_SIZE);
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
case FIELDINFO_TAG_OFFSET:
|
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:
|
case FIELDINFO_TAG_BLANK:
|
||||||
ShouldNotReachHere2("Asking the field type for the blank field");
|
fatal("Asking the field type for the blank field");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
@ -211,7 +211,7 @@ class FieldInfo VALUE_OBJ_CLASS_SPEC {
|
|||||||
case FIELDINFO_TAG_TYPE_PLAIN:
|
case FIELDINFO_TAG_TYPE_PLAIN:
|
||||||
case FIELDINFO_TAG_TYPE_CONTENDED:
|
case FIELDINFO_TAG_TYPE_CONTENDED:
|
||||||
case FIELDINFO_TAG_OFFSET:
|
case FIELDINFO_TAG_OFFSET:
|
||||||
ShouldNotReachHere2("Setting the field type with overwriting");
|
fatal("Setting the field type with overwriting");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
@ -226,11 +226,11 @@ class FieldInfo VALUE_OBJ_CLASS_SPEC {
|
|||||||
return;
|
return;
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
case FIELDINFO_TAG_TYPE_CONTENDED:
|
case FIELDINFO_TAG_TYPE_CONTENDED:
|
||||||
ShouldNotReachHere2("Overwriting contended group");
|
fatal("Overwriting contended group");
|
||||||
case FIELDINFO_TAG_BLANK:
|
case FIELDINFO_TAG_BLANK:
|
||||||
ShouldNotReachHere2("Setting contended group for the blank field");
|
fatal("Setting contended group for the blank field");
|
||||||
case FIELDINFO_TAG_OFFSET:
|
case FIELDINFO_TAG_OFFSET:
|
||||||
ShouldNotReachHere2("Setting contended group for field with offset");
|
fatal("Setting contended group for field with offset");
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
|
@ -762,6 +762,7 @@ void GenerateOopMap::copy_state(CellTypeState *dst, CellTypeState *src) {
|
|||||||
// monitor matching is purely informational and doesn't say anything
|
// monitor matching is purely informational and doesn't say anything
|
||||||
// about the correctness of the code.
|
// about the correctness of the code.
|
||||||
void GenerateOopMap::merge_state_into_bb(BasicBlock *bb) {
|
void GenerateOopMap::merge_state_into_bb(BasicBlock *bb) {
|
||||||
|
guarantee(bb != NULL, "null basicblock");
|
||||||
assert(bb->is_alive(), "merging state into a dead basicblock");
|
assert(bb->is_alive(), "merging state into a dead basicblock");
|
||||||
|
|
||||||
if (_stack_top == bb->_stack_top) {
|
if (_stack_top == bb->_stack_top) {
|
||||||
@ -1189,6 +1190,7 @@ void GenerateOopMap::do_exception_edge(BytecodeStream* itr) {
|
|||||||
|
|
||||||
if (start_pc <= bci && bci < end_pc) {
|
if (start_pc <= bci && bci < end_pc) {
|
||||||
BasicBlock *excBB = get_basic_block_at(handler_pc);
|
BasicBlock *excBB = get_basic_block_at(handler_pc);
|
||||||
|
guarantee(excBB != NULL, "no basic block for exception");
|
||||||
CellTypeState *excStk = excBB->stack();
|
CellTypeState *excStk = excBB->stack();
|
||||||
CellTypeState *cOpStck = stack();
|
CellTypeState *cOpStck = stack();
|
||||||
CellTypeState cOpStck_0 = cOpStck[0];
|
CellTypeState cOpStck_0 = cOpStck[0];
|
||||||
@ -1803,6 +1805,7 @@ void GenerateOopMap::do_monitorexit(int bci) {
|
|||||||
// possibility that this bytecode will throw an
|
// possibility that this bytecode will throw an
|
||||||
// exception.
|
// exception.
|
||||||
BasicBlock* bb = get_basic_block_containing(bci);
|
BasicBlock* bb = get_basic_block_containing(bci);
|
||||||
|
guarantee(bb != NULL, "no basic block for bci");
|
||||||
bb->set_changed(true);
|
bb->set_changed(true);
|
||||||
bb->_monitor_top = bad_monitors;
|
bb->_monitor_top = bad_monitors;
|
||||||
|
|
||||||
@ -2190,6 +2193,7 @@ void GenerateOopMap::result_for_basicblock(int bci) {
|
|||||||
|
|
||||||
// Find basicblock and report results
|
// Find basicblock and report results
|
||||||
BasicBlock* bb = get_basic_block_containing(bci);
|
BasicBlock* bb = get_basic_block_containing(bci);
|
||||||
|
guarantee(bb != NULL, "no basic block for bci");
|
||||||
assert(bb->is_reachable(), "getting result from unreachable basicblock");
|
assert(bb->is_reachable(), "getting result from unreachable basicblock");
|
||||||
bb->set_changed(true);
|
bb->set_changed(true);
|
||||||
interp_bb(bb);
|
interp_bb(bb);
|
||||||
|
@ -157,9 +157,10 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
|
|||||||
} else {
|
} else {
|
||||||
// Not hot. Check for medium-sized pre-existing nmethod at cold sites.
|
// Not hot. Check for medium-sized pre-existing nmethod at cold sites.
|
||||||
if (callee_method->has_compiled_code() &&
|
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");
|
set_msg("already compiled into a medium method");
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (size > max_inline_size) {
|
if (size > max_inline_size) {
|
||||||
if (max_inline_size > default_max_inline_size) {
|
if (max_inline_size > default_max_inline_size) {
|
||||||
|
@ -888,6 +888,7 @@ void PhaseIdealLoop::insert_pre_post_loops( IdealLoopTree *loop, Node_List &old_
|
|||||||
CountedLoopNode *main_head = loop->_head->as_CountedLoop();
|
CountedLoopNode *main_head = loop->_head->as_CountedLoop();
|
||||||
assert( main_head->is_normal_loop(), "" );
|
assert( main_head->is_normal_loop(), "" );
|
||||||
CountedLoopEndNode *main_end = main_head->loopexit();
|
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" );
|
assert( main_end->outcnt() == 2, "1 true, 1 false path only" );
|
||||||
uint dd_main_head = dom_depth(main_head);
|
uint dd_main_head = dom_depth(main_head);
|
||||||
uint max = main_head->outcnt();
|
uint max = main_head->outcnt();
|
||||||
@ -2554,13 +2555,16 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st
|
|||||||
ok.set(store->_idx);
|
ok.set(store->_idx);
|
||||||
ok.set(store->in(MemNode::Memory)->_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
|
// Loop structure is ok
|
||||||
ok.set(head->_idx);
|
ok.set(head->_idx);
|
||||||
ok.set(head->loopexit()->_idx);
|
ok.set(loop_exit->_idx);
|
||||||
ok.set(head->phi()->_idx);
|
ok.set(head->phi()->_idx);
|
||||||
ok.set(head->incr()->_idx);
|
ok.set(head->incr()->_idx);
|
||||||
ok.set(head->loopexit()->cmp_node()->_idx);
|
ok.set(loop_exit->cmp_node()->_idx);
|
||||||
ok.set(head->loopexit()->in(1)->_idx);
|
ok.set(loop_exit->in(1)->_idx);
|
||||||
|
|
||||||
// Address elements are ok
|
// Address elements are ok
|
||||||
if (con) ok.set(con->_idx);
|
if (con) ok.set(con->_idx);
|
||||||
@ -2572,7 +2576,7 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st
|
|||||||
if (n->outcnt() == 0) continue; // Ignore dead
|
if (n->outcnt() == 0) continue; // Ignore dead
|
||||||
if (ok.test(n->_idx)) continue;
|
if (ok.test(n->_idx)) continue;
|
||||||
// Backedge projection is ok
|
// 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()) {
|
if (!n->is_AddP()) {
|
||||||
msg = "unhandled node";
|
msg = "unhandled node";
|
||||||
msg_node = n;
|
msg_node = n;
|
||||||
@ -2585,7 +2589,7 @@ bool PhaseIdealLoop::match_fill_loop(IdealLoopTree* lpt, Node*& store, Node*& st
|
|||||||
Node* n = lpt->_body.at(i);
|
Node* n = lpt->_body.at(i);
|
||||||
// These values can be replaced with other nodes if they are used
|
// These values can be replaced with other nodes if they are used
|
||||||
// outside the loop.
|
// 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()) {
|
for (SimpleDUIterator iter(n); iter.has_next(); iter.next()) {
|
||||||
Node* use = iter.get();
|
Node* use = iter.get();
|
||||||
if (!lpt->_body.contains(use)) {
|
if (!lpt->_body.contains(use)) {
|
||||||
|
@ -603,7 +603,10 @@ class PhaseIdealLoop : public PhaseTransform {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public:
|
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
|
// check if transform created new nodes that need _ctrl recorded
|
||||||
Node *get_late_ctrl( Node *n, Node *early );
|
Node *get_late_ctrl( Node *n, Node *early );
|
||||||
Node *get_early_ctrl( Node *n );
|
Node *get_early_ctrl( Node *n );
|
||||||
@ -737,7 +740,8 @@ private:
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
uint dom_depth(Node* d) const {
|
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];
|
return _dom_depth[d->_idx];
|
||||||
}
|
}
|
||||||
void set_idom(Node* d, Node* n, uint dom_depth);
|
void set_idom(Node* d, Node* n, uint dom_depth);
|
||||||
|
@ -232,7 +232,11 @@ void PhaseIdealLoop::dominated_by( Node *prevdom, Node *iff, bool flip, bool exc
|
|||||||
// Loop predicates may have depending checks which should not
|
// Loop predicates may have depending checks which should not
|
||||||
// be skipped. For example, range check predicate has two checks
|
// be skipped. For example, range check predicate has two checks
|
||||||
// for lower and upper bounds.
|
// 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 &&
|
if (exclude_loop_predicate &&
|
||||||
is_uncommon_trap_proj(unc_proj, Deoptimization::Reason_predicate))
|
is_uncommon_trap_proj(unc_proj, Deoptimization::Reason_predicate))
|
||||||
return; // Let IGVN transformation change control dependence.
|
return; // Let IGVN transformation change control dependence.
|
||||||
@ -866,8 +870,11 @@ void PhaseIdealLoop::split_if_with_blocks_post( Node *n ) {
|
|||||||
|
|
||||||
// Now split the bool up thru the phi
|
// Now split the bool up thru the phi
|
||||||
Node *bolphi = split_thru_phi( bol, n_ctrl, -1 );
|
Node *bolphi = split_thru_phi( bol, n_ctrl, -1 );
|
||||||
|
guarantee(bolphi != NULL, "null boolean phi node");
|
||||||
|
|
||||||
_igvn.replace_node( bol, bolphi );
|
_igvn.replace_node( bol, bolphi );
|
||||||
assert( iff->in(1) == bolphi, "" );
|
assert( iff->in(1) == bolphi, "" );
|
||||||
|
|
||||||
if( bolphi->Value(&_igvn)->singleton() )
|
if( bolphi->Value(&_igvn)->singleton() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -1628,6 +1635,7 @@ ProjNode* PhaseIdealLoop::proj_clone(ProjNode* p, IfNode* iff) {
|
|||||||
//------------------------------ short_circuit_if -------------------------------------
|
//------------------------------ short_circuit_if -------------------------------------
|
||||||
// Force the iff control output to be the live_proj
|
// Force the iff control output to be the live_proj
|
||||||
Node* PhaseIdealLoop::short_circuit_if(IfNode* iff, ProjNode* live_proj) {
|
Node* PhaseIdealLoop::short_circuit_if(IfNode* iff, ProjNode* live_proj) {
|
||||||
|
guarantee(live_proj != NULL, "null projection");
|
||||||
int proj_con = live_proj->_con;
|
int proj_con = live_proj->_con;
|
||||||
assert(proj_con == 0 || proj_con == 1, "false or true projection");
|
assert(proj_con == 0 || proj_con == 1, "false or true projection");
|
||||||
Node *con = _igvn.intcon(proj_con);
|
Node *con = _igvn.intcon(proj_con);
|
||||||
@ -1686,6 +1694,7 @@ ProjNode* PhaseIdealLoop::insert_if_before_proj(Node* left, bool Signed, BoolTes
|
|||||||
set_idom(proj, new_if, ddepth);
|
set_idom(proj, new_if, ddepth);
|
||||||
|
|
||||||
ProjNode* new_exit = proj_clone(other_proj, new_if)->as_Proj();
|
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);
|
register_node(new_exit, get_loop(other_proj), new_if, ddepth);
|
||||||
|
|
||||||
return new_exit;
|
return new_exit;
|
||||||
@ -1793,7 +1802,10 @@ IfNode* PhaseIdealLoop::insert_cmpi_loop_exit(IfNode* if_cmpu, IdealLoopTree *lo
|
|||||||
int stride = stride_of_possible_iv(if_cmpu);
|
int stride = stride_of_possible_iv(if_cmpu);
|
||||||
if (stride == 0) return NULL;
|
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();
|
ProjNode* lp_exit = if_cmpu->proj_out(!lp_continue->is_IfTrue())->as_Proj();
|
||||||
|
|
||||||
Node* limit = NULL;
|
Node* limit = NULL;
|
||||||
@ -1805,6 +1817,7 @@ IfNode* PhaseIdealLoop::insert_cmpi_loop_exit(IfNode* if_cmpu, IdealLoopTree *lo
|
|||||||
}
|
}
|
||||||
// Create a new region on the exit path
|
// Create a new region on the exit path
|
||||||
RegionNode* reg = insert_region_before_proj(lp_exit);
|
RegionNode* reg = insert_region_before_proj(lp_exit);
|
||||||
|
guarantee(reg != NULL, "null region node");
|
||||||
|
|
||||||
// Clone the if-cmpu-true-false using a signed compare
|
// Clone the if-cmpu-true-false using a signed compare
|
||||||
BoolTest::mask rel_i = stride > 0 ? bol->_test._test : BoolTest::ge;
|
BoolTest::mask rel_i = stride > 0 ? bol->_test._test : BoolTest::ge;
|
||||||
|
@ -2518,6 +2518,7 @@ void Scheduling::DoScheduling() {
|
|||||||
// Schedule the remaining instructions in the block
|
// Schedule the remaining instructions in the block
|
||||||
while ( _available.size() > 0 ) {
|
while ( _available.size() > 0 ) {
|
||||||
Node *n = ChooseNodeToBundle();
|
Node *n = ChooseNodeToBundle();
|
||||||
|
guarantee(n != NULL, "no nodes available");
|
||||||
AddNodeToBundle(n,bb);
|
AddNodeToBundle(n,bb);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4193,6 +4193,7 @@ const TypeOopPtr* TypeKlassPtr::as_instance_type() const {
|
|||||||
bool xk = klass_is_exact();
|
bool xk = klass_is_exact();
|
||||||
//return TypeInstPtr::make(TypePtr::NotNull, k, xk, NULL, 0);
|
//return TypeInstPtr::make(TypePtr::NotNull, k, xk, NULL, 0);
|
||||||
const TypeOopPtr* toop = TypeOopPtr::make_from_klass_raw(k);
|
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();
|
toop = toop->cast_to_ptr_type(TypePtr::NotNull)->is_oopptr();
|
||||||
return toop->cast_to_exactness(xk)->is_oopptr();
|
return toop->cast_to_exactness(xk)->is_oopptr();
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ StubCodeGenerator::~StubCodeGenerator() {
|
|||||||
CodeBuffer* cbuf = _masm->code();
|
CodeBuffer* cbuf = _masm->code();
|
||||||
CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
|
CodeBlob* blob = CodeCache::find_blob_unsafe(cbuf->insts()->start());
|
||||||
if (blob != NULL) {
|
if (blob != NULL) {
|
||||||
blob->set_comments(cbuf->comments());
|
blob->set_strings(cbuf->strings());
|
||||||
}
|
}
|
||||||
bool saw_first = false;
|
bool saw_first = false;
|
||||||
StubCodeDesc* toprint[1000];
|
StubCodeDesc* toprint[1000];
|
||||||
|
@ -211,6 +211,10 @@ const char* Abstract_VM_Version::internal_vm_info_string() {
|
|||||||
#define HOTSPOT_BUILD_COMPILER "MS VC++ 8.0 (VS2005)"
|
#define HOTSPOT_BUILD_COMPILER "MS VC++ 8.0 (VS2005)"
|
||||||
#elif _MSC_VER == 1500
|
#elif _MSC_VER == 1500
|
||||||
#define HOTSPOT_BUILD_COMPILER "MS VC++ 9.0 (VS2008)"
|
#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
|
#else
|
||||||
#define HOTSPOT_BUILD_COMPILER "unknown MS VC++:" XSTR(_MSC_VER)
|
#define HOTSPOT_BUILD_COMPILER "unknown MS VC++:" XSTR(_MSC_VER)
|
||||||
#endif
|
#endif
|
||||||
|
@ -240,6 +240,7 @@ MemoryPool* MemoryService::add_cms_space(CompactibleFreeListSpace* space,
|
|||||||
void MemoryService::add_generation_memory_pool(Generation* gen,
|
void MemoryService::add_generation_memory_pool(Generation* gen,
|
||||||
MemoryManager* major_mgr,
|
MemoryManager* major_mgr,
|
||||||
MemoryManager* minor_mgr) {
|
MemoryManager* minor_mgr) {
|
||||||
|
guarantee(gen != NULL, "No generation for memory pool");
|
||||||
Generation::Name kind = gen->kind();
|
Generation::Name kind = gen->kind();
|
||||||
int index = _pools_list->length();
|
int index = _pools_list->length();
|
||||||
|
|
||||||
|
@ -248,10 +248,6 @@ void report_should_not_reach_here(const char* file, int line) {
|
|||||||
report_vm_error(file, line, "ShouldNotReachHere()");
|
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) {
|
void report_unimplemented(const char* file, int line) {
|
||||||
report_vm_error(file, line, "Unimplemented()");
|
report_vm_error(file, line, "Unimplemented()");
|
||||||
}
|
}
|
||||||
|
@ -192,12 +192,6 @@ do { \
|
|||||||
BREAKPOINT; \
|
BREAKPOINT; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
#define ShouldNotReachHere2(message) \
|
|
||||||
do { \
|
|
||||||
report_should_not_reach_here2(__FILE__, __LINE__, message); \
|
|
||||||
BREAKPOINT; \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
#define Unimplemented() \
|
#define Unimplemented() \
|
||||||
do { \
|
do { \
|
||||||
report_unimplemented(__FILE__, __LINE__); \
|
report_unimplemented(__FILE__, __LINE__); \
|
||||||
@ -218,7 +212,6 @@ void report_vm_out_of_memory(const char* file, int line, size_t size,
|
|||||||
const char* message);
|
const char* message);
|
||||||
void report_should_not_call(const char* file, int line);
|
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_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_unimplemented(const char* file, int line);
|
||||||
void report_untested(const char* file, int line, const char* message);
|
void report_untested(const char* file, int line, const char* message);
|
||||||
|
|
||||||
|
@ -35,6 +35,8 @@ public abstract class CompilerWhiteBoxTest {
|
|||||||
protected static final Method METHOD = getMethod("method");
|
protected static final Method METHOD = getMethod("method");
|
||||||
protected static final int COMPILE_THRESHOLD
|
protected static final int COMPILE_THRESHOLD
|
||||||
= Integer.parseInt(getVMOption("CompileThreshold", "10000"));
|
= Integer.parseInt(getVMOption("CompileThreshold", "10000"));
|
||||||
|
protected static final boolean BACKGROUND_COMPILATION
|
||||||
|
= Boolean.valueOf(getVMOption("BackgroundCompilation", "true"));
|
||||||
|
|
||||||
protected static Method getMethod(String name) {
|
protected static Method getMethod(String name) {
|
||||||
try {
|
try {
|
||||||
@ -45,11 +47,16 @@ public abstract class CompilerWhiteBoxTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static String getVMOption(String name, String defaultValue) {
|
protected static String getVMOption(String name) {
|
||||||
String result;
|
String result;
|
||||||
HotSpotDiagnosticMXBean diagnostic
|
HotSpotDiagnosticMXBean diagnostic
|
||||||
= ManagementFactoryHelper.getDiagnosticMXBean();
|
= ManagementFactoryHelper.getDiagnosticMXBean();
|
||||||
result = diagnostic.getVMOption(name).getValue();
|
result = diagnostic.getVMOption(name).getValue();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected static String getVMOption(String name, String defaultValue) {
|
||||||
|
String result = getVMOption(name);
|
||||||
return result == null ? defaultValue : result;
|
return result == null ? defaultValue : result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -66,6 +73,7 @@ public abstract class CompilerWhiteBoxTest {
|
|||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.printf("on exception '%s':", e.getMessage());
|
System.out.printf("on exception '%s':", e.getMessage());
|
||||||
printInfo(METHOD);
|
printInfo(METHOD);
|
||||||
|
e.printStackTrace();
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
System.out.println("at test's end:");
|
System.out.println("at test's end:");
|
||||||
@ -100,6 +108,9 @@ public abstract class CompilerWhiteBoxTest {
|
|||||||
|
|
||||||
protected static void waitBackgroundCompilation(Method method)
|
protected static void waitBackgroundCompilation(Method method)
|
||||||
throws InterruptedException {
|
throws InterruptedException {
|
||||||
|
if (!BACKGROUND_COMPILATION) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
final Object obj = new Object();
|
final Object obj = new Object();
|
||||||
synchronized (obj) {
|
synchronized (obj) {
|
||||||
for (int i = 0; i < 10; ++i) {
|
for (int i = 0; i < 10; ++i) {
|
||||||
@ -129,13 +140,14 @@ public abstract class CompilerWhiteBoxTest {
|
|||||||
|
|
||||||
protected final int compile() {
|
protected final int compile() {
|
||||||
int result = 0;
|
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();
|
result += method();
|
||||||
}
|
}
|
||||||
|
System.out.println("method was invoked " + count + " times");
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected int method() {
|
protected int method() {
|
||||||
return 42;
|
return 42;
|
||||||
}
|
}
|
||||||
|
@ -32,12 +32,12 @@
|
|||||||
public class DeoptimizeAllTest extends CompilerWhiteBoxTest {
|
public class DeoptimizeAllTest extends CompilerWhiteBoxTest {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
// to prevent inlining #method into #compile()
|
||||||
|
WHITE_BOX.setDontInlineMethod(METHOD, true);
|
||||||
new DeoptimizeAllTest().runTest();
|
new DeoptimizeAllTest().runTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void test() throws Exception {
|
protected void test() throws Exception {
|
||||||
// to prevent inlining #method into #compile()
|
|
||||||
WHITE_BOX.setDontInlineMethod(METHOD, true);
|
|
||||||
compile();
|
compile();
|
||||||
checkCompiled(METHOD);
|
checkCompiled(METHOD);
|
||||||
WHITE_BOX.deoptimizeAll();
|
WHITE_BOX.deoptimizeAll();
|
||||||
|
@ -32,12 +32,12 @@
|
|||||||
public class DeoptimizeMethodTest extends CompilerWhiteBoxTest {
|
public class DeoptimizeMethodTest extends CompilerWhiteBoxTest {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
// to prevent inlining #method into #compile()
|
||||||
|
WHITE_BOX.setDontInlineMethod(METHOD, true);
|
||||||
new DeoptimizeMethodTest().runTest();
|
new DeoptimizeMethodTest().runTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void test() throws Exception {
|
protected void test() throws Exception {
|
||||||
// to prevent inlining #method into #compile()
|
|
||||||
WHITE_BOX.setDontInlineMethod(METHOD, true);
|
|
||||||
compile();
|
compile();
|
||||||
checkCompiled(METHOD);
|
checkCompiled(METHOD);
|
||||||
WHITE_BOX.deoptimizeMethod(METHOD);
|
WHITE_BOX.deoptimizeMethod(METHOD);
|
||||||
|
@ -44,6 +44,8 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
// to prevent inlining #method into #compile()
|
||||||
|
WHITE_BOX.setDontInlineMethod(METHOD, true);
|
||||||
new IsMethodCompilableTest().runTest();
|
new IsMethodCompilableTest().runTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,8 +60,6 @@ public class IsMethodCompilableTest extends CompilerWhiteBoxTest {
|
|||||||
"Warning: test is not applicable if PerMethodRecompilationCutoff == Inf");
|
"Warning: test is not applicable if PerMethodRecompilationCutoff == Inf");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// to prevent inlining #method into #compile()
|
|
||||||
WHITE_BOX.setDontInlineMethod(METHOD, true);
|
|
||||||
boolean madeNotCompilable = false;
|
boolean madeNotCompilable = false;
|
||||||
|
|
||||||
for (long i = 0; i < PER_METHOD_RECOMPILATION_CUTOFF; ++i) {
|
for (long i = 0; i < PER_METHOD_RECOMPILATION_CUTOFF; ++i) {
|
||||||
|
@ -32,6 +32,8 @@
|
|||||||
public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
|
public class MakeMethodNotCompilableTest extends CompilerWhiteBoxTest {
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
|
// to prevent inlining #method into #compile()
|
||||||
|
WHITE_BOX.setDontInlineMethod(METHOD, true);
|
||||||
new MakeMethodNotCompilableTest().runTest();
|
new MakeMethodNotCompilableTest().runTest();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user