This commit is contained in:
J. Duke 2017-07-05 19:24:14 +02:00
commit 535e494a12
115 changed files with 2269 additions and 4260 deletions
.hgtags-top-repoMakefileNewMakefile.gmk
common
hotspot
make

@ -239,3 +239,4 @@ d086227bfc45d124f09b3bd72a07956b4073bf71 jdk8-b111
763ada2a1d8c5962bc8c3d297e57c562d2e95338 jdk8-b115
cbfe5da942c63ef865cab4a7159e01eff7d7fcf5 jdk8-b116
a4afb0a8d55ef75aef5b0d77b434070468fb89f8 jdk8-b117
0a6db1aac998cdc88e52f9adb97d40ca5b0f1da6 jdk8-b118

635
Makefile

@ -1,5 +1,5 @@
#
# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -23,549 +23,112 @@
# questions.
#
# If NEWBUILD is defined, use the new build-infra Makefiles and configure.
# See NewMakefile.gmk for more information.
# This must be the first rule
default:
# If not specified, select what the default build is
ifndef NEWBUILD
NEWBUILD=true
# Inclusion of this pseudo-target will cause make to execute this file
# serially, regardless of -j. Recursively called makefiles will not be
# affected, however. This is required for correct dependency management.
.NOTPARALLEL:
# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
# /usr/ccs/bin/make lacks basically every other flow control mechanism.
TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
# Assume we have GNU make, but check version.
ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
$(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
endif
ifeq ($(NEWBUILD),true)
# The new top level Makefile
include NewMakefile.gmk
else # Original Makefile logic
BUILD_PARENT_DIRECTORY=.
# Basename of any originally supplied ALT_OUTPUTDIR directory
ifndef ORIG_OUTPUTDIR_BASENAME
ifdef ALT_OUTPUTDIR
ORIG_OUTPUTDIR_BASENAME := $(shell basename $(ALT_OUTPUTDIR))
else
ORIG_OUTPUTDIR_BASENAME = $(PLATFORM)-$(ARCH)
endif
endif
export ORIG_OUTPUTDIR_BASENAME
# The three possible directories created for output (3 build flavors)
OUTPUTDIR_BASENAME- = $(ORIG_OUTPUTDIR_BASENAME)
OUTPUTDIR_BASENAME-debug = $(ORIG_OUTPUTDIR_BASENAME)-debug
OUTPUTDIR_BASENAME-fastdebug = $(ORIG_OUTPUTDIR_BASENAME)-fastdebug
# Relative path to a debug output area
REL_JDK_OUTPUTDIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))
# The created jdk image directory
JDK_IMAGE_DIRNAME = j2sdk-image
JDK_IMAGE_DIR = $(OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
ABS_JDK_IMAGE_DIR = $(ABS_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
# Relative path from an output directory to the image directory
REL_JDK_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-$(DEBUG_NAME))/$(JDK_IMAGE_DIRNAME)
REL_JDK_DEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-debug)/$(JDK_IMAGE_DIRNAME)
REL_JDK_FASTDEBUG_IMAGE_DIR = ../$(OUTPUTDIR_BASENAME-fastdebug)/$(JDK_IMAGE_DIRNAME)
ifndef TOPDIR
TOPDIR:=.
endif
ifndef JDK_TOPDIR
JDK_TOPDIR=$(TOPDIR)/jdk
endif
ifndef JDK_MAKE_SHARED_DIR
JDK_MAKE_SHARED_DIR=$(JDK_TOPDIR)/make/common/shared
endif
default: all
include $(JDK_MAKE_SHARED_DIR)/Defs-control.gmk
include ./make/Defs-internal.gmk
include ./make/sanity-rules.gmk
include ./make/hotspot-rules.gmk
include ./make/langtools-rules.gmk
include ./make/corba-rules.gmk
include ./make/jaxp-rules.gmk
include ./make/jaxws-rules.gmk
include ./make/jdk-rules.gmk
include ./make/nashorn-rules.gmk
include ./make/install-rules.gmk
include ./make/sponsors-rules.gmk
include ./make/deploy-rules.gmk
all:: sanity
ifeq ($(SKIP_FASTDEBUG_BUILD), false)
all:: fastdebug_build
endif
ifeq ($(SKIP_DEBUG_BUILD), false)
all:: debug_build
endif
all:: all_product_build
all_product_build::
# Everything for a full product build
ifeq ($(SKIP_PRODUCT_BUILD), false)
all_product_build:: product_build
ifeq ($(BUILD_INSTALL), true)
all_product_build:: $(INSTALL)
clobber:: install-clobber
endif
ifeq ($(BUILD_SPONSORS), true)
all_product_build:: $(SPONSORS)
clobber:: sponsors-clobber
endif
ifneq ($(SKIP_COMPARE_IMAGES), true)
all_product_build:: compare-image
endif
endif
define StartTimer
$(MKDIR) -p $(BUILDTIMESDIR)
$(RM) $(BUILDTIMESDIR)/build_time_*
$(call RecordStartTime,TOTAL)
endef
define StopTimer
$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,TOTAL) && $(call ReportBuildTimes,$1),)
endef
# Generic build of basic repo series
generic_build_repo_series:: $(SOURCE_TIPS)
$(MKDIR) -p $(JDK_IMAGE_DIR)
@$(call StartTimer)
ifeq ($(BUILD_LANGTOOLS), true)
generic_build_repo_series:: langtools
clobber:: langtools-clobber
endif
ifeq ($(BUILD_CORBA), true)
generic_build_repo_series:: corba
clobber:: corba-clobber
endif
ifeq ($(BUILD_JAXP), true)
generic_build_repo_series:: jaxp
clobber:: jaxp-clobber
endif
ifeq ($(BUILD_JAXWS), true)
generic_build_repo_series:: jaxws
clobber:: jaxws-clobber
endif
ifeq ($(BUILD_HOTSPOT), true)
generic_build_repo_series:: $(HOTSPOT)
clobber:: hotspot-clobber
endif
ifeq ($(BUILD_JDK), true)
generic_build_repo_series:: $(JDK_JAVA_EXE)
clobber:: jdk-clobber
endif
ifeq ($(BUILD_NASHORN), true)
generic_build_repo_series:: $(NASHORN)
clobber:: nashorn-clobber
endif
ifeq ($(BUILD_DEPLOY), true)
generic_build_repo_series:: $(DEPLOY)
clobber:: deploy-clobber
endif
generic_build_repo_series::
@$(call StopTimer,$(if $(DEBUG_NAME),$(DEBUG_NAME)_build,all_product_build))
# The debug build, fastdebug or debug. Needs special handling.
# Note that debug builds do NOT do INSTALL steps, but must be done
# after the product build and before the INSTALL step of the product build.
#
# DEBUG_NAME is fastdebug or debug
# ALT_OUTPUTDIR is changed to have -debug or -fastdebug suffix
# The resulting image directory (j2sdk-image) is used by the install makefiles
# to create a debug install bundle jdk-*-debug-** bundle (tar or zip)
# which will install in the debug or fastdebug subdirectory of the
# normal product install area.
# The install process needs to know what the DEBUG_NAME is, so
# look for INSTALL_DEBUG_NAME in the install rules.
#
# NOTE: On windows, do not use $(ABS_BOOTDIR_OUTPUTDIR)-$(DEBUG_NAME).
# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
# not be the same location.
#
# Location of fresh bootdir output
ABS_BOOTDIR_OUTPUTDIR=$(ABS_OUTPUTDIR)/bootjdk
FRESH_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(JDK_IMAGE_DIRNAME)
FRESH_DEBUG_BOOTDIR=$(ABS_BOOTDIR_OUTPUTDIR)/$(REL_JDK_IMAGE_DIR)
create_fresh_product_bootdir: FRC
$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
GENERATE_DOCS=false \
BOOT_CYCLE_SETTINGS= \
build_product_image
create_fresh_debug_bootdir: FRC
$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
GENERATE_DOCS=false \
BOOT_CYCLE_DEBUG_SETTINGS= \
build_debug_image
create_fresh_fastdebug_bootdir: FRC
$(MAKE) ALT_OUTPUTDIR=$(ABS_BOOTDIR_OUTPUTDIR) \
GENERATE_DOCS=false \
BOOT_CYCLE_DEBUG_SETTINGS= \
build_fastdebug_image
# Create boot image?
ifeq ($(SKIP_BOOT_CYCLE),false)
ifneq ($(PLATFORM)$(ARCH_DATA_MODEL),solaris64)
DO_BOOT_CYCLE=true
endif
endif
ifeq ($(DO_BOOT_CYCLE),true)
# Create the bootdir to use in the build
product_build:: create_fresh_product_bootdir
debug_build:: create_fresh_debug_bootdir
fastdebug_build:: create_fresh_fastdebug_bootdir
# Define variables to be used now for the boot jdk
BOOT_CYCLE_SETTINGS= \
ALT_BOOTDIR=$(FRESH_BOOTDIR) \
ALT_JDK_IMPORT_PATH=$(FRESH_BOOTDIR)
BOOT_CYCLE_DEBUG_SETTINGS= \
ALT_BOOTDIR=$(FRESH_DEBUG_BOOTDIR) \
ALT_JDK_IMPORT_PATH=$(FRESH_DEBUG_BOOTDIR)
# Locate this Makefile
ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
else
makefile_path:=$(lastword $(MAKEFILE_LIST))
endif
root_dir:=$(dir $(makefile_path))
# Use the supplied ALT_BOOTDIR as the boot
BOOT_CYCLE_SETTINGS=
BOOT_CYCLE_DEBUG_SETTINGS=
# ... and then we can include our helper functions
include $(root_dir)/make/MakeHelpers.gmk
$(eval $(call ParseLogLevel))
$(eval $(call ParseConfAndSpec))
# Now determine if we have zero, one or several configurations to build.
ifeq ($(SPEC),)
# Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
else
ifeq ($(words $(SPEC)),1)
# We are building a single configuration. This is the normal case. Execute the Main.gmk file.
include $(root_dir)/make/Main.gmk
else
# We are building multiple configurations.
# First, find out the valid targets
# Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
# available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \
$(MAKE) -p -q -f make/Main.gmk FRC SPEC=$(firstword $(SPEC)) | \
grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
$(all_phony_targets):
@$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \
$(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true
.PHONY: $(all_phony_targets)
endif
endif
build_product_image:
$(MAKE) \
SKIP_FASTDEBUG_BUILD=true \
SKIP_DEBUG_BUILD=true \
$(BOOT_CYCLE_SETTINGS) \
generic_build_repo_series
# Include this after a potential spec file has been included so that the bundles target
# has access to the spec variables.
include $(root_dir)/make/Jprt.gmk
# NOTE: On windows, do not use $(ABS_OUTPUTDIR)-$(DEBUG_NAME).
# Due to the use of short paths in $(ABS_OUTPUTDIR), this may
# not be the same location.
# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
# If you addd more global targets, please update the variable global_targets in MakeHelpers.
generic_debug_build:
$(MAKE) \
ALT_OUTPUTDIR=$(ABS_OUTPUTDIR)/$(REL_JDK_OUTPUTDIR) \
DEBUG_NAME=$(DEBUG_NAME) \
GENERATE_DOCS=false \
$(BOOT_CYCLE_DEBUG_SETTINGS) \
generic_build_repo_series
build_debug_image:
$(MAKE) DEBUG_NAME=debug generic_debug_build
build_fastdebug_image:
$(MAKE) DEBUG_NAME=fastdebug generic_debug_build
# Build final image
product_build:: build_product_image
debug_build:: build_debug_image
fastdebug_build:: build_fastdebug_image
# The source tips are stored with the relative path to the repo.
# This file will be used when constructing the jdk image.
source_tips: $(SOURCE_TIPS)
$(CAT) $<
$(SOURCE_TIPS): FRC
@$(prep-target)
@$(call GetSourceTips)
clobber:: REPORT_BUILD_TIMES=
clobber::
$(RM) -r $(OUTPUTDIR)/*
-($(RMDIR) -p $(OUTPUTDIR) > $(DEV_NULL) 2>&1; $(TRUE))
clean: clobber
#
# Dev builds
#
dev : dev-build
dev-build:
$(MAKE) DEV_ONLY=true all
dev-sanity:
$(MAKE) DEV_ONLY=true sanity
dev-clobber:
$(MAKE) DEV_ONLY=true clobber
#
# Quick jdk verification build
#
jdk_only:
$(MAKE) SKIP_FASTDEBUG_BUILD=true BUILD_HOTSPOT=false all
#
# Quick jdk verification fastdebug build
#
jdk_fastdebug_only:
$(MAKE) DEBUG_NAME=fastdebug BUILD_HOTSPOT=false BUILD_DEPLOY=false \
BUILD_INSTALL=false BUILD_SPONSORS=false generic_debug_build
#
# Quick deploy verification fastdebug build
#
deploy_fastdebug_only:
$(MAKE) \
DEBUG_NAME=fastdebug \
BUILD_HOTSPOT=false \
BUILD_JDK=false \
BUILD_LANGTOOLS=false \
BUILD_NASHORN=false \
BUILD_CORBA=false \
BUILD_JAXP=false \
BUILD_JAXWS=false \
BUILD_INSTALL=false \
BUILD_SPONSORS=false \
generic_debug_build
#
# Product build (skip debug builds)
#
product_only:
$(MAKE) SKIP_FASTDEBUG_BUILD=true all
#
# Check target
#
check: variable_check
#
# Help target
#
help: intro_help target_help variable_help notes_help examples_help
# Intro help message
intro_help:
@$(ECHO) "\
Makefile for the JDK builds (all the JDK). \n\
"
# Target help
target_help:
@$(ECHO) "\
--- Common Targets --- \n\
all -- build the core JDK (default target) \n\
help -- Print out help information \n\
check -- Check make variable values for correctness \n\
sanity -- Perform detailed sanity checks on system and settings \n\
fastdebug_build -- build the core JDK in 'fastdebug' mode (-g -O) \n\
debug_build -- build the core JDK in 'debug' mode (-g) \n\
clean -- remove all built and imported files \n\
clobber -- same as clean \n\
"
# Variable help (only common ones used by this Makefile)
variable_help: variable_help_intro variable_list variable_help_end
variable_help_intro:
@$(ECHO) "--- Common Variables ---"
variable_help_end:
@$(ECHO) " "
# One line descriptions for the variables
OUTPUTDIR.desc = Output directory
PARALLEL_COMPILE_JOBS.desc = Solaris/Linux parallel compile run count
SLASH_JAVA.desc = Root of all build tools, e.g. /java or J:
BOOTDIR.desc = JDK used to boot the build
JDK_IMPORT_PATH.desc = JDK used to import components of the build
COMPILER_PATH.desc = Compiler install directory
CACERTS_FILE.desc = Location of certificates file
DEVTOOLS_PATH.desc = Directory containing zip and gnumake
CUPS_HEADERS_PATH.desc = Include directory location for CUPS header files
# Make variables to print out (description and value)
VARIABLE_PRINTVAL_LIST += \
OUTPUTDIR \
PARALLEL_COMPILE_JOBS \
SLASH_JAVA \
BOOTDIR \
JDK_IMPORT_PATH \
COMPILER_PATH \
CACERTS_FILE \
DEVTOOLS_PATH
# Make variables that should refer to directories that exist
VARIABLE_CHECKDIR_LIST += \
SLASH_JAVA \
BOOTDIR \
JDK_IMPORT_PATH \
COMPILER_PATH \
DEVTOOLS_PATH
# Make variables that should refer to files that exist
VARIABLE_CHECKFIL_LIST += \
CACERTS_FILE
# For pattern rules below, so all are treated the same
DO_PRINTVAL_LIST=$(VARIABLE_PRINTVAL_LIST:%=%.printval)
DO_CHECKDIR_LIST=$(VARIABLE_CHECKDIR_LIST:%=%.checkdir)
DO_CHECKFIL_LIST=$(VARIABLE_CHECKFIL_LIST:%=%.checkfil)
# Complete variable check
variable_check: $(DO_CHECKDIR_LIST) $(DO_CHECKFIL_LIST)
variable_list: $(DO_PRINTVAL_LIST) variable_check
# Pattern rule for printing out a variable
%.printval:
@$(ECHO) " ALT_$* - $($*.desc)"
@$(ECHO) " \t $*=$($*)"
# Pattern rule for checking to see if a variable with a directory exists
%.checkdir:
@if [ ! -d $($*) ] ; then \
$(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
fi
# Pattern rule for checking to see if a variable with a file exists
%.checkfil:
@if [ ! -f $($*) ] ; then \
$(ECHO) "WARNING: $* does not exist, try $(MAKE) sanity"; \
fi
# Misc notes on help
notes_help:
@$(ECHO) "\
--- Notes --- \n\
- All builds use same output directory unless overridden with \n\
\t ALT_OUTPUTDIR=<dir>, changing from product to fastdebug you may want \n\
\t to use the clean target first. \n\
- JDK_IMPORT_PATH must refer to a compatible build, not all past promoted \n\
\t builds or previous release JDK builds will work. \n\
- The fastest builds have been when the sources and the BOOTDIR are on \n\
\t local disk. \n\
"
examples_help:
@$(ECHO) "\
--- Examples --- \n\
$(MAKE) fastdebug_build \n\
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar fastdebug_build \n\
$(MAKE) ALT_OUTPUTDIR=/tmp/foobar all \n\
$(MAKE) ALT_BOOTDIR=/opt/java/jdk1.5.0 \n\
$(MAKE) ALT_JDK_IMPORT_PATH=/opt/java/jdk1.6.0 \n\
"
################################################################
# Source bundling
################################################################
ifeq ($(BUNDLE_RULES_AVAILABLE), true)
include $(BUNDLE_RULES)
endif
################################################################
# rule to test
################################################################
.NOTPARALLEL: test_run
test:
$(MAKE) test_run
test_run: test_clean test_start test_summary
test_start:
@$(ECHO) "Tests started at `$(DATE)`"
test_clean:
$(RM) $(OUTPUTDIR)/test_failures.txt $(OUTPUTDIR)/test_log.txt
test_summary: $(OUTPUTDIR)/test_failures.txt
@$(ECHO) "#################################################"
@$(ECHO) "Tests completed at `$(DATE)`"
@( $(EGREP) '^TEST STATS:' $(OUTPUTDIR)/test_log.txt \
|| $(ECHO) "No TEST STATS seen in log" )
@$(ECHO) "For complete details see: $(OUTPUTDIR)/test_log.txt"
@$(ECHO) "#################################################"
@if [ -s $< ] ; then \
$(ECHO) "ERROR: Test failure count: `$(CAT) $< | $(WC) -l`"; \
$(CAT) $<; \
exit 1; \
else \
$(ECHO) "Success! No failures detected"; \
fi
# Get failure list from log
$(OUTPUTDIR)/test_failures.txt: $(OUTPUTDIR)/test_log.txt
@$(RM) $@
@( $(EGREP) '^FAILED:' $< || $(ECHO) "" ) | $(NAWK) 'length>0' > $@
# Get log file of all tests run
JDK_TO_TEST := $(shell \
if [ -d "$(ABS_JDK_IMAGE_DIR)" ] ; then \
$(ECHO) "$(ABS_JDK_IMAGE_DIR)"; \
elif [ -d "$(ABS_OUTPUTDIR)/bin" ] ; then \
$(ECHO) "$(ABS_OUTPUTDIR)"; \
elif [ "$(PRODUCT_HOME)" != "" -a -d "$(PRODUCT_HOME)/bin" ] ; then \
$(ECHO) "$(PRODUCT_HOME)"; \
fi \
)
TEST_TARGETS=all
$(OUTPUTDIR)/test_log.txt:
$(RM) $@
( $(CD) test && \
$(MAKE) NO_STOPPING=- PRODUCT_HOME=$(JDK_TO_TEST) $(TEST_TARGETS) \
) | tee $@
################################################################
# JPRT rule to build
################################################################
include ./make/jprt.gmk
################################################################
# PHONY
################################################################
.PHONY: all test test_run test_start test_summary test_clean \
generic_build_repo_series \
what clobber insane \
dev dev-build dev-sanity dev-clobber \
product_build \
fastdebug_build \
debug_build \
build_product_image \
build_debug_image \
build_fastdebug_image \
create_fresh_product_bootdir \
create_fresh_debug_bootdir \
create_fresh_fastdebug_bootdir \
generic_debug_build
# Force target
FRC:
endif # Original Makefile logic
help:
$(info )
$(info OpenJDK Makefile help)
$(info =====================)
$(info )
$(info Common make targets)
$(info . make [default] # Compile all product in langtools, hotspot, jaxp, jaxws,)
$(info . # corba and jdk)
$(info . make all # Compile everything, all repos and images)
$(info . make images # Create complete j2sdk and j2re images)
$(info . make docs # Create javadocs)
$(info . make overlay-images # Create limited images for sparc 64 bit platforms)
$(info . make profiles # Create complete j2re compact profile images)
$(info . make bootcycle-images # Build images twice, second time with newly build JDK)
$(info . make install # Install the generated images locally)
$(info . make clean # Remove all files generated by make, but not those)
$(info . # generated by configure)
$(info . make dist-clean # Remove all files, including configuration)
$(info . make help # Give some help on using make)
$(info . make test # Run tests, default is all tests (see TEST below))
$(info )
$(info Targets for specific components)
$(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, nashorn, images, overlay-images, docs or test))
$(info . make <component> # Build <component> and everything it depends on. )
$(info . make <component>-only # Build <component> only, without dependencies. This)
$(info . # is faster but can result in incorrect build results!)
$(info . make clean-<component> # Remove files generated by make for <component>)
$(info )
$(info Useful make variables)
$(info . make CONF= # Build all configurations (note, assignment is empty))
$(info . make CONF=<substring> # Build the configuration(s) with a name matching)
$(info . # <substring>)
$(info )
$(info . make LOG=<loglevel> # Change the log level from warn to <loglevel>)
$(info . # Available log levels are:)
$(info . # 'warn' (default), 'info', 'debug' and 'trace')
$(info . # To see executed command lines, use LOG=debug)
$(info )
$(info . make JOBS=<n> # Run <n> parallel make jobs)
$(info . # Note that -jN does not work as expected!)
$(info )
$(info . make test TEST=<test> # Only run the given test or tests, e.g.)
$(info . # make test TEST="jdk_lang jdk_net")
$(info )
.PHONY: help

@ -1,134 +0,0 @@
#
# Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
# This must be the first rule
default:
# Inclusion of this pseudo-target will cause make to execute this file
# serially, regardless of -j. Recursively called makefiles will not be
# affected, however. This is required for correct dependency management.
.NOTPARALLEL:
# The shell code below will be executed on /usr/ccs/bin/make on Solaris, but not in GNU make.
# /usr/ccs/bin/make lacks basically every other flow control mechanism.
TEST_FOR_NON_GNUMAKE:sh=echo You are not using GNU make/gmake, this is a requirement. Check your path. 1>&2 && exit 1
# Assume we have GNU make, but check version.
ifeq ($(strip $(foreach v, 3.81% 3.82% 4.%, $(filter $v, $(MAKE_VERSION)))), )
$(error This version of GNU Make is too low ($(MAKE_VERSION)). Check your path, or upgrade to 3.81 or newer.)
endif
# Locate this Makefile
ifeq ($(filter /%,$(lastword $(MAKEFILE_LIST))),)
makefile_path:=$(CURDIR)/$(lastword $(MAKEFILE_LIST))
else
makefile_path:=$(lastword $(MAKEFILE_LIST))
endif
root_dir:=$(dir $(makefile_path))
# ... and then we can include our helper functions
include $(root_dir)/common/makefiles/MakeHelpers.gmk
$(eval $(call ParseLogLevel))
$(eval $(call ParseConfAndSpec))
# Now determine if we have zero, one or several configurations to build.
ifeq ($(SPEC),)
# Since we got past ParseConfAndSpec, we must be building a global target. Do nothing.
else
ifeq ($(words $(SPEC)),1)
# We are building a single configuration. This is the normal case. Execute the Main.gmk file.
include $(root_dir)/common/makefiles/Main.gmk
else
# We are building multiple configurations.
# First, find out the valid targets
# Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
# available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
all_phony_targets=$(filter-out $(global_targets) bundles-only, $(strip $(shell \
$(MAKE) -p -q -f common/makefiles/Main.gmk FRC SPEC=$(firstword $(SPEC)) | \
grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
$(all_phony_targets):
@$(foreach spec,$(SPEC),($(MAKE) -f NewMakefile.gmk SPEC=$(spec) \
$(VERBOSE) VERBOSE=$(VERBOSE) LOG_LEVEL=$(LOG_LEVEL) $@) &&) true
.PHONY: $(all_phony_targets)
endif
endif
# Include this after a potential spec file has been included so that the bundles target
# has access to the spec variables.
include $(root_dir)/common/makefiles/Jprt.gmk
# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
# If you addd more global targets, please update the variable global_targets in MakeHelpers.
help:
$(info )
$(info OpenJDK Makefile help)
$(info =====================)
$(info )
$(info Common make targets)
$(info . make [default] # Compile all product in langtools, hotspot, jaxp, jaxws,)
$(info . # corba and jdk)
$(info . make all # Compile everything, all repos and images)
$(info . make images # Create complete j2sdk and j2re images)
$(info . make docs # Create javadocs)
$(info . make overlay-images # Create limited images for sparc 64 bit platforms)
$(info . make profiles # Create complete j2re compact profile images)
$(info . make bootcycle-images # Build images twice, second time with newly build JDK)
$(info . make install # Install the generated images locally)
$(info . make clean # Remove all files generated by make, but not those)
$(info . # generated by configure)
$(info . make dist-clean # Remove all files, including configuration)
$(info . make help # Give some help on using make)
$(info . make test # Run tests, default is all tests (see TEST below))
$(info )
$(info Targets for specific components)
$(info (Component is any of langtools, corba, jaxp, jaxws, hotspot, jdk, nashorn, images, overlay-images, docs or test))
$(info . make <component> # Build <component> and everything it depends on. )
$(info . make <component>-only # Build <component> only, without dependencies. This)
$(info . # is faster but can result in incorrect build results!)
$(info . make clean-<component> # Remove files generated by make for <component>)
$(info )
$(info Useful make variables)
$(info . make CONF= # Build all configurations (note, assignment is empty))
$(info . make CONF=<substring> # Build the configuration(s) with a name matching)
$(info . # <substring>)
$(info )
$(info . make LOG=<loglevel> # Change the log level from warn to <loglevel>)
$(info . # Available log levels are:)
$(info . # 'warn' (default), 'info', 'debug' and 'trace')
$(info . # To see executed command lines, use LOG=debug)
$(info )
$(info . make JOBS=<n> # Run <n> parallel make jobs)
$(info . # Note that -jN does not work as expected!)
$(info )
$(info . make test TEST=<test> # Only run the given test or tests, e.g.)
$(info . # make test TEST="jdk_lang jdk_net")
$(info )
.PHONY: help

@ -24,4 +24,4 @@
# This Makefile was generated by configure @DATE_WHEN_CONFIGURED@
# GENERATED FILE, DO NOT EDIT
SPEC:=@OUTPUT_ROOT@/spec.gmk
include @SRC_ROOT@/NewMakefile.gmk
include @SRC_ROOT@/Makefile

@ -412,7 +412,7 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
# Test from where we are running configure, in or outside of src root.
if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
|| test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \
|| test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
|| test "x$CURDIR" = "x$SRC_ROOT/make" ; then
# We are running configure from the src root.
# Create a default ./build/target-variant-debuglevel output root.
if test "x${CONF_NAME}" = x; then

@ -3865,7 +3865,7 @@ fi
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1383151988
DATE_WHEN_GENERATED=1384422786
###############################################################################
#
@ -8042,7 +8042,7 @@ fi
# Test from where we are running configure, in or outside of src root.
if test "x$CURDIR" = "x$SRC_ROOT" || test "x$CURDIR" = "x$SRC_ROOT/common" \
|| test "x$CURDIR" = "x$SRC_ROOT/common/autoconf" \
|| test "x$CURDIR" = "x$SRC_ROOT/common/makefiles" ; then
|| test "x$CURDIR" = "x$SRC_ROOT/make" ; then
# We are running configure from the src root.
# Create a default ./build/target-variant-debuglevel output root.
if test "x${CONF_NAME}" = x; then
@ -16201,32 +16201,25 @@ fi
cd "$CURDIR"
# Verify that the addon source root does not have any root makefiles.
# If it does, then it is usually an error, prevent this.
if test -f $with_add_source_root/langtools/makefiles/Makefile || \
test -f $with_add_source_root/langtools/make/Makefile; then
if test -f $with_add_source_root/langtools/make/Makefile; then
as_fn_error $? "Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources." "$LINENO" 5
fi
if test -f $with_add_source_root/corba/makefiles/Makefile || \
test -f $with_add_source_root/corba/make/Makefile; then
if test -f $with_add_source_root/corba/make/Makefile; then
as_fn_error $? "Your add source root seems to contain a full corba repo! An add source root should only contain additional sources." "$LINENO" 5
fi
if test -f $with_add_source_root/jaxp/makefiles/Makefile || \
test -f $with_add_source_root/jaxp/make/Makefile; then
if test -f $with_add_source_root/jaxp/make/Makefile; then
as_fn_error $? "Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources." "$LINENO" 5
fi
if test -f $with_add_source_root/jaxws/makefiles/Makefile || \
test -f $with_add_source_root/jaxws/make/Makefile; then
if test -f $with_add_source_root/jaxws/make/Makefile; then
as_fn_error $? "Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources." "$LINENO" 5
fi
if test -f $with_add_source_root/hotspot/makefiles/Makefile || \
test -f $with_add_source_root/hotspot/make/Makefile; then
if test -f $with_add_source_root/hotspot/make/Makefile; then
as_fn_error $? "Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources." "$LINENO" 5
fi
if test -f $with_add_source_root/nashorn/makefiles/Makefile || \
test -f $with_add_source_root/nashorn/make/Makefile; then
if test -f $with_add_source_root/nashorn/make/Makefile; then
as_fn_error $? "Your add source root seems to contain a full nashorn repo! An add source root should only contain additional sources." "$LINENO" 5
fi
if test -f $with_add_source_root/jdk/makefiles/Makefile || \
test -f $with_add_source_root/jdk/make/Makefile; then
if test -f $with_add_source_root/jdk/make/Makefile; then
as_fn_error $? "Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources." "$LINENO" 5
fi
fi
@ -16240,32 +16233,25 @@ fi
cd "$with_override_source_root"
OVERRIDE_SRC_ROOT="`pwd`"
cd "$CURDIR"
if test -f $with_override_source_root/langtools/makefiles/Makefile || \
test -f $with_override_source_root/langtools/make/Makefile; then
if test -f $with_override_source_root/langtools/make/Makefile; then
as_fn_error $? "Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override." "$LINENO" 5
fi
if test -f $with_override_source_root/corba/makefiles/Makefile || \
test -f $with_override_source_root/corba/make/Makefile; then
if test -f $with_override_source_root/corba/make/Makefile; then
as_fn_error $? "Your override source root seems to contain a full corba repo! An override source root should only contain sources that override." "$LINENO" 5
fi
if test -f $with_override_source_root/jaxp/makefiles/Makefile || \
test -f $with_override_source_root/jaxp/make/Makefile; then
if test -f $with_override_source_root/jaxp/make/Makefile; then
as_fn_error $? "Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override." "$LINENO" 5
fi
if test -f $with_override_source_root/jaxws/makefiles/Makefile || \
test -f $with_override_source_root/jaxws/make/Makefile; then
if test -f $with_override_source_root/jaxws/make/Makefile; then
as_fn_error $? "Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override." "$LINENO" 5
fi
if test -f $with_override_source_root/hotspot/makefiles/Makefile || \
test -f $with_override_source_root/hotspot/make/Makefile; then
if test -f $with_override_source_root/hotspot/make/Makefile; then
as_fn_error $? "Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override." "$LINENO" 5
fi
if test -f $with_override_source_root/nashorn/makefiles/Makefile || \
test -f $with_override_source_root/nashorn/make/Makefile; then
if test -f $with_override_source_root/nashorn/make/Makefile; then
as_fn_error $? "Your override source root seems to contain a full nashorn repo! An override source root should only contain sources that override." "$LINENO" 5
fi
if test -f $with_override_source_root/jdk/makefiles/Makefile || \
test -f $with_override_source_root/jdk/make/Makefile; then
if test -f $with_override_source_root/jdk/make/Makefile; then
as_fn_error $? "Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override." "$LINENO" 5
fi
fi
@ -16344,7 +16330,7 @@ fi
cd "$with_override_langtools"
LANGTOOLS_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then
if ! test -f $LANGTOOLS_TOPDIR/make/Makefile; then
as_fn_error $? "You have to override langtools with a full langtools repo!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if langtools should be overridden" >&5
@ -16357,7 +16343,7 @@ $as_echo "yes with $LANGTOOLS_TOPDIR" >&6; }
cd "$with_override_corba"
CORBA_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then
if ! test -f $CORBA_TOPDIR/make/Makefile; then
as_fn_error $? "You have to override corba with a full corba repo!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if corba should be overridden" >&5
@ -16370,7 +16356,7 @@ $as_echo "yes with $CORBA_TOPDIR" >&6; }
cd "$with_override_jaxp"
JAXP_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then
if ! test -f $JAXP_TOPDIR/make/Makefile; then
as_fn_error $? "You have to override jaxp with a full jaxp repo!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if jaxp should be overridden" >&5
@ -16383,7 +16369,7 @@ $as_echo "yes with $JAXP_TOPDIR" >&6; }
cd "$with_override_jaxws"
JAXWS_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then
if ! test -f $JAXWS_TOPDIR/make/Makefile; then
as_fn_error $? "You have to override jaxws with a full jaxws repo!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if jaxws should be overridden" >&5
@ -16396,8 +16382,7 @@ $as_echo "yes with $JAXWS_TOPDIR" >&6; }
cd "$with_override_hotspot"
HOTSPOT_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \
! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then
if ! test -f $HOTSPOT_TOPDIR/make/Makefile; then
as_fn_error $? "You have to override hotspot with a full hotspot repo!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if hotspot should be overridden" >&5
@ -16410,7 +16395,7 @@ $as_echo "yes with $HOTSPOT_TOPDIR" >&6; }
cd "$with_override_nashorn"
NASHORN_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $NASHORN_TOPDIR/makefiles/Makefile; then
if ! test -f $NASHORN_TOPDIR/make/Makefile; then
as_fn_error $? "You have to override nashorn with a full nashorn repo!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if nashorn should be overridden" >&5
@ -16423,7 +16408,7 @@ $as_echo "yes with $NASHORN_TOPDIR" >&6; }
cd "$with_override_jdk"
JDK_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $JDK_TOPDIR/makefiles/Makefile; then
if ! test -f $JDK_TOPDIR/make/Makefile; then
as_fn_error $? "You have to override JDK with a full JDK repo!" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if JDK should be overridden" >&5

@ -129,4 +129,4 @@ endif
# Sneak this in via the spec.gmk file, since we don't want to mess around too much with the Hotspot make files.
# This is needed to get the LOG setting to work properly.
include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
include $(SRC_ROOT)/make/common/MakeBase.gmk

@ -80,32 +80,25 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$CURDIR"
# Verify that the addon source root does not have any root makefiles.
# If it does, then it is usually an error, prevent this.
if test -f $with_add_source_root/langtools/makefiles/Makefile || \
test -f $with_add_source_root/langtools/make/Makefile; then
if test -f $with_add_source_root/langtools/make/Makefile; then
AC_MSG_ERROR([Your add source root seems to contain a full langtools repo! An add source root should only contain additional sources.])
fi
if test -f $with_add_source_root/corba/makefiles/Makefile || \
test -f $with_add_source_root/corba/make/Makefile; then
if test -f $with_add_source_root/corba/make/Makefile; then
AC_MSG_ERROR([Your add source root seems to contain a full corba repo! An add source root should only contain additional sources.])
fi
if test -f $with_add_source_root/jaxp/makefiles/Makefile || \
test -f $with_add_source_root/jaxp/make/Makefile; then
if test -f $with_add_source_root/jaxp/make/Makefile; then
AC_MSG_ERROR([Your add source root seems to contain a full jaxp repo! An add source root should only contain additional sources.])
fi
if test -f $with_add_source_root/jaxws/makefiles/Makefile || \
test -f $with_add_source_root/jaxws/make/Makefile; then
if test -f $with_add_source_root/jaxws/make/Makefile; then
AC_MSG_ERROR([Your add source root seems to contain a full jaxws repo! An add source root should only contain additional sources.])
fi
if test -f $with_add_source_root/hotspot/makefiles/Makefile || \
test -f $with_add_source_root/hotspot/make/Makefile; then
if test -f $with_add_source_root/hotspot/make/Makefile; then
AC_MSG_ERROR([Your add source root seems to contain a full hotspot repo! An add source root should only contain additional sources.])
fi
if test -f $with_add_source_root/nashorn/makefiles/Makefile || \
test -f $with_add_source_root/nashorn/make/Makefile; then
if test -f $with_add_source_root/nashorn/make/Makefile; then
AC_MSG_ERROR([Your add source root seems to contain a full nashorn repo! An add source root should only contain additional sources.])
fi
if test -f $with_add_source_root/jdk/makefiles/Makefile || \
test -f $with_add_source_root/jdk/make/Makefile; then
if test -f $with_add_source_root/jdk/make/Makefile; then
AC_MSG_ERROR([Your add source root seems to contain a full JDK repo! An add source root should only contain additional sources.])
fi
fi
@ -119,32 +112,25 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$with_override_source_root"
OVERRIDE_SRC_ROOT="`pwd`"
cd "$CURDIR"
if test -f $with_override_source_root/langtools/makefiles/Makefile || \
test -f $with_override_source_root/langtools/make/Makefile; then
if test -f $with_override_source_root/langtools/make/Makefile; then
AC_MSG_ERROR([Your override source root seems to contain a full langtools repo! An override source root should only contain sources that override.])
fi
if test -f $with_override_source_root/corba/makefiles/Makefile || \
test -f $with_override_source_root/corba/make/Makefile; then
if test -f $with_override_source_root/corba/make/Makefile; then
AC_MSG_ERROR([Your override source root seems to contain a full corba repo! An override source root should only contain sources that override.])
fi
if test -f $with_override_source_root/jaxp/makefiles/Makefile || \
test -f $with_override_source_root/jaxp/make/Makefile; then
if test -f $with_override_source_root/jaxp/make/Makefile; then
AC_MSG_ERROR([Your override source root seems to contain a full jaxp repo! An override source root should only contain sources that override.])
fi
if test -f $with_override_source_root/jaxws/makefiles/Makefile || \
test -f $with_override_source_root/jaxws/make/Makefile; then
if test -f $with_override_source_root/jaxws/make/Makefile; then
AC_MSG_ERROR([Your override source root seems to contain a full jaxws repo! An override source root should only contain sources that override.])
fi
if test -f $with_override_source_root/hotspot/makefiles/Makefile || \
test -f $with_override_source_root/hotspot/make/Makefile; then
if test -f $with_override_source_root/hotspot/make/Makefile; then
AC_MSG_ERROR([Your override source root seems to contain a full hotspot repo! An override source root should only contain sources that override.])
fi
if test -f $with_override_source_root/nashorn/makefiles/Makefile || \
test -f $with_override_source_root/nashorn/make/Makefile; then
if test -f $with_override_source_root/nashorn/make/Makefile; then
AC_MSG_ERROR([Your override source root seems to contain a full nashorn repo! An override source root should only contain sources that override.])
fi
if test -f $with_override_source_root/jdk/makefiles/Makefile || \
test -f $with_override_source_root/jdk/make/Makefile; then
if test -f $with_override_source_root/jdk/make/Makefile; then
AC_MSG_ERROR([Your override source root seems to contain a full JDK repo! An override source root should only contain sources that override.])
fi
fi
@ -195,7 +181,7 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$with_override_langtools"
LANGTOOLS_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $LANGTOOLS_TOPDIR/makefiles/Makefile; then
if ! test -f $LANGTOOLS_TOPDIR/make/Makefile; then
AC_MSG_ERROR([You have to override langtools with a full langtools repo!])
fi
AC_MSG_CHECKING([if langtools should be overridden])
@ -206,7 +192,7 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$with_override_corba"
CORBA_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $CORBA_TOPDIR/makefiles/Makefile; then
if ! test -f $CORBA_TOPDIR/make/Makefile; then
AC_MSG_ERROR([You have to override corba with a full corba repo!])
fi
AC_MSG_CHECKING([if corba should be overridden])
@ -217,7 +203,7 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$with_override_jaxp"
JAXP_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $JAXP_TOPDIR/makefiles/Makefile; then
if ! test -f $JAXP_TOPDIR/make/Makefile; then
AC_MSG_ERROR([You have to override jaxp with a full jaxp repo!])
fi
AC_MSG_CHECKING([if jaxp should be overridden])
@ -228,7 +214,7 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$with_override_jaxws"
JAXWS_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $JAXWS_TOPDIR/makefiles/Makefile; then
if ! test -f $JAXWS_TOPDIR/make/Makefile; then
AC_MSG_ERROR([You have to override jaxws with a full jaxws repo!])
fi
AC_MSG_CHECKING([if jaxws should be overridden])
@ -239,8 +225,7 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$with_override_hotspot"
HOTSPOT_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $HOTSPOT_TOPDIR/make/Makefile && \
! test -f $HOTSPOT_TOPDIR/makefiles/Makefile; then
if ! test -f $HOTSPOT_TOPDIR/make/Makefile; then
AC_MSG_ERROR([You have to override hotspot with a full hotspot repo!])
fi
AC_MSG_CHECKING([if hotspot should be overridden])
@ -251,7 +236,7 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$with_override_nashorn"
NASHORN_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $NASHORN_TOPDIR/makefiles/Makefile; then
if ! test -f $NASHORN_TOPDIR/make/Makefile; then
AC_MSG_ERROR([You have to override nashorn with a full nashorn repo!])
fi
AC_MSG_CHECKING([if nashorn should be overridden])
@ -262,7 +247,7 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_ALTERNATIVE_TOPDIRS],
cd "$with_override_jdk"
JDK_TOPDIR="`pwd`"
cd "$CURDIR"
if ! test -f $JDK_TOPDIR/makefiles/Makefile; then
if ! test -f $JDK_TOPDIR/make/Makefile; then
AC_MSG_ERROR([You have to override JDK with a full JDK repo!])
fi
AC_MSG_CHECKING([if JDK should be overridden])

@ -65,8 +65,8 @@ ifeq (,$(findstring -R,$(MAKE)))
endif
# Specify where the common include directory for makefiles is.
ifeq (,$(findstring -I @SRC_ROOT@/common/makefiles,$(MAKE)))
MAKE:=$(MAKE) -I @SRC_ROOT@/common/makefiles
ifeq (,$(findstring -I @SRC_ROOT@/make/common,$(MAKE)))
MAKE:=$(MAKE) -I @SRC_ROOT@/make/common
endif
# The "human readable" name of this configuration

@ -1113,14 +1113,15 @@ fi
if [ -d "$THIS/install/j2sdk-image" ]; then
THIS_J2SDK="$THIS/install/j2sdk-image"
THIS_J2RE="$THIS/install/j2re-image"
echo "Comparing install images"
echo "Selecting install images in this build"
elif [ -d "$THIS/deploy/j2sdk-image" ]; then
THIS_J2SDK="$THIS/deploy/j2sdk-image"
THIS_J2RE="$THIS/deploy/j2re-image"
echo "Comparing deploy images"
echo "Selecting deploy images in this build"
elif [ -d "$THIS/images/j2sdk-image" ]; then
THIS_J2SDK="$THIS/images/j2sdk-image"
THIS_J2RE="$THIS/images/j2re-image"
echo "Selecting jdk images in this build"
fi
if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
@ -1128,15 +1129,18 @@ if [ -d "$THIS/images/j2sdk-overlay-image" ]; then
# If there is an install image, prefer that, it's also overlay
THIS_J2SDK_OVERLAY="$THIS/install/j2sdk-image"
THIS_J2RE_OVERLAY="$THIS/install/j2re-image"
echo "Selecting install overlay images in this build"
else
THIS_J2SDK_OVERLAY="$THIS/images/j2sdk-overlay-image"
THIS_J2RE_OVERLAY="$THIS/images/j2re-overlay-image"
echo "Selecting jdk overlay images in this build"
fi
fi
if [ -d "$THIS/images/j2sdk-bundle" ]; then
THIS_J2SDK_BUNDLE="$THIS/images/j2sdk-bundle"
THIS_J2RE_BUNDLE="$THIS/images/j2re-bundle"
echo "Selecting bundles in this build"
fi
# Figure out the layout of the other build (old or new, normal or overlay image)
@ -1144,21 +1148,34 @@ if [ -d "$OTHER/j2sdk-image" ]; then
if [ -f "$OTHER/j2sdk-image/LICENSE" ]; then
OTHER_J2SDK="$OTHER/j2sdk-image"
OTHER_J2RE="$OTHER/j2re-image"
echo "Selecting old-style images in other build"
else
OTHER_J2SDK_OVERLAY="$OTHER/j2sdk-image"
OTHER_J2RE_OVERLAY="$OTHER/j2re-image"
echo "Selecting overlay images in other build"
fi
elif [ -d "$OTHER/install/j2sdk-image" ]; then
OTHER_J2SDK="$OTHER/install/j2sdk-image"
OTHER_J2RE="$OTHER/install/j2re-image"
echo "Selecting install images in other build"
elif [ -d "$OTHER/deploy/j2sdk-image" ]; then
OTHER_J2SDK="$OTHER/deploy/j2sdk-image"
OTHER_J2RE="$OTHER/deploy/j2re-image"
echo "Selecting deploy images in other build"
elif [ -d "$OTHER/images/j2sdk-image" ]; then
OTHER_J2SDK="$OTHER/images/j2sdk-image"
OTHER_J2RE="$OTHER/images/j2re-image"
echo "Selecting jdk images in other build"
fi
if [ -d "$OTHER/j2sdk-bundle" ]; then
OTHER_J2SDK_BUNDLE="$OTHER/j2sdk-bundle"
OTHER_J2RE_BUNDLE="$OTHER/j2re-bundle"
echo "Selecting bundles in other build"
elif [ -d "$OTHER/images/j2sdk-bundle" ]; then
OTHER_J2SDK_BUNDLE="$OTHER/images/j2sdk-bundle"
OTHER_J2RE_BUNDLE="$OTHER/images/j2re-bundle"
echo "Selecting jdk bundles in other build"
fi
if [ -z "$THIS_J2SDK" ] || [ -z "$THIS_J2RE" ]; then

@ -1,26 +0,0 @@
#
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
include ../../NewMakefile.gmk

@ -1,49 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Doc Process Notes</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h3><a name="REGEXP"></a><br>
REGEXP</h3>
<p> REGEXP is a list of wildcard patterns that determines which packages listed
in CORE_PKGS.gmk go into which summary-table on the main API index page. It
was motivated by the need to divide the world into &quot;core packages&quot;
(java.*) and &quot;extension packages&quot; (javax.*). In time, the distinction
went away. The whole table is now called &quot;Platform Packages&quot;--which
eliminated the need for this list of regular expressions. But it lingered on,
accreting all of the packages in the JVM, one by one. I pruned it back to &quot;*&quot;,
so it now covers every package in the Java platform API docs. If some separation
is needed in the future, it can grow back into a colon-separated list, starting
with this, which is in all respects equivalent to &quot;*&quot; at this point
in time:</p>
<blockquote>
<pre>REGEXP = &quot;java.*:javax.*:org.ietf*:org.omg.</pre>
</blockquote>
<h3><a name="releaseTargets"></a><br>
Release Targets</h3>
<p> (Thanks to Kelly O'Hair for this info.)</p>
<p> The <tt>rel-coredocs</tt> and <tt>rel-docs</tt> targets were added by Eric
Armstrong. <tt>rel-coredocs</tt> assumes the kind of large, 32-bit machine used
in the javapubs group's docs-release process. It specifies memory settings accordingly
to maximize performance.</p>
<p> The performance settings, like the sanity check, are most important for the
core docs--the platform APIs. Running javadoc on those APIs takes a significant
amount of time and memory. Setting the initial heap size as large as possible
is important to prevent thrashing as the heap grows. Setting the maximum as
large as necessary is also important to keep the job from failing.</p>
<blockquote>
<p> <tt>-J-Xmx512</tt> sets a maximum of 512, which became necessary in 6.0<br>
<tt>-J-Xms256</tt> sets starting size to 256 (default is 8)</p>
</blockquote>
<p> <tt>rel-coredocs</tt> also includes a sanity check to help ensure that <tt>BUILD_NUMBER</tt>
and <tt>MILESTONE</tt> are specified properly when docs are built outside of
the normal release engineering process, with the intention of releasing them
on the web or in a downloaded docs bundle. (When invoked in release engineering's
control build, the values are always set properly. But when the targets are
run by themselves, they default to b00 and &quot;internal&quot;--which silently
sabotage the result of a build that can take many hours to complete.</p>
</body>
</html>

File diff suppressed because it is too large Load Diff

@ -397,3 +397,5 @@ e510dfdec6dd701410f3398ed86ebcdff0cca63a hs25-b58
c78d517c7ea47501b456e707afd4b78e7b5b202e hs25-b59
f573d00213b7170c2ff856f9cd83cd148437f5b9 jdk8-b117
abad3b2d905d9e1ad767c94baa94aba6ed5b207b hs25-b60
c9f439732b18ea16f7e65815327d5ea7092cc258 jdk8-b118
b2426da30009cd3069d03de073f351e6432c7682 hs25-b61

@ -35,7 +35,7 @@ HOTSPOT_VM_COPYRIGHT=Copyright 2013
HS_MAJOR_VER=25
HS_MINOR_VER=0
HS_BUILD_NUMBER=60
HS_BUILD_NUMBER=61
JDK_MAJOR_VER=1
JDK_MINOR_VER=8

@ -4483,8 +4483,8 @@ void ClassFileParser::check_final_method_override(instanceKlassHandle this_klass
for (int index = 0; index < num_methods; index++) {
Method* m = methods->at(index);
// skip static and <init> methods
if ((!m->is_static()) &&
// skip private, static, and <init> methods
if ((!m->is_private() && !m->is_static()) &&
(m->name() != vmSymbols::object_initializer_name())) {
Symbol* name = m->name();

@ -62,13 +62,13 @@
#include "runtime/safepoint.hpp"
#include "runtime/synchronizer.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"
#if INCLUDE_TRACE
#include "trace/tracing.hpp"
#endif
ClassLoaderData * ClassLoaderData::_the_null_class_loader_data = NULL;
ClassLoaderData::ClassLoaderData(Handle h_class_loader, bool is_anonymous, Dependencies dependencies) :
@ -754,7 +754,7 @@ void ClassLoaderDataGraph::post_class_unload_events(void) {
if (Tracing::enabled()) {
if (Tracing::is_event_enabled(TraceClassUnloadEvent)) {
assert(_unloading != NULL, "need class loader data unload list!");
_class_unload_time = Tracing::time();
_class_unload_time = Ticks::now();
classes_unloading_do(&class_unload_event);
}
Tracing::on_unloading_classes();
@ -832,7 +832,7 @@ void ClassLoaderData::print_value_on(outputStream* out) const {
#if INCLUDE_TRACE
TracingTime ClassLoaderDataGraph::_class_unload_time;
Ticks ClassLoaderDataGraph::_class_unload_time;
void ClassLoaderDataGraph::class_unload_event(Klass* const k) {

@ -33,7 +33,7 @@
#include "utilities/growableArray.hpp"
#if INCLUDE_TRACE
# include "trace/traceTime.hpp"
# include "utilities/ticks.hpp"
#endif
//
@ -98,7 +98,7 @@ class ClassLoaderDataGraph : public AllStatic {
#if INCLUDE_TRACE
private:
static TracingTime _class_unload_time;
static Ticks _class_unload_time;
static void class_unload_event(Klass* const k);
#endif
};

@ -55,13 +55,13 @@
#include "runtime/signature.hpp"
#include "services/classLoadingService.hpp"
#include "services/threadService.hpp"
#include "utilities/macros.hpp"
#include "utilities/ticks.hpp"
#if INCLUDE_TRACE
#include "trace/tracing.hpp"
#include "trace/traceMacros.hpp"
#endif
Dictionary* SystemDictionary::_dictionary = NULL;
PlaceholderTable* SystemDictionary::_placeholders = NULL;
Dictionary* SystemDictionary::_shared_dictionary = NULL;
@ -598,7 +598,7 @@ Klass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
assert(name != NULL && !FieldType::is_array(name) &&
!FieldType::is_obj(name), "invalid class name");
TracingTime class_load_start_time = Tracing::time();
Ticks class_load_start_time = Ticks::now();
// UseNewReflection
// Fix for 4474172; see evaluation for more details
@ -1006,7 +1006,7 @@ Klass* SystemDictionary::parse_stream(Symbol* class_name,
TRAPS) {
TempNewSymbol parsed_name = NULL;
TracingTime class_load_start_time = Tracing::time();
Ticks class_load_start_time = Ticks::now();
ClassLoaderData* loader_data;
if (host_klass.not_null()) {
@ -2665,13 +2665,12 @@ void SystemDictionary::verify_obj_klass_present(Symbol* class_name,
}
// utility function for class load event
void SystemDictionary::post_class_load_event(TracingTime start_time,
void SystemDictionary::post_class_load_event(const Ticks& start_time,
instanceKlassHandle k,
Handle initiating_loader) {
#if INCLUDE_TRACE
EventClassLoad event(UNTIMED);
if (event.should_commit()) {
event.set_endtime(Tracing::time());
event.set_starttime(start_time);
event.set_loadedClass(k());
oop defining_class_loader = k->class_loader();

@ -31,7 +31,6 @@
#include "oops/symbol.hpp"
#include "runtime/java.hpp"
#include "runtime/reflectionUtils.hpp"
#include "trace/traceTime.hpp"
#include "utilities/hashtable.hpp"
#include "utilities/hashtable.inline.hpp"
@ -78,6 +77,7 @@ class LoaderConstraintTable;
template <MEMFLAGS F> class HashtableBucket;
class ResolutionErrorTable;
class SymbolPropertyTable;
class Ticks;
// Certain classes are preloaded, such as java.lang.Object and java.lang.String.
// They are all "well-known", in the sense that no class loader is allowed
@ -165,6 +165,7 @@ class SymbolPropertyTable;
\
do_klass(StringBuffer_klass, java_lang_StringBuffer, Pre ) \
do_klass(StringBuilder_klass, java_lang_StringBuilder, Pre ) \
do_klass(misc_Unsafe_klass, sun_misc_Unsafe, Pre ) \
\
/* It's NULL in non-1.4 JDKs. */ \
do_klass(StackTraceElement_klass, java_lang_StackTraceElement, Opt ) \
@ -637,7 +638,7 @@ private:
static void add_to_hierarchy(instanceKlassHandle k, TRAPS);
// event based tracing
static void post_class_load_event(TracingTime start_time, instanceKlassHandle k,
static void post_class_load_event(const Ticks& start_time, instanceKlassHandle k,
Handle initiating_loader);
// We pass in the hashtable index so we can calculate it outside of
// the SystemDictionary_lock.

@ -2302,6 +2302,24 @@ void ClassVerifier::verify_invoke_init(
}
}
bool ClassVerifier::is_same_or_direct_interface(
instanceKlassHandle klass,
VerificationType klass_type,
VerificationType ref_class_type) {
if (ref_class_type.equals(klass_type)) return true;
Array<Klass*>* local_interfaces = klass->local_interfaces();
if (local_interfaces != NULL) {
for (int x = 0; x < local_interfaces->length(); x++) {
Klass* k = local_interfaces->at(x);
assert (k != NULL && k->is_interface(), "invalid interface");
if (ref_class_type.equals(VerificationType::reference_type(k->name()))) {
return true;
}
}
}
return false;
}
void ClassVerifier::verify_invoke_instructions(
RawBytecodeStream* bcs, u4 code_length, StackMapFrame* current_frame,
bool *this_uninit, VerificationType return_type,
@ -2432,23 +2450,38 @@ void ClassVerifier::verify_invoke_instructions(
return;
}
} else if (opcode == Bytecodes::_invokespecial
&& !ref_class_type.equals(current_type())
&& !is_same_or_direct_interface(current_class(), current_type(), ref_class_type)
&& !ref_class_type.equals(VerificationType::reference_type(
current_class()->super()->name()))) {
bool subtype = false;
bool have_imr_indirect = cp->tag_at(index).value() == JVM_CONSTANT_InterfaceMethodref;
if (!current_class()->is_anonymous()) {
subtype = ref_class_type.is_assignable_from(
current_type(), this, CHECK_VERIFY(this));
} else {
subtype = ref_class_type.is_assignable_from(VerificationType::reference_type(
current_class()->host_klass()->name()), this, CHECK_VERIFY(this));
VerificationType host_klass_type =
VerificationType::reference_type(current_class()->host_klass()->name());
subtype = ref_class_type.is_assignable_from(host_klass_type, this, CHECK_VERIFY(this));
// If invokespecial of IMR, need to recheck for same or
// direct interface relative to the host class
have_imr_indirect = (have_imr_indirect &&
!is_same_or_direct_interface(
InstanceKlass::cast(current_class()->host_klass()),
host_klass_type, ref_class_type));
}
if (!subtype) {
verify_error(ErrorContext::bad_code(bci),
"Bad invokespecial instruction: "
"current class isn't assignable to reference class.");
return;
} else if (have_imr_indirect) {
verify_error(ErrorContext::bad_code(bci),
"Bad invokespecial instruction: "
"interface method reference is in an indirect superinterface.");
return;
}
}
// Match method descriptor with operand stack
for (int i = nargs - 1; i >= 0; i--) { // Run backwards

@ -345,6 +345,9 @@ class ClassVerifier : public StackObj {
// that a class has been verified and prepared for execution.
bool was_recursively_verified() { return _klass->is_rewritten(); }
bool is_same_or_direct_interface(instanceKlassHandle klass,
VerificationType klass_type, VerificationType ref_class_type);
public:
enum {
BYTECODE_OFFSET = 1,

@ -331,6 +331,7 @@
template(findNative_name, "findNative") \
template(deadChild_name, "deadChild") \
template(addClass_name, "addClass") \
template(throwIllegalAccessError_name, "throwIllegalAccessError") \
template(getFromClass_name, "getFromClass") \
template(dispatch_name, "dispatch") \
template(getSystemClassLoader_name, "getSystemClassLoader") \

@ -1993,7 +1993,7 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
GenCollectedHeap* gch = GenCollectedHeap::heap();
STWGCTimer* gc_timer = GenMarkSweep::gc_timer();
gc_timer->register_gc_start(os::elapsed_counter());
gc_timer->register_gc_start();
SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
@ -2089,7 +2089,7 @@ void CMSCollector::do_compaction_work(bool clear_all_soft_refs) {
size_policy()->msc_collection_end(gch->gc_cause());
}
gc_timer->register_gc_end(os::elapsed_counter());
gc_timer->register_gc_end();
gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
@ -2475,7 +2475,7 @@ void CMSCollector::register_foreground_gc_start(GCCause::Cause cause) {
void CMSCollector::register_gc_start(GCCause::Cause cause) {
_cms_start_registered = true;
_gc_timer_cm->register_gc_start(os::elapsed_counter());
_gc_timer_cm->register_gc_start();
_gc_tracer_cm->report_gc_start(cause, _gc_timer_cm->gc_start());
}
@ -2483,7 +2483,7 @@ void CMSCollector::register_gc_end() {
if (_cms_start_registered) {
report_heap_summary(GCWhen::AfterGC);
_gc_timer_cm->register_gc_end(os::elapsed_counter());
_gc_timer_cm->register_gc_end();
_gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions());
_cms_start_registered = false;
}

@ -145,7 +145,7 @@ void VM_CMS_Initial_Mark::doit() {
);
#endif /* USDT2 */
_collector->_gc_timer_cm->register_gc_pause_start("Initial Mark", os::elapsed_counter());
_collector->_gc_timer_cm->register_gc_pause_start("Initial Mark");
GenCollectedHeap* gch = GenCollectedHeap::heap();
GCCauseSetter gccs(gch, GCCause::_cms_initial_mark);
@ -157,7 +157,7 @@ void VM_CMS_Initial_Mark::doit() {
VM_CMS_Operation::verify_after_gc();
_collector->_gc_timer_cm->register_gc_pause_end(os::elapsed_counter());
_collector->_gc_timer_cm->register_gc_pause_end();
#ifndef USDT2
HS_DTRACE_PROBE(hs_private, cms__initmark__end);
@ -182,7 +182,7 @@ void VM_CMS_Final_Remark::doit() {
);
#endif /* USDT2 */
_collector->_gc_timer_cm->register_gc_pause_start("Final Mark", os::elapsed_counter());
_collector->_gc_timer_cm->register_gc_pause_start("Final Mark");
GenCollectedHeap* gch = GenCollectedHeap::heap();
GCCauseSetter gccs(gch, GCCause::_cms_final_remark);
@ -195,7 +195,7 @@ void VM_CMS_Final_Remark::doit() {
VM_CMS_Operation::verify_after_gc();
_collector->save_heap_summary();
_collector->_gc_timer_cm->register_gc_pause_end(os::elapsed_counter());
_collector->_gc_timer_cm->register_gc_pause_end();
#ifndef USDT2
HS_DTRACE_PROBE(hs_private, cms__remark__end);

@ -56,6 +56,7 @@
#include "oops/oop.inline.hpp"
#include "oops/oop.pcgc.inline.hpp"
#include "runtime/vmThread.hpp"
#include "utilities/ticks.hpp"
size_t G1CollectedHeap::_humongous_object_threshold_in_words = 0;
@ -1284,7 +1285,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
}
STWGCTimer* gc_timer = G1MarkSweep::gc_timer();
gc_timer->register_gc_start(os::elapsed_counter());
gc_timer->register_gc_start();
SerialOldTracer* gc_tracer = G1MarkSweep::gc_tracer();
gc_tracer->report_gc_start(gc_cause(), gc_timer->gc_start());
@ -1552,7 +1553,7 @@ bool G1CollectedHeap::do_collection(bool explicit_gc,
post_full_gc_dump(gc_timer);
gc_timer->register_gc_end(os::elapsed_counter());
gc_timer->register_gc_end();
gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
}
@ -2482,7 +2483,7 @@ void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent) {
FullGCCount_lock->notify_all();
}
void G1CollectedHeap::register_concurrent_cycle_start(jlong start_time) {
void G1CollectedHeap::register_concurrent_cycle_start(const Ticks& start_time) {
_concurrent_cycle_started = true;
_gc_timer_cm->register_gc_start(start_time);
@ -2496,7 +2497,7 @@ void G1CollectedHeap::register_concurrent_cycle_end() {
_gc_tracer_cm->report_concurrent_mode_failure();
}
_gc_timer_cm->register_gc_end(os::elapsed_counter());
_gc_timer_cm->register_gc_end();
_gc_tracer_cm->report_gc_end(_gc_timer_cm->gc_end(), _gc_timer_cm->time_partitions());
_concurrent_cycle_started = false;
@ -3887,7 +3888,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
return false;
}
_gc_timer_stw->register_gc_start(os::elapsed_counter());
_gc_timer_stw->register_gc_start();
_gc_tracer_stw->report_gc_start(gc_cause(), _gc_timer_stw->gc_start());
@ -4265,7 +4266,7 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
_gc_tracer_stw->report_evacuation_info(&evacuation_info);
_gc_tracer_stw->report_tenuring_threshold(_g1_policy->tenuring_threshold());
_gc_timer_stw->register_gc_end(os::elapsed_counter());
_gc_timer_stw->register_gc_end();
_gc_tracer_stw->report_gc_end(_gc_timer_stw->gc_end(), _gc_timer_stw->time_partitions());
}
// It should now be safe to tell the concurrent mark thread to start

@ -72,6 +72,7 @@ class G1NewTracer;
class G1OldTracer;
class EvacuationFailedInfo;
class nmethod;
class Ticks;
typedef OverflowTaskQueue<StarTask, mtGC> RefToScanQueue;
typedef GenericTaskQueueSet<RefToScanQueue, mtGC> RefToScanQueueSet;
@ -746,7 +747,7 @@ public:
return _old_marking_cycles_completed;
}
void register_concurrent_cycle_start(jlong start_time);
void register_concurrent_cycle_start(const Ticks& start_time);
void register_concurrent_cycle_end();
void trace_heap_after_concurrent_cycle();

@ -915,7 +915,7 @@ void ParNewGeneration::collect(bool full,
GenCollectedHeap* gch = GenCollectedHeap::heap();
_gc_timer->register_gc_start(os::elapsed_counter());
_gc_timer->register_gc_start();
assert(gch->kind() == CollectedHeap::GenCollectedHeap,
"not a CMS generational heap");
@ -1091,7 +1091,7 @@ void ParNewGeneration::collect(bool full,
gch->trace_heap_after_gc(&gc_tracer);
gc_tracer.report_tenuring_threshold(tenuring_threshold());
_gc_timer->register_gc_end(os::elapsed_counter());
_gc_timer->register_gc_end();
gc_tracer.report_gc_end(_gc_timer->gc_end(), _gc_timer->time_partitions());
}

@ -114,7 +114,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity");
GCCause::Cause gc_cause = heap->gc_cause();
_gc_timer->register_gc_start(os::elapsed_counter());
_gc_timer->register_gc_start();
_gc_tracer->report_gc_start(gc_cause, _gc_timer->gc_start());
PSAdaptiveSizePolicy* size_policy = heap->size_policy();
@ -390,7 +390,7 @@ bool PSMarkSweep::invoke_no_policy(bool clear_all_softrefs) {
ParallelTaskTerminator::print_termination_counts();
#endif
_gc_timer->register_gc_end(os::elapsed_counter());
_gc_timer->register_gc_end();
_gc_tracer->report_gc_end(_gc_timer->gc_end(), _gc_timer->time_partitions());

@ -2006,7 +2006,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
ParallelScavengeHeap* heap = gc_heap();
_gc_timer.register_gc_start(os::elapsed_counter());
_gc_timer.register_gc_start();
_gc_tracer.report_gc_start(heap->gc_cause(), _gc_timer.gc_start());
TimeStamp marking_start;
@ -2244,7 +2244,7 @@ bool PSParallelCompact::invoke_no_policy(bool maximum_heap_compaction) {
ParallelTaskTerminator::print_termination_counts();
#endif
_gc_timer.register_gc_end(os::elapsed_counter());
_gc_timer.register_gc_end();
_gc_tracer.report_dense_prefix(dense_prefix(old_space_id));
_gc_tracer.report_gc_end(_gc_timer.gc_end(), _gc_timer.time_partitions());

@ -263,7 +263,7 @@ bool PSScavenge::invoke_no_policy() {
assert(_preserved_mark_stack.is_empty(), "should be empty");
assert(_preserved_oop_stack.is_empty(), "should be empty");
_gc_timer.register_gc_start(os::elapsed_counter());
_gc_timer.register_gc_start();
TimeStamp scavenge_entry;
TimeStamp scavenge_midpoint;
@ -691,7 +691,7 @@ bool PSScavenge::invoke_no_policy() {
#endif
_gc_timer.register_gc_end(os::elapsed_counter());
_gc_timer.register_gc_end();
_gc_tracer.report_gc_end(_gc_timer.gc_end(), _gc_timer.time_partitions());

@ -25,52 +25,55 @@
#include "precompiled.hpp"
#include "gc_implementation/shared/gcTimer.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/ticks.inline.hpp"
void GCTimer::register_gc_start(jlong time) {
// the "time" parameter for most functions
// has a default value set by Ticks::now()
void GCTimer::register_gc_start(const Ticks& time) {
_time_partitions.clear();
_gc_start = time;
}
void GCTimer::register_gc_end(jlong time) {
void GCTimer::register_gc_end(const Ticks& time) {
assert(!_time_partitions.has_active_phases(),
"We should have ended all started phases, before ending the GC");
_gc_end = time;
}
void GCTimer::register_gc_pause_start(const char* name, jlong time) {
void GCTimer::register_gc_pause_start(const char* name, const Ticks& time) {
_time_partitions.report_gc_phase_start(name, time);
}
void GCTimer::register_gc_pause_end(jlong time) {
void GCTimer::register_gc_pause_end(const Ticks& time) {
_time_partitions.report_gc_phase_end(time);
}
void GCTimer::register_gc_phase_start(const char* name, jlong time) {
void GCTimer::register_gc_phase_start(const char* name, const Ticks& time) {
_time_partitions.report_gc_phase_start(name, time);
}
void GCTimer::register_gc_phase_end(jlong time) {
void GCTimer::register_gc_phase_end(const Ticks& time) {
_time_partitions.report_gc_phase_end(time);
}
void STWGCTimer::register_gc_start(jlong time) {
void STWGCTimer::register_gc_start(const Ticks& time) {
GCTimer::register_gc_start(time);
register_gc_pause_start("GC Pause", time);
}
void STWGCTimer::register_gc_end(jlong time) {
void STWGCTimer::register_gc_end(const Ticks& time) {
register_gc_pause_end(time);
GCTimer::register_gc_end(time);
}
void ConcurrentGCTimer::register_gc_pause_start(const char* name, jlong time) {
GCTimer::register_gc_pause_start(name, time);
void ConcurrentGCTimer::register_gc_pause_start(const char* name) {
GCTimer::register_gc_pause_start(name);
}
void ConcurrentGCTimer::register_gc_pause_end(jlong time) {
GCTimer::register_gc_pause_end(time);
void ConcurrentGCTimer::register_gc_pause_end() {
GCTimer::register_gc_pause_end();
}
void PhasesStack::clear() {
@ -111,11 +114,11 @@ TimePartitions::~TimePartitions() {
void TimePartitions::clear() {
_phases->clear();
_active_phases.clear();
_sum_of_pauses = 0;
_longest_pause = 0;
_sum_of_pauses = Tickspan();
_longest_pause = Tickspan();
}
void TimePartitions::report_gc_phase_start(const char* name, jlong time) {
void TimePartitions::report_gc_phase_start(const char* name, const Ticks& time) {
assert(_phases->length() <= 1000, "Too many recored phases?");
int level = _active_phases.count();
@ -133,13 +136,13 @@ void TimePartitions::report_gc_phase_start(const char* name, jlong time) {
void TimePartitions::update_statistics(GCPhase* phase) {
// FIXME: This should only be done for pause phases
if (phase->level() == 0) {
jlong pause = phase->end() - phase->start();
const Tickspan pause = phase->end() - phase->start();
_sum_of_pauses += pause;
_longest_pause = MAX2(pause, _longest_pause);
}
}
void TimePartitions::report_gc_phase_end(jlong time) {
void TimePartitions::report_gc_phase_end(const Ticks& time) {
int phase_index = _active_phases.pop();
GCPhase* phase = _phases->adr_at(phase_index);
phase->set_end(time);
@ -157,14 +160,6 @@ GCPhase* TimePartitions::phase_at(int index) const {
return _phases->adr_at(index);
}
jlong TimePartitions::sum_of_pauses() {
return _sum_of_pauses;
}
jlong TimePartitions::longest_pause() {
return _longest_pause;
}
bool TimePartitions::has_active_phases() {
return _active_phases.count() > 0;
}
@ -194,7 +189,7 @@ class TimePartitionPhasesIteratorTest {
max_nested_pause_phases();
}
static void validate_pause_phase(GCPhase* phase, int level, const char* name, jlong start, jlong end) {
static void validate_pause_phase(GCPhase* phase, int level, const char* name, const Ticks& start, const Ticks& end) {
assert(phase->level() == level, "Incorrect level");
assert(strcmp(phase->name(), name) == 0, "Incorrect name");
assert(phase->start() == start, "Incorrect start");
@ -209,8 +204,8 @@ class TimePartitionPhasesIteratorTest {
TimePartitionPhasesIterator iter(&time_partitions);
validate_pause_phase(iter.next(), 0, "PausePhase", 2, 8);
assert(time_partitions.sum_of_pauses() == 8-2, "Incorrect");
assert(time_partitions.longest_pause() == 8-2, "Incorrect");
assert(time_partitions.sum_of_pauses() == Ticks(8) - Ticks(2), "Incorrect");
assert(time_partitions.longest_pause() == Ticks(8) - Ticks(2), "Incorrect");
assert(!iter.has_next(), "Too many elements");
}
@ -227,8 +222,8 @@ class TimePartitionPhasesIteratorTest {
validate_pause_phase(iter.next(), 0, "PausePhase1", 2, 3);
validate_pause_phase(iter.next(), 0, "PausePhase2", 4, 6);
assert(time_partitions.sum_of_pauses() == 3, "Incorrect");
assert(time_partitions.longest_pause() == 2, "Incorrect");
assert(time_partitions.sum_of_pauses() == Ticks(3) - Ticks(0), "Incorrect");
assert(time_partitions.longest_pause() == Ticks(2) - Ticks(0), "Incorrect");
assert(!iter.has_next(), "Too many elements");
}
@ -245,8 +240,8 @@ class TimePartitionPhasesIteratorTest {
validate_pause_phase(iter.next(), 0, "PausePhase", 2, 5);
validate_pause_phase(iter.next(), 1, "SubPhase", 3, 4);
assert(time_partitions.sum_of_pauses() == 3, "Incorrect");
assert(time_partitions.longest_pause() == 3, "Incorrect");
assert(time_partitions.sum_of_pauses() == Ticks(3) - Ticks(0), "Incorrect");
assert(time_partitions.longest_pause() == Ticks(3) - Ticks(0), "Incorrect");
assert(!iter.has_next(), "Too many elements");
}
@ -269,8 +264,8 @@ class TimePartitionPhasesIteratorTest {
validate_pause_phase(iter.next(), 2, "SubPhase2", 4, 7);
validate_pause_phase(iter.next(), 3, "SubPhase3", 5, 6);
assert(time_partitions.sum_of_pauses() == 7, "Incorrect");
assert(time_partitions.longest_pause() == 7, "Incorrect");
assert(time_partitions.sum_of_pauses() == Ticks(7) - Ticks(0), "Incorrect");
assert(time_partitions.longest_pause() == Ticks(7) - Ticks(0), "Incorrect");
assert(!iter.has_next(), "Too many elements");
}
@ -298,8 +293,8 @@ class TimePartitionPhasesIteratorTest {
validate_pause_phase(iter.next(), 1, "SubPhase3", 7, 8);
validate_pause_phase(iter.next(), 1, "SubPhase4", 9, 10);
assert(time_partitions.sum_of_pauses() == 9, "Incorrect");
assert(time_partitions.longest_pause() == 9, "Incorrect");
assert(time_partitions.sum_of_pauses() == Ticks(9) - Ticks(0), "Incorrect");
assert(time_partitions.longest_pause() == Ticks(9) - Ticks(0), "Incorrect");
assert(!iter.has_next(), "Too many elements");
}
@ -336,8 +331,8 @@ class TimePartitionPhasesIteratorTest {
validate_pause_phase(iter.next(), 2, "SubPhase22", 12, 13);
validate_pause_phase(iter.next(), 1, "SubPhase3", 15, 16);
assert(time_partitions.sum_of_pauses() == 15, "Incorrect");
assert(time_partitions.longest_pause() == 15, "Incorrect");
assert(time_partitions.sum_of_pauses() == Ticks(15) - Ticks(0), "Incorrect");
assert(time_partitions.longest_pause() == Ticks(15) - Ticks(0), "Incorrect");
assert(!iter.has_next(), "Too many elements");
}

@ -28,6 +28,7 @@
#include "memory/allocation.hpp"
#include "prims/jni_md.h"
#include "utilities/macros.hpp"
#include "utilities/ticks.hpp"
class ConcurrentPhase;
class GCPhase;
@ -45,21 +46,21 @@ class PhaseVisitor {
class GCPhase {
const char* _name;
int _level;
jlong _start;
jlong _end;
Ticks _start;
Ticks _end;
public:
void set_name(const char* name) { _name = name; }
const char* name() { return _name; }
const char* name() const { return _name; }
int level() { return _level; }
int level() const { return _level; }
void set_level(int level) { _level = level; }
jlong start() { return _start; }
void set_start(jlong time) { _start = time; }
const Ticks start() const { return _start; }
void set_start(const Ticks& time) { _start = time; }
jlong end() { return _end; }
void set_end(jlong time) { _end = time; }
const Ticks end() const { return _end; }
void set_end(const Ticks& time) { _end = time; }
virtual void accept(PhaseVisitor* visitor) = 0;
};
@ -102,22 +103,22 @@ class TimePartitions {
GrowableArray<PausePhase>* _phases;
PhasesStack _active_phases;
jlong _sum_of_pauses;
jlong _longest_pause;
Tickspan _sum_of_pauses;
Tickspan _longest_pause;
public:
TimePartitions();
~TimePartitions();
void clear();
void report_gc_phase_start(const char* name, jlong time);
void report_gc_phase_end(jlong time);
void report_gc_phase_start(const char* name, const Ticks& time);
void report_gc_phase_end(const Ticks& time);
int num_phases() const;
GCPhase* phase_at(int index) const;
jlong sum_of_pauses();
jlong longest_pause();
const Tickspan sum_of_pauses() const { return _sum_of_pauses; }
const Tickspan longest_pause() const { return _longest_pause; }
bool has_active_phases();
private:
@ -133,40 +134,37 @@ class PhasesIterator {
class GCTimer : public ResourceObj {
NOT_PRODUCT(friend class GCTimerTest;)
protected:
jlong _gc_start;
jlong _gc_end;
Ticks _gc_start;
Ticks _gc_end;
TimePartitions _time_partitions;
public:
virtual void register_gc_start(jlong time);
virtual void register_gc_end(jlong time);
virtual void register_gc_start(const Ticks& time = Ticks::now());
virtual void register_gc_end(const Ticks& time = Ticks::now());
void register_gc_phase_start(const char* name, jlong time);
void register_gc_phase_end(jlong time);
void register_gc_phase_start(const char* name, const Ticks& time);
void register_gc_phase_end(const Ticks& time);
jlong gc_start() { return _gc_start; }
jlong gc_end() { return _gc_end; }
const Ticks gc_start() const { return _gc_start; }
const Ticks gc_end() const { return _gc_end; }
TimePartitions* time_partitions() { return &_time_partitions; }
long longest_pause();
long sum_of_pauses();
protected:
void register_gc_pause_start(const char* name, jlong time);
void register_gc_pause_end(jlong time);
void register_gc_pause_start(const char* name, const Ticks& time = Ticks::now());
void register_gc_pause_end(const Ticks& time = Ticks::now());
};
class STWGCTimer : public GCTimer {
public:
virtual void register_gc_start(jlong time);
virtual void register_gc_end(jlong time);
virtual void register_gc_start(const Ticks& time = Ticks::now());
virtual void register_gc_end(const Ticks& time = Ticks::now());
};
class ConcurrentGCTimer : public GCTimer {
public:
void register_gc_pause_start(const char* name, jlong time);
void register_gc_pause_end(jlong time);
void register_gc_pause_start(const char* name);
void register_gc_pause_end();
};
class TimePartitionPhasesIterator {

@ -32,6 +32,7 @@
#include "memory/referenceProcessorStats.hpp"
#include "runtime/os.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/ticks.inline.hpp"
#if INCLUDE_ALL_GCS
#include "gc_implementation/g1/evacuationInfo.hpp"
@ -45,7 +46,7 @@ static GCId create_new_gc_id() {
return GCTracer_next_gc_id++;
}
void GCTracer::report_gc_start_impl(GCCause::Cause cause, jlong timestamp) {
void GCTracer::report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp) {
assert_unset_gc_id();
GCId gc_id = create_new_gc_id();
@ -54,7 +55,7 @@ void GCTracer::report_gc_start_impl(GCCause::Cause cause, jlong timestamp) {
_shared_gc_info.set_start_timestamp(timestamp);
}
void GCTracer::report_gc_start(GCCause::Cause cause, jlong timestamp) {
void GCTracer::report_gc_start(GCCause::Cause cause, const Ticks& timestamp) {
assert_unset_gc_id();
report_gc_start_impl(cause, timestamp);
@ -64,7 +65,7 @@ bool GCTracer::has_reported_gc_start() const {
return _shared_gc_info.id() != SharedGCInfo::UNSET_GCID;
}
void GCTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) {
void GCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
assert_set_gc_id();
_shared_gc_info.set_sum_of_pauses(time_partitions->sum_of_pauses());
@ -75,7 +76,7 @@ void GCTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitio
send_garbage_collection_event();
}
void GCTracer::report_gc_end(jlong timestamp, TimePartitions* time_partitions) {
void GCTracer::report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions) {
assert_set_gc_id();
report_gc_end_impl(timestamp, time_partitions);
@ -97,10 +98,10 @@ class ObjectCountEventSenderClosure : public KlassInfoClosure {
const GCId _gc_id;
const double _size_threshold_percentage;
const size_t _total_size_in_words;
const jlong _timestamp;
const Ticks _timestamp;
public:
ObjectCountEventSenderClosure(GCId gc_id, size_t total_size_in_words, jlong timestamp) :
ObjectCountEventSenderClosure(GCId gc_id, size_t total_size_in_words, const Ticks& timestamp) :
_gc_id(gc_id),
_size_threshold_percentage(ObjectCountCutOffPercent / 100),
_total_size_in_words(total_size_in_words),
@ -131,9 +132,7 @@ void GCTracer::report_object_count_after_gc(BoolObjectClosure* is_alive_cl) {
if (!cit.allocation_failed()) {
HeapInspection hi(false, false, false, NULL);
hi.populate_table(&cit, is_alive_cl);
jlong timestamp = os::elapsed_counter();
ObjectCountEventSenderClosure event_sender(_shared_gc_info.id(), cit.size_of_instances_in_words(), timestamp);
ObjectCountEventSenderClosure event_sender(_shared_gc_info.id(), cit.size_of_instances_in_words(), Ticks::now());
cit.iterate(&event_sender);
}
}
@ -147,7 +146,7 @@ void GCTracer::report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& he
send_meta_space_summary_event(when, meta_space_summary);
}
void YoungGCTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) {
void YoungGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
assert_set_gc_id();
assert(_tenuring_threshold != UNSET_TENURING_THRESHOLD, "Tenuring threshold has not been reported");
@ -167,14 +166,14 @@ void YoungGCTracer::report_tenuring_threshold(const uint tenuring_threshold) {
_tenuring_threshold = tenuring_threshold;
}
void OldGCTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) {
void OldGCTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
assert_set_gc_id();
GCTracer::report_gc_end_impl(timestamp, time_partitions);
send_old_gc_event();
}
void ParallelOldTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) {
void ParallelOldTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
assert_set_gc_id();
OldGCTracer::report_gc_end_impl(timestamp, time_partitions);
@ -200,7 +199,7 @@ void G1NewTracer::report_yc_type(G1YCType type) {
_g1_young_gc_info.set_type(type);
}
void G1NewTracer::report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions) {
void G1NewTracer::report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions) {
assert_set_gc_id();
YoungGCTracer::report_gc_end_impl(timestamp, time_partitions);

@ -35,6 +35,7 @@
#include "gc_implementation/g1/g1YCTypes.hpp"
#endif
#include "utilities/macros.hpp"
#include "utilities/ticks.hpp"
typedef uint GCId;
@ -47,8 +48,6 @@ class TimePartitions;
class BoolObjectClosure;
class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
static const jlong UNSET_TIMESTAMP = -1;
public:
static const GCId UNSET_GCID = (GCId)-1;
@ -56,23 +55,30 @@ class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
GCId _id;
GCName _name;
GCCause::Cause _cause;
jlong _start_timestamp;
jlong _end_timestamp;
jlong _sum_of_pauses;
jlong _longest_pause;
Ticks _start_timestamp;
Ticks _end_timestamp;
Tickspan _sum_of_pauses;
Tickspan _longest_pause;
public:
SharedGCInfo(GCName name) : _id(UNSET_GCID), _name(name), _cause(GCCause::_last_gc_cause),
_start_timestamp(UNSET_TIMESTAMP), _end_timestamp(UNSET_TIMESTAMP), _sum_of_pauses(0), _longest_pause(0) {}
SharedGCInfo(GCName name) :
_id(UNSET_GCID),
_name(name),
_cause(GCCause::_last_gc_cause),
_start_timestamp(),
_end_timestamp(),
_sum_of_pauses(),
_longest_pause() {
}
void set_id(GCId id) { _id = id; }
GCId id() const { return _id; }
void set_start_timestamp(jlong timestamp) { _start_timestamp = timestamp; }
jlong start_timestamp() const { return _start_timestamp; }
void set_start_timestamp(const Ticks& timestamp) { _start_timestamp = timestamp; }
const Ticks start_timestamp() const { return _start_timestamp; }
void set_end_timestamp(jlong timestamp) { _end_timestamp = timestamp; }
jlong end_timestamp() const { return _end_timestamp; }
void set_end_timestamp(const Ticks& timestamp) { _end_timestamp = timestamp; }
const Ticks end_timestamp() const { return _end_timestamp; }
void set_name(GCName name) { _name = name; }
GCName name() const { return _name; }
@ -80,11 +86,11 @@ class SharedGCInfo VALUE_OBJ_CLASS_SPEC {
void set_cause(GCCause::Cause cause) { _cause = cause; }
GCCause::Cause cause() const { return _cause; }
void set_sum_of_pauses(jlong duration) { _sum_of_pauses = duration; }
jlong sum_of_pauses() const { return _sum_of_pauses; }
void set_sum_of_pauses(const Tickspan& duration) { _sum_of_pauses = duration; }
const Tickspan sum_of_pauses() const { return _sum_of_pauses; }
void set_longest_pause(jlong duration) { _longest_pause = duration; }
jlong longest_pause() const { return _longest_pause; }
void set_longest_pause(const Tickspan& duration) { _longest_pause = duration; }
const Tickspan longest_pause() const { return _longest_pause; }
};
class ParallelOldGCInfo VALUE_OBJ_CLASS_SPEC {
@ -116,8 +122,8 @@ class GCTracer : public ResourceObj {
SharedGCInfo _shared_gc_info;
public:
void report_gc_start(GCCause::Cause cause, jlong timestamp);
void report_gc_end(jlong timestamp, TimePartitions* time_partitions);
void report_gc_start(GCCause::Cause cause, const Ticks& timestamp);
void report_gc_end(const Ticks& timestamp, TimePartitions* time_partitions);
void report_gc_heap_summary(GCWhen::Type when, const GCHeapSummary& heap_summary, const MetaspaceSummary& meta_space_summary) const;
void report_gc_reference_stats(const ReferenceProcessorStats& rp) const;
void report_object_count_after_gc(BoolObjectClosure* object_filter) NOT_SERVICES_RETURN;
@ -125,8 +131,8 @@ class GCTracer : public ResourceObj {
protected:
GCTracer(GCName name) : _shared_gc_info(name) {}
virtual void report_gc_start_impl(GCCause::Cause cause, jlong timestamp);
virtual void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions);
virtual void report_gc_start_impl(GCCause::Cause cause, const Ticks& timestamp);
virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
private:
void send_garbage_collection_event() const;
@ -143,7 +149,7 @@ class YoungGCTracer : public GCTracer {
protected:
YoungGCTracer(GCName name) : GCTracer(name), _tenuring_threshold(UNSET_TENURING_THRESHOLD) {}
virtual void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions);
virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
public:
void report_promotion_failed(const PromotionFailedInfo& pf_info);
@ -157,7 +163,7 @@ class YoungGCTracer : public GCTracer {
class OldGCTracer : public GCTracer {
protected:
OldGCTracer(GCName name) : GCTracer(name) {}
virtual void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions);
virtual void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
public:
void report_concurrent_mode_failure();
@ -175,7 +181,7 @@ class ParallelOldTracer : public OldGCTracer {
void report_dense_prefix(void* dense_prefix);
protected:
void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions);
void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
private:
void send_parallel_old_event() const;
@ -209,7 +215,7 @@ class G1NewTracer : public YoungGCTracer {
G1NewTracer() : YoungGCTracer(G1New) {}
void report_yc_type(G1YCType type);
void report_gc_end_impl(jlong timestamp, TimePartitions* time_partitions);
void report_gc_end_impl(const Ticks& timestamp, TimePartitions* time_partitions);
void report_evacuation_info(EvacuationInfo* info);
void report_evacuation_failed(EvacuationFailedInfo& ef_info);

@ -55,12 +55,11 @@ void GCTracer::send_garbage_collection_event() const {
}
void GCTracer::send_reference_stats_event(ReferenceType type, size_t count) const {
EventGCReferenceStatistics e(UNTIMED);
EventGCReferenceStatistics e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_type((u1)type);
e.set_count(count);
e.set_endtime(os::elapsed_counter());
e.commit();
}
}
@ -107,22 +106,20 @@ static TraceStructCopyFailed to_trace_struct(const CopyFailedInfo& cf_info) {
}
void YoungGCTracer::send_promotion_failed_event(const PromotionFailedInfo& pf_info) const {
EventPromotionFailed e(UNTIMED);
EventPromotionFailed e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_data(to_trace_struct(pf_info));
e.set_thread(pf_info.thread()->thread_id());
e.set_endtime(os::elapsed_counter());
e.commit();
}
}
// Common to CMS and G1
void OldGCTracer::send_concurrent_mode_failure_event() {
EventConcurrentModeFailure e(UNTIMED);
EventConcurrentModeFailure e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_endtime(os::elapsed_counter());
e.commit();
}
}
@ -140,7 +137,7 @@ void G1NewTracer::send_g1_young_gc_event() {
}
void G1NewTracer::send_evacuation_info_event(EvacuationInfo* info) {
EventEvacuationInfo e(UNTIMED);
EventEvacuationInfo e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_cSetRegions(info->collectionset_regions());
@ -151,17 +148,15 @@ void G1NewTracer::send_evacuation_info_event(EvacuationInfo* info) {
e.set_allocRegionsUsedAfter(info->alloc_regions_used_before() + info->bytes_copied());
e.set_bytesCopied(info->bytes_copied());
e.set_regionsFreed(info->regions_freed());
e.set_endtime(os::elapsed_counter());
e.commit();
}
}
void G1NewTracer::send_evacuation_failed_event(const EvacuationFailedInfo& ef_info) const {
EventEvacuationFailed e(UNTIMED);
EventEvacuationFailed e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_data(to_trace_struct(ef_info));
e.set_endtime(os::elapsed_counter());
e.commit();
}
}
@ -195,13 +190,12 @@ class GCHeapSummaryEventSender : public GCHeapSummaryVisitor {
void visit(const GCHeapSummary* heap_summary) const {
const VirtualSpaceSummary& heap_space = heap_summary->heap();
EventGCHeapSummary e(UNTIMED);
EventGCHeapSummary e;
if (e.should_commit()) {
e.set_gcId(_id);
e.set_when((u1)_when);
e.set_heapSpace(to_trace_struct(heap_space));
e.set_heapUsed(heap_summary->used());
e.set_endtime(os::elapsed_counter());
e.commit();
}
}
@ -216,7 +210,7 @@ class GCHeapSummaryEventSender : public GCHeapSummaryVisitor {
const SpaceSummary& from_space = ps_heap_summary->from();
const SpaceSummary& to_space = ps_heap_summary->to();
EventPSHeapSummary e(UNTIMED);
EventPSHeapSummary e;
if (e.should_commit()) {
e.set_gcId(_id);
e.set_when((u1)_when);
@ -227,7 +221,6 @@ class GCHeapSummaryEventSender : public GCHeapSummaryVisitor {
e.set_edenSpace(to_trace_struct(ps_heap_summary->eden()));
e.set_fromSpace(to_trace_struct(ps_heap_summary->from()));
e.set_toSpace(to_trace_struct(ps_heap_summary->to()));
e.set_endtime(os::elapsed_counter());
e.commit();
}
}
@ -249,14 +242,13 @@ static TraceStructMetaspaceSizes to_trace_struct(const MetaspaceSizes& sizes) {
}
void GCTracer::send_meta_space_summary_event(GCWhen::Type when, const MetaspaceSummary& meta_space_summary) const {
EventMetaspaceSummary e(UNTIMED);
EventMetaspaceSummary e;
if (e.should_commit()) {
e.set_gcId(_shared_gc_info.id());
e.set_when((u1) when);
e.set_metaspace(to_trace_struct(meta_space_summary.meta_space()));
e.set_dataSpace(to_trace_struct(meta_space_summary.data_space()));
e.set_classSpace(to_trace_struct(meta_space_summary.class_space()));
e.set_endtime(os::elapsed_counter());
e.commit();
}
}

@ -31,12 +31,13 @@
#include "runtime/thread.inline.hpp"
#include "runtime/timer.hpp"
#include "utilities/ostream.hpp"
#include "utilities/ticks.inline.hpp"
GCTraceTime::GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer) :
_title(title), _doit(doit), _print_cr(print_cr), _timer(timer) {
_title(title), _doit(doit), _print_cr(print_cr), _timer(timer), _start_counter() {
if (_doit || _timer != NULL) {
_start_counter = os::elapsed_counter();
_start_counter.stamp();
}
if (_timer != NULL) {
@ -57,10 +58,10 @@ GCTraceTime::GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* t
}
GCTraceTime::~GCTraceTime() {
jlong stop_counter = 0;
Ticks stop_counter;
if (_doit || _timer != NULL) {
stop_counter = os::elapsed_counter();
stop_counter.stamp();
}
if (_timer != NULL) {
@ -68,11 +69,12 @@ GCTraceTime::~GCTraceTime() {
}
if (_doit) {
double seconds = TimeHelper::counter_to_seconds(stop_counter - _start_counter);
const Tickspan duration = stop_counter - _start_counter;
double duration_in_seconds = TicksToTimeHelper::seconds(duration);
if (_print_cr) {
gclog_or_tty->print_cr(", %3.7f secs]", seconds);
gclog_or_tty->print_cr(", %3.7f secs]", duration_in_seconds);
} else {
gclog_or_tty->print(", %3.7f secs]", seconds);
gclog_or_tty->print(", %3.7f secs]", duration_in_seconds);
}
gclog_or_tty->flush();
}

@ -26,6 +26,7 @@
#define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCTRACETIME_HPP
#include "prims/jni_md.h"
#include "utilities/ticks.hpp"
class GCTimer;
@ -34,7 +35,7 @@ class GCTraceTime {
bool _doit;
bool _print_cr;
GCTimer* _timer;
jlong _start_counter;
Ticks _start_counter;
public:
GCTraceTime(const char* title, bool doit, bool print_cr, GCTimer* timer);

@ -28,10 +28,11 @@
#include "memory/heapInspection.hpp"
#include "trace/tracing.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/ticks.hpp"
#if INCLUDE_SERVICES
void ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, jlong timestamp) {
void ObjectCountEventSender::send(const KlassInfoEntry* entry, GCId gc_id, const Ticks& timestamp) {
#if INCLUDE_TRACE
assert(Tracing::is_event_enabled(EventObjectCountAfterGC::eventId),
"Only call this method if the event is enabled");

@ -32,10 +32,11 @@
#if INCLUDE_SERVICES
class KlassInfoEntry;
class Ticks;
class ObjectCountEventSender : public AllStatic {
public:
static void send(const KlassInfoEntry* entry, GCId gc_id, jlong timestamp);
static void send(const KlassInfoEntry* entry, GCId gc_id, const Ticks& timestamp);
static bool should_send_event();
};

@ -915,6 +915,25 @@ void LinkResolver::linktime_resolve_special_method(methodHandle& resolved_method
return;
}
// check if invokespecial's interface method reference is in an indirect superinterface
if (!current_klass.is_null() && resolved_klass->is_interface()) {
Klass *klass_to_check = !InstanceKlass::cast(current_klass())->is_anonymous() ?
current_klass() :
InstanceKlass::cast(current_klass())->host_klass();
if (!InstanceKlass::cast(klass_to_check)->is_same_or_direct_interface(resolved_klass())) {
ResourceMark rm(THREAD);
char buf[200];
jio_snprintf(buf, sizeof(buf),
"Interface method reference: %s, is in an indirect superinterface of %s",
Method::name_and_sig_as_C_string(resolved_klass(),
resolved_method->name(),
resolved_method->signature()),
current_klass->external_name());
THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf);
}
}
// check if not static
if (resolved_method->is_static()) {
ResourceMark rm(THREAD);

@ -562,7 +562,7 @@ void DefNewGeneration::collect(bool full,
GenCollectedHeap* gch = GenCollectedHeap::heap();
_gc_timer->register_gc_start(os::elapsed_counter());
_gc_timer->register_gc_start();
DefNewTracer gc_tracer;
gc_tracer.report_gc_start(gch->gc_cause(), _gc_timer->gc_start());
@ -709,7 +709,7 @@ void DefNewGeneration::collect(bool full,
gch->trace_heap_after_gc(&gc_tracer);
gc_tracer.report_tenuring_threshold(tenuring_threshold());
_gc_timer->register_gc_end(os::elapsed_counter());
_gc_timer->register_gc_end();
gc_tracer.report_gc_end(_gc_timer->gc_end(), _gc_timer->time_partitions());
}

@ -635,16 +635,16 @@ void OneContigSpaceCardGeneration::collect(bool full,
x(ref_processor(), gch->reserved_region());
STWGCTimer* gc_timer = GenMarkSweep::gc_timer();
gc_timer->register_gc_start(os::elapsed_counter());
gc_timer->register_gc_start();
SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
gc_timer->register_gc_end(os::elapsed_counter());
gc_timer->register_gc_end();
gc_tracer->report_gc_end(os::elapsed_counter(), gc_timer->time_partitions());
gc_tracer->report_gc_end(gc_timer->gc_end(), gc_timer->time_partitions());
SpecializationStats::print();
}

@ -120,6 +120,7 @@ oop Universe::_null_ptr_exception_instance = NULL;
oop Universe::_arithmetic_exception_instance = NULL;
oop Universe::_virtual_machine_error_instance = NULL;
oop Universe::_vm_exception = NULL;
Method* Universe::_throw_illegal_access_error = NULL;
Array<int>* Universe::_the_empty_int_array = NULL;
Array<u2>* Universe::_the_empty_short_array = NULL;
Array<Klass*>* Universe::_the_empty_klass_array = NULL;
@ -1096,6 +1097,18 @@ bool universe_post_init() {
Universe::_finalizer_register_cache->init(
SystemDictionary::Finalizer_klass(), m);
InstanceKlass::cast(SystemDictionary::misc_Unsafe_klass())->link_class(CHECK_false);
m = InstanceKlass::cast(SystemDictionary::misc_Unsafe_klass())->find_method(
vmSymbols::throwIllegalAccessError_name(),
vmSymbols::void_method_signature());
if (m != NULL && !m->is_static()) {
// Note null is okay; this method is used in itables, and if it is null,
// then AbstractMethodError is thrown instead.
tty->print_cr("Unable to link/verify Unsafe.throwIllegalAccessError method");
return false; // initialization failed (cannot throw exception yet)
}
Universe::_throw_illegal_access_error = m;
// Setup method for registering loaded classes in class loader vector
InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->link_class(CHECK_false);
m = InstanceKlass::cast(SystemDictionary::ClassLoader_klass())->find_method(vmSymbols::addClass_name(), vmSymbols::class_void_signature());

@ -149,6 +149,8 @@ class Universe: AllStatic {
static LatestMethodCache* _loader_addClass_cache; // method for registering loaded classes in class loader vector
static LatestMethodCache* _pd_implies_cache; // method for checking protection domain attributes
static Method* _throw_illegal_access_error;
// preallocated error objects (no backtrace)
static oop _out_of_memory_error_java_heap;
static oop _out_of_memory_error_metaspace;
@ -305,6 +307,7 @@ class Universe: AllStatic {
static oop arithmetic_exception_instance() { return _arithmetic_exception_instance; }
static oop virtual_machine_error_instance() { return _virtual_machine_error_instance; }
static oop vm_exception() { return _vm_exception; }
static Method* throw_illegal_access_error() { return _throw_illegal_access_error; }
static Array<int>* the_empty_int_array() { return _the_empty_int_array; }
static Array<u2>* the_empty_short_array() { return _the_empty_short_array; }

@ -1051,6 +1051,18 @@ bool InstanceKlass::implements_interface(Klass* k) const {
return false;
}
bool InstanceKlass::is_same_or_direct_interface(Klass *k) const {
// Verify direct super interface
if (this == k) return true;
assert(k->is_interface(), "should be an interface class");
for (int i = 0; i < local_interfaces()->length(); i++) {
if (local_interfaces()->at(i) == k) {
return true;
}
}
return false;
}
objArrayOop InstanceKlass::allocate_objArray(int n, int length, TRAPS) {
if (length < 0) THROW_0(vmSymbols::java_lang_NegativeArraySizeException());
if (length > arrayOopDesc::max_array_length(T_OBJECT)) {

@ -777,6 +777,7 @@ class InstanceKlass: public Klass {
// subclass/subinterface checks
bool implements_interface(Klass* k) const;
bool is_same_or_direct_interface(Klass* k) const;
// Access to the implementor of an interface.
Klass* implementor() const

@ -1076,7 +1076,12 @@ void klassItable::initialize_itable_for_interface(int method_table_offset, Klass
LinkResolver::lookup_instance_method_in_klasses(target, _klass, m->name(), m->signature(), CHECK);
}
if (target == NULL || !target->is_public() || target->is_abstract()) {
// Entry do not resolve. Leave it empty
// Entry does not resolve. Leave it empty for AbstractMethodError.
if (!(target == NULL) && !target->is_public()) {
// Stuff an IllegalAccessError throwing method in there instead.
itableOffsetEntry::method_entry(_klass(), method_table_offset)[m->itable_index()].
initialize(Universe::throw_illegal_access_error());
}
} else {
// Entry did resolve, check loader constraints before initializing
// if checkconstraints requested

@ -42,6 +42,7 @@
#include "runtime/deoptimization.hpp"
#include "runtime/vmThread.hpp"
#include "trace/tracing.hpp"
#include "utilities/ticks.hpp"
class Block;
class Bundle;
@ -597,20 +598,19 @@ class Compile : public Phase {
bool has_method_handle_invokes() const { return _has_method_handle_invokes; }
void set_has_method_handle_invokes(bool z) { _has_method_handle_invokes = z; }
jlong _latest_stage_start_counter;
Ticks _latest_stage_start_counter;
void begin_method() {
#ifndef PRODUCT
if (_printer) _printer->begin_method(this);
#endif
C->_latest_stage_start_counter = os::elapsed_counter();
C->_latest_stage_start_counter.stamp();
}
void print_method(CompilerPhaseType cpt, int level = 1) {
EventCompilerPhase event(UNTIMED);
EventCompilerPhase event;
if (event.should_commit()) {
event.set_starttime(C->_latest_stage_start_counter);
event.set_endtime(os::elapsed_counter());
event.set_phase((u1) cpt);
event.set_compileID(C->_compile_id);
event.set_phaseLevel(level);
@ -621,14 +621,13 @@ class Compile : public Phase {
#ifndef PRODUCT
if (_printer) _printer->print_method(this, CompilerPhaseTypeHelper::to_string(cpt), level);
#endif
C->_latest_stage_start_counter = os::elapsed_counter();
C->_latest_stage_start_counter.stamp();
}
void end_method(int level = 1) {
EventCompilerPhase event(UNTIMED);
EventCompilerPhase event;
if (event.should_commit()) {
event.set_starttime(C->_latest_stage_start_counter);
event.set_endtime(os::elapsed_counter());
event.set_phase((u1) PHASE_END);
event.set_compileID(C->_compile_id);
event.set_phaseLevel(level);

@ -38,6 +38,7 @@
#include "runtime/vm_operations.hpp"
#include "trace/tracing.hpp"
#include "utilities/events.hpp"
#include "utilities/ticks.inline.hpp"
#include "utilities/xmlstream.hpp"
#ifdef ASSERT
@ -144,10 +145,10 @@ volatile int NMethodSweeper::_bytes_changed = 0; // Counts the tot
// 3) zombie -> marked_for_reclamation
int NMethodSweeper::_total_nof_methods_reclaimed = 0; // Accumulated nof methods flushed
jlong NMethodSweeper::_total_time_sweeping = 0; // Accumulated time sweeping
jlong NMethodSweeper::_total_time_this_sweep = 0; // Total time this sweep
jlong NMethodSweeper::_peak_sweep_time = 0; // Peak time for a full sweep
jlong NMethodSweeper::_peak_sweep_fraction_time = 0; // Peak time sweeping one fraction
Tickspan NMethodSweeper::_total_time_sweeping; // Accumulated time sweeping
Tickspan NMethodSweeper::_total_time_this_sweep; // Total time this sweep
Tickspan NMethodSweeper::_peak_sweep_time; // Peak time for a full sweep
Tickspan NMethodSweeper::_peak_sweep_fraction_time; // Peak time sweeping one fraction
int NMethodSweeper::_hotness_counter_reset_val = 0;
@ -209,7 +210,7 @@ void NMethodSweeper::mark_active_nmethods() {
_sweep_fractions_left = NmethodSweepFraction;
_current = CodeCache::first_nmethod();
_traversals += 1;
_total_time_this_sweep = 0;
_total_time_this_sweep = Tickspan();
if (PrintMethodFlushing) {
tty->print_cr("### Sweep: stack traversal %d", _traversals);
@ -303,7 +304,7 @@ void NMethodSweeper::possibly_sweep() {
}
void NMethodSweeper::sweep_code_cache() {
jlong sweep_start_counter = os::elapsed_counter();
Ticks sweep_start_counter = Ticks::now();
_flushed_count = 0;
_zombified_count = 0;
@ -367,8 +368,8 @@ void NMethodSweeper::sweep_code_cache() {
assert(_sweep_fractions_left > 1 || _current == NULL, "must have scanned the whole cache");
jlong sweep_end_counter = os::elapsed_counter();
jlong sweep_time = sweep_end_counter - sweep_start_counter;
const Ticks sweep_end_counter = Ticks::now();
const Tickspan sweep_time = sweep_end_counter - sweep_start_counter;
_total_time_sweeping += sweep_time;
_total_time_this_sweep += sweep_time;
_peak_sweep_fraction_time = MAX2(sweep_time, _peak_sweep_fraction_time);
@ -389,7 +390,8 @@ void NMethodSweeper::sweep_code_cache() {
#ifdef ASSERT
if(PrintMethodFlushing) {
tty->print_cr("### sweeper: sweep time(%d): " INT64_FORMAT, _sweep_fractions_left, (jlong)sweep_time);
tty->print_cr("### sweeper: sweep time(%d): "
INT64_FORMAT, _sweep_fractions_left, (jlong)sweep_time.value());
}
#endif

@ -25,6 +25,7 @@
#ifndef SHARE_VM_RUNTIME_SWEEPER_HPP
#define SHARE_VM_RUNTIME_SWEEPER_HPP
#include "utilities/ticks.hpp"
// An NmethodSweeper is an incremental cleaner for:
// - cleanup inline caches
// - reclamation of nmethods
@ -71,10 +72,10 @@ class NMethodSweeper : public AllStatic {
// 3) zombie -> marked_for_reclamation
// Stat counters
static int _total_nof_methods_reclaimed; // Accumulated nof methods flushed
static jlong _total_time_sweeping; // Accumulated time sweeping
static jlong _total_time_this_sweep; // Total time this sweep
static jlong _peak_sweep_time; // Peak time for a full sweep
static jlong _peak_sweep_fraction_time; // Peak time sweeping one fraction
static Tickspan _total_time_sweeping; // Accumulated time sweeping
static Tickspan _total_time_this_sweep; // Total time this sweep
static Tickspan _peak_sweep_time; // Peak time for a full sweep
static Tickspan _peak_sweep_fraction_time; // Peak time sweeping one fraction
static int process_nmethod(nmethod *nm);
static void release_nmethod(nmethod* nm);
@ -87,9 +88,9 @@ class NMethodSweeper : public AllStatic {
public:
static long traversal_count() { return _traversals; }
static int total_nof_methods_reclaimed() { return _total_nof_methods_reclaimed; }
static jlong total_time_sweeping() { return _total_time_sweeping; }
static jlong peak_sweep_time() { return _peak_sweep_time; }
static jlong peak_sweep_fraction_time() { return _peak_sweep_fraction_time; }
static const Tickspan total_time_sweeping() { return _total_time_sweeping; }
static const Tickspan peak_sweep_time() { return _peak_sweep_time; }
static const Tickspan peak_sweep_fraction_time() { return _peak_sweep_fraction_time; }
static void log_sweep(const char* msg, const char* format = NULL, ...);

@ -25,9 +25,7 @@
#define SHARE_VM_TRACE_NOTRACEBACKEND_HPP
#include "prims/jni.h"
typedef jlong TracingTime;
typedef jlong RelativeTracingTime;
#include "trace/traceTime.hpp"
class NoTraceBackend {
public:
@ -44,5 +42,3 @@ public:
typedef NoTraceBackend Tracing;
#endif

@ -176,8 +176,8 @@ Declares a structure type that can be used in other events.
<value type="UINT" field="gcId" label="GC ID" relation="GC_ID" />
<value type="GCNAME" field="name" label="Name" description="The name of the Garbage Collector" />
<value type="GCCAUSE" field="cause" label="Cause" description="The reason for triggering this Garbage Collection" />
<value type="RELATIVE_TICKS" field="sumOfPauses" label="Sum of Pauses" description="Sum of all the times in which Java execution was paused during the garbage collection" />
<value type="RELATIVE_TICKS" field="longestPause" label="Longest Pause" description="Longest individual pause during the garbage collection" />
<value type="TICKSPAN" field="sumOfPauses" label="Sum of Pauses" description="Sum of all the times in which Java execution was paused during the garbage collection" />
<value type="TICKSPAN" field="longestPause" label="Longest Pause" description="Longest individual pause during the garbage collection" />
</event>
<event id="GCParallelOld" path="vm/gc/collector/parold_garbage_collection" label="Parallel Old Garbage Collection"

@ -47,10 +47,6 @@ public:
return os::elapsed_counter();
}
static TracingTime time_adjustment(jlong time) {
return time;
}
static void on_unloading_classes(void) {
}
};

@ -25,26 +25,23 @@
#ifndef SHARE_VM_TRACE_TRACEEVENT_HPP
#define SHARE_VM_TRACE_TRACEEVENT_HPP
#include "utilities/macros.hpp"
enum EventStartTime {
UNTIMED,
TIMED
};
#include "utilities/macros.hpp"
#if INCLUDE_TRACE
#include "trace/traceBackend.hpp"
#include "trace/tracing.hpp"
#include "tracefiles/traceEventIds.hpp"
#include "tracefiles/traceTypes.hpp"
#include "utilities/ticks.hpp"
template<typename T>
class TraceEvent : public StackObj {
protected:
jlong _startTime;
jlong _endTime;
private:
bool _started;
#ifdef ASSERT
@ -54,6 +51,18 @@ class TraceEvent : public StackObj {
bool _ignore_check;
#endif
protected:
jlong _startTime;
jlong _endTime;
void set_starttime(const TracingTime& time) {
_startTime = time;
}
void set_endtime(const TracingTime& time) {
_endTime = time;
}
public:
TraceEvent(EventStartTime timing=TIMED) :
_startTime(0),
@ -100,12 +109,12 @@ class TraceEvent : public StackObj {
set_commited();
}
void set_starttime(jlong time) {
_startTime = time;
void set_starttime(const Ticks& time) {
_startTime = time.value();
}
void set_endtime(jlong time) {
_endTime = time;
void set_endtime(const Ticks& time) {
_endTime = time.value();
}
TraceEventId id() const {

@ -40,6 +40,7 @@
#include "tracefiles/traceTypes.hpp"
#include "trace/traceEvent.hpp"
#include "utilities/macros.hpp"
#include "utilities/ticks.hpp"
#if INCLUDE_TRACE
@ -55,8 +56,8 @@
class TraceEvent {
public:
TraceEvent() {}
void set_starttime(jlong time) const {}
void set_endtime(jlong time) const {}
void set_starttime(const Ticks&amp; time) {}
void set_endtime(const Ticks&amp; time) {}
bool should_commit() const { return false; }
void commit() const {}
};
@ -170,23 +171,23 @@ public:
</xsl:if>
</xsl:template>
<xsl:template match="value[@type='TICKS']" mode="write-setters">
#if INCLUDE_TRACE
<xsl:value-of select="concat('void set_', @field, '(jlong time) { _', @field, ' = time; }')"/>
<xsl:value-of select="concat(' void set_', @field, '(const Ticks&amp; time) { _', @field, ' = time; }')"/>
#else
<xsl:value-of select="concat('void set_', @field, '(jlong ignore) {}')"/>
<xsl:value-of select="concat(' void set_', @field, '(const Ticks&amp; ignore) {}')"/>
#endif
</xsl:template>
<xsl:template match="value[@type='RELATIVE_TICKS']" mode="write-setters">
<xsl:template match="value[@type='TICKSPAN']" mode="write-setters">
#if INCLUDE_TRACE
<xsl:value-of select="concat('void set_', @field, '(jlong time) { _', @field, ' = time; }')"/>
<xsl:value-of select="concat(' void set_', @field, '(const Tickspan&amp; time) { _', @field, ' = time; }')"/>
#else
<xsl:value-of select="concat('void set_', @field, '(jlong ignore) {}')"/>
<xsl:value-of select="concat(' void set_', @field, '(const Tickspan&amp; ignore) {}')"/>
#endif
</xsl:template>
<xsl:template match="value" mode="write-fields">
<xsl:variable name="type" select="@type"/>
<xsl:variable name="wt" select="//primary_type[@symbol=$type]/@type"/>
@ -226,7 +227,17 @@ public:
<xsl:template match="value" mode="write-data">
<xsl:variable name="type" select="@type"/>
<xsl:variable name="wt" select="//primary_type[@symbol=$type]/@writetype"/>
<xsl:value-of select="concat(' ts.print_val(&quot;', @label, '&quot;, _', @field, ');')"/>
<xsl:choose>
<xsl:when test="@type='TICKSPAN'">
<xsl:value-of select="concat(' ts.print_val(&quot;', @label, '&quot;, _', @field, '.value());')"/>
</xsl:when>
<xsl:when test="@type='TICKS'">
<xsl:value-of select="concat(' ts.print_val(&quot;', @label, '&quot;, _', @field, '.value());')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(' ts.print_val(&quot;', @label, '&quot;, _', @field, ');')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="position() != last()">
<xsl:text>
ts.print(", ");

@ -28,6 +28,5 @@
#include "prims/jni.h"
typedef jlong TracingTime;
typedef jlong RelativeTracingTime;
#endif
#endif // SHARE_VM_TRACE_TRACETIME_HPP

@ -32,9 +32,11 @@
#ifndef TRACEFILES_JFRTYPES_HPP
#define TRACEFILES_JFRTYPES_HPP
#include "oops/symbol.hpp"
#include "trace/traceDataTypes.hpp"
#include "utilities/globalDefinitions.hpp"
#include "oops/symbol.hpp"
#include "utilities/ticks.hpp"
enum JVMContentType {
_not_a_content_type = (JVM_CONTENT_TYPES_START - 1),

@ -249,13 +249,13 @@ Now we can use the content + data type in declaring event fields.
<primary_type symbol="NANOS" datatype="LONG" contenttype="NANOS"
type="s8" sizeop="sizeof(s8)"/>
<!-- 64-bit signed integer, SEMANTIC value ABSOLUTE TICKS -->
<!-- 64-bit signed integer, SEMANTIC value TICKS -->
<primary_type symbol="TICKS" datatype="LONG" contenttype="TICKS"
type="s8" sizeop="sizeof(s8)"/>
type="Ticks" sizeop="sizeof(s8)"/>
<!-- 64-bit signed integer, SEMANTIC value RELATIVE TICKS -->
<primary_type symbol="RELATIVE_TICKS" datatype="LONG" contenttype="TICKS"
type="s8" sizeop="sizeof(s8)"/>
<!-- 64-bit signed integer, SEMANTIC value TICKS duration -->
<primary_type symbol="TICKSPAN" datatype="LONG" contenttype="TICKS"
type="Tickspan" sizeop="sizeof(s8)"/>
<!-- 64-bit unsigned integer, SEMANTIC value ADDRESS (mem loc) -->
<primary_type symbol="ADDRESS" datatype="U8" contenttype="ADDRESS"

@ -0,0 +1,68 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*
*/
#include "precompiled.hpp"
#include "runtime/os.hpp"
#include "utilities/ticks.inline.hpp"
#ifdef ASSERT
const jlong Ticks::invalid_time_stamp = -2; // 0xFFFF FFFF`FFFF FFFE
#endif
void Ticks::stamp() {
_stamp_ticks = os::elapsed_counter();
}
const Ticks Ticks::now() {
Ticks t;
t.stamp();
return t;
}
Tickspan::Tickspan(const Ticks& end, const Ticks& start) {
assert(end.value() != Ticks::invalid_time_stamp, "end is unstamped!");
assert(start.value() != Ticks::invalid_time_stamp, "start is unstamped!");
assert(end >= start, "negative time!");
_span_ticks = end.value() - start.value();
}
template <typename ReturnType>
static ReturnType time_conversion(const Tickspan& span, TicksToTimeHelper::Unit unit) {
assert(TicksToTimeHelper::SECONDS == unit ||
TicksToTimeHelper::MILLISECONDS == unit, "invalid unit!");
ReturnType frequency_per_unit = (ReturnType)os::elapsed_frequency() / (ReturnType)unit;
return (ReturnType) ((ReturnType)span.value() / frequency_per_unit);
}
double TicksToTimeHelper::seconds(const Tickspan& span) {
return time_conversion<double>(span, SECONDS);
}
jlong TicksToTimeHelper::milliseconds(const Tickspan& span) {
return time_conversion<jlong>(span, MILLISECONDS);
}

@ -0,0 +1,111 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*
*/
#ifndef SHARE_VM_UTILITIES_TICKS_HPP
#define SHARE_VM_UTILITIES_TICKS_HPP
#include "memory/allocation.hpp"
#include "utilities/globalDefinitions.hpp"
class Ticks;
class Tickspan VALUE_OBJ_CLASS_SPEC {
friend class Ticks;
friend Tickspan operator-(const Ticks& end, const Ticks& start);
private:
jlong _span_ticks;
Tickspan(const Ticks& end, const Ticks& start);
public:
Tickspan() : _span_ticks(0) {}
Tickspan& operator+=(const Tickspan& rhs) {
_span_ticks += rhs._span_ticks;
return *this;
}
jlong value() const {
return _span_ticks;
}
};
class Ticks VALUE_OBJ_CLASS_SPEC {
private:
jlong _stamp_ticks;
public:
Ticks() : _stamp_ticks(0) {
assert((_stamp_ticks = invalid_time_stamp) == invalid_time_stamp,
"initial unstamped time value assignment");
}
Ticks& operator+=(const Tickspan& span) {
_stamp_ticks += span.value();
return *this;
}
Ticks& operator-=(const Tickspan& span) {
_stamp_ticks -= span.value();
return *this;
}
void stamp();
jlong value() const {
return _stamp_ticks;
}
static const Ticks now();
#ifdef ASSERT
static const jlong invalid_time_stamp;
#endif
#ifndef PRODUCT
// only for internal use by GC VM tests
friend class TimePartitionPhasesIteratorTest;
friend class GCTimerTest;
private:
// implicit type conversion
Ticks(int ticks) : _stamp_ticks(ticks) {}
#endif // !PRODUCT
};
class TicksToTimeHelper : public AllStatic {
public:
enum Unit {
SECONDS = 1,
MILLISECONDS = 1000
};
static double seconds(const Tickspan& span);
static jlong milliseconds(const Tickspan& span);
};
#endif // SHARE_VM_UTILITIES_TICKS_HPP

@ -0,0 +1,97 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.
*
*/
#ifndef SHARE_VM_UTILITIES_TICKS_INLINE_HPP
#define SHARE_VM_UTILITIES_TICKS_INLINE_HPP
#include "utilities/ticks.hpp"
inline Tickspan operator+(Tickspan lhs, const Tickspan& rhs) {
lhs += rhs;
return lhs;
}
inline bool operator==(const Tickspan& lhs, const Tickspan& rhs) {
return lhs.value() == rhs.value();
}
inline bool operator!=(const Tickspan& lhs, const Tickspan& rhs) {
return !operator==(lhs,rhs);
}
inline bool operator<(const Tickspan& lhs, const Tickspan& rhs) {
return lhs.value() < rhs.value();
}
inline bool operator>(const Tickspan& lhs, const Tickspan& rhs) {
return operator<(rhs,lhs);
}
inline bool operator<=(const Tickspan& lhs, const Tickspan& rhs) {
return !operator>(lhs,rhs);
}
inline bool operator>=(const Tickspan& lhs, const Tickspan& rhs) {
return !operator<(lhs,rhs);
}
inline Ticks operator+(Ticks lhs, const Tickspan& span) {
lhs += span;
return lhs;
}
inline Ticks operator-(Ticks lhs, const Tickspan& span) {
lhs -= span;
return lhs;
}
inline Tickspan operator-(const Ticks& end, const Ticks& start) {
return Tickspan(end, start);
}
inline bool operator==(const Ticks& lhs, const Ticks& rhs) {
return lhs.value() == rhs.value();
}
inline bool operator!=(const Ticks& lhs, const Ticks& rhs) {
return !operator==(lhs,rhs);
}
inline bool operator<(const Ticks& lhs, const Ticks& rhs) {
return lhs.value() < rhs.value();
}
inline bool operator>(const Ticks& lhs, const Ticks& rhs) {
return operator<(rhs,lhs);
}
inline bool operator<=(const Ticks& lhs, const Ticks& rhs) {
return !operator>(lhs,rhs);
}
inline bool operator>=(const Ticks& lhs, const Ticks& rhs) {
return !operator<(lhs,rhs);
}
#endif // SHARE_VM_UTILITIES_TICKS_INLINE_HPP

@ -1,3 +1,12 @@
import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;
import java.util.jar.JarEntry;
import java.util.jar.JarOutputStream;
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@ -23,12 +32,63 @@
*/
/**
* A minimal classloader for loading bytecodes that could not result from
* properly compiled Java.
* A ByteClassLoader is used to define classes from collections of bytes, as
* well as loading classes in the usual way. It includes options to write the
* classes to files in a jar, or to read the classes from jars in a later or
* debugging run.
*
* If Boolean property byteclassloader.verbose is true, be chatty about jar
* file operations.
*
* @author dr2chase
*/
public class ByteClassLoader extends ClassLoader {
public class ByteClassLoader extends URLClassLoader {
final static boolean verbose
= Boolean.getBoolean("byteclassloader.verbose");
final boolean read;
final JarOutputStream jos;
final String jar_name;
/**
* Make a new ByteClassLoader.
*
* @param jar_name Basename of jar file to be read/written by this classloader.
* @param read If true, read classes from jar file instead of from parameter.
* @param write If true, write classes to jar files for offline study/use.
*
* @throws FileNotFoundException
* @throws IOException
*/
public ByteClassLoader(String jar_name, boolean read, boolean write)
throws FileNotFoundException, IOException {
super(read
? new URL[]{new URL("file:" + jar_name + ".jar")}
: new URL[0]);
this.read = read;
this.jar_name = jar_name;
this.jos = write
? new JarOutputStream(
new BufferedOutputStream(
new FileOutputStream(jar_name + ".jar"))) : null;
if (read && write) {
throw new Error("At most one of read and write may be true.");
}
}
private static void writeJarredFile(JarOutputStream jos, String file, String suffix, byte[] bytes) {
String fileName = file.replace(".", "/") + "." + suffix;
JarEntry ze = new JarEntry(fileName);
try {
ze.setSize(bytes.length);
jos.putNextEntry(ze);
jos.write(bytes);
jos.closeEntry();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
/**
* (pre)load class name using classData for the definition.
*
@ -36,9 +96,36 @@ public class ByteClassLoader extends ClassLoader {
* @param classData
* @return
*/
public Class<?> loadBytes(String name, byte[] classData) {
Class<?> clazz = defineClass(name, classData, 0, classData.length);
resolveClass(clazz);
return clazz;
public Class<?> loadBytes(String name, byte[] classData) throws ClassNotFoundException {
if (jos != null) {
if (verbose) {
System.out.println("ByteClassLoader: writing " + name);
}
writeJarredFile(jos, name, "class", classData);
}
Class<?> clazz = null;
if (read) {
if (verbose) {
System.out.println("ByteClassLoader: reading " + name + " from " + jar_name);
}
clazz = loadClass(name);
} else {
clazz = defineClass(name, classData, 0, classData.length);
resolveClass(clazz);
}
return clazz;
}
public void close() {
if (jos != null) {
try {
if (verbose) {
System.out.println("ByteClassLoader: closing " + jar_name);
}
jos.close();
} catch (IOException ex) {
}
}
}
}

@ -21,50 +21,127 @@
* questions.
*
*/
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import jdk.internal.org.objectweb.asm.ClassWriter;
import jdk.internal.org.objectweb.asm.Handle;
import jdk.internal.org.objectweb.asm.MethodVisitor;
import jdk.internal.org.objectweb.asm.Opcodes;
import p.Dok;
/**
* @test
* @bug 8025260
* @summary Ensure that AbstractMethodError is thrown, not NullPointerException, through MethodHandles::jump_from_method_handle code path
* @test @bug 8025260 8016839
* @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException
*
* @compile -XDignore.symbol.file TestAMEnotNPE.java ByteClassLoader.java p/C.java p/Dok.java p/E.java p/F.java p/I.java p/Tdirect.java p/Treflect.java
*
* @compile -XDignore.symbol.file ByteClassLoader.java I.java C.java TestAMEnotNPE.java
* @run main/othervm TestAMEnotNPE
* @run main/othervm -Xint TestAMEnotNPE
* @run main/othervm -Xcomp TestAMEnotNPE
*/
public class TestAMEnotNPE implements Opcodes {
static boolean writeJarFiles = false;
static boolean readJarFiles = false;
/**
* The bytes for D, a NOT abstract class extending abstract class C
* without supplying an implementation for abstract method m.
* There is a default method in the interface I, but it should lose to
* the abstract class.
* Optional command line parameter (any case-insensitive prefix of)
* "writejarfiles" or "readjarfiles".
*
* "Writejarfiles" creates a jar file for each different set of tested classes.
* "Readjarfiles" causes the classloader to use the copies of the classes
* found in the corresponding jar files.
*
* Jarfilenames look something like pD_ext_pF (p.D extends p.F)
* and qD_m_pp_imp_pI (q.D with package-private m implements p.I)
*
*/
public static void main(String args[]) throws Throwable {
ArrayList<Throwable> lt = new ArrayList<Throwable>();
class D extends C {
D() { super(); }
// does not define m
}
if (args.length > 0) {
String a0 = args[0].toLowerCase();
if (a0.length() > 0) {
writeJarFiles = ("writejarfiles").startsWith(a0);
readJarFiles = ("readjarfiles").startsWith(a0);
}
if (!(writeJarFiles || readJarFiles)) {
throw new Error("Command line parameter (if any) should be prefix of writeJarFiles or readJarFiles");
}
}
try {
System.out.println("TRYING p.D.m PRIVATE interface-invoked as p.I.m, p.D extends p.F, p.F.m FINAL");
tryAndCheckThrown(lt, bytesForDprivateSubWhat("p/F"),
"p.D extends p.F (p.F implements p.I, FINAL public m), private m",
IllegalAccessError.class, "pD_ext_pF");
// We'll take either a VerifyError (pre 2013-11-30)
// or an IllegalAccessError (post 2013-11-22)
} catch (VerifyError ve) {
System.out.println("Saw expected VerifyError " + ve);
}
System.out.println();
System.out.println("TRYING p.D.m PRIVATE interface-invoked as p.I.m, p.D extends p.E");
tryAndCheckThrown(lt, bytesForDprivateSubWhat("p/E"),
"p.D extends p.E (p.E implements p.I, public m), private m",
IllegalAccessError.class, "pD_ext_pE");
System.out.println("TRYING p.D.m ABSTRACT interface-invoked as p.I.m");
tryAndCheckThrown(lt, bytesForD(),
"D extends abstract C, no m",
AbstractMethodError.class, "pD_ext_pC");
System.out.println("TRYING q.D.m PACKAGE interface-invoked as p.I.m");
tryAndCheckThrown(lt, "q.D", bytesForDsomeAccess("q/D", 0),
"q.D implements p.I, protected m", IllegalAccessError.class,
"qD_m_pp_imp_pI");
// Note jar file name is used in the plural-arg case.
System.out.println("TRYING p.D.m PRIVATE interface-invoked as p.I.m");
tryAndCheckThrown(lt, bytesForDsomeAccess("p/D", ACC_PRIVATE),
"p.D implements p.I, private m",
IllegalAccessError.class, "pD_m_pri_imp_pI");
// Plural-arg test.
System.out.println("TRYING p.D.m PRIVATE MANY ARG interface-invoked as p.I.m");
tryAndCheckThrownMany(lt, bytesForDsomeAccess("p/D", ACC_PRIVATE),
"p.D implements p.I, private m", IllegalAccessError.class);
if (lt.size() > 0) {
System.out.flush();
Thread.sleep(250); // This de-interleaves output and error in Netbeans, sigh.
for (Throwable th : lt)
System.err.println(th);
throw new Error("Test failed, there were " + lt.size() + " failures listed above");
} else {
System.out.println("ALL PASS, HOORAY!");
}
}
/**
* The bytes for D, a NOT abstract class extending abstract class C without
* supplying an implementation for abstract method m. There is a default
* method in the interface I, but it should lose to the abstract class.
*
* @return
* @throws Exception
*/
public static byte[] bytesForD() throws Exception {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES
| ClassWriter.COMPUTE_MAXS);
MethodVisitor mv;
cw.visit(V1_8, ACC_PUBLIC + ACC_SUPER, "D", null, "C", null);
cw.visit(V1_8, ACC_PUBLIC + ACC_SUPER, "p/D", null, "p/C", null);
{
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "C", "<init>", "()V");
mv.visitMethodInsn(INVOKESPECIAL, "p/C", "<init>", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
@ -74,70 +151,346 @@ public class TestAMEnotNPE implements Opcodes {
return cw.toByteArray();
}
/**
* The bytecodes for an invokeExact of a particular methodHandle, I.m, invoked on a D
class T {
T() { super(); } // boring constructor
int test() {
MethodHandle mh = `I.m():int`;
D d = new D();
return mh.invokeExact(d); // Should explode here, AbstractMethodError
}
}
* The bytes for D, implements I, does not extend C, declares m()I with
* access method_acc.
*
* @param d_name Name of class defined
* @param method_acc Accessibility of that class's method m.
* @return
* @throws Exception
*/
public static byte[] bytesForT() throws Exception {
public static byte[] bytesForDsomeAccess(String d_name, int method_acc) throws Exception {
return bytesForSomeDsubSomethingSomeAccess(d_name, "java/lang/Object", method_acc);
}
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES|ClassWriter.COMPUTE_MAXS);
/**
* The bytes for D implements I, extends some class, declares m()I as
* private.
*
* Invokeinterface of I.m applied to this D should throw IllegalAccessError
*
* @param sub_what The name of the class that D will extend.
* @return
* @throws Exception
*/
public static byte[] bytesForDprivateSubWhat(String sub_what) throws Exception {
return bytesForSomeDsubSomethingSomeAccess("p/D", sub_what, ACC_PRIVATE);
}
/**
* Returns the bytes for a class with name d_name (presumably "D" in some
* package), extending some class with name sub_what, implementing p.I,
* and defining two methods m() and m(11args) with access method_acc.
*
* @param d_name Name of class that is defined
* @param sub_what Name of class that it extends
* @param method_acc Accessibility of method(s) m in defined class.
* @return
* @throws Exception
*/
public static byte[] bytesForSomeDsubSomethingSomeAccess
(String d_name, String sub_what, int method_acc)
throws Exception {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES
| ClassWriter.COMPUTE_MAXS);
MethodVisitor mv;
String[] interfaces = {"p/I"};
cw.visit(V1_8, ACC_PUBLIC + ACC_SUPER, "T", null, "java/lang/Object", null);
cw.visit(V1_8, ACC_PUBLIC + ACC_SUPER, d_name, null, sub_what, interfaces);
{
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
mv.visitMethodInsn(INVOKESPECIAL, sub_what, "<init>", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(0,0);
mv.visitMaxs(0, 0);
mv.visitEnd();
}
// int m() {return 3;}
{
mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "test", "()I", null, null);
mv = cw.visitMethod(method_acc, "m", "()I", null, null);
mv.visitCode();
mv.visitLdcInsn(new Handle(Opcodes.H_INVOKEINTERFACE, "I", "m", "()I"));
mv.visitTypeInsn(NEW, "D");
mv.visitInsn(DUP);
mv.visitMethodInsn(INVOKESPECIAL, "D", "<init>", "()V");
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invokeExact", "(LI;)I");
mv.visitLdcInsn(new Integer(3));
mv.visitInsn(IRETURN);
mv.visitMaxs(0,0);
mv.visitMaxs(0, 0);
mv.visitEnd();
}
// int m(11args) {return 3;}
{
mv = cw.visitMethod(method_acc, "m", "(BCSIJ"
+ "Ljava/lang/Object;"
+ "Ljava/lang/Object;"
+ "Ljava/lang/Object;"
+ "Ljava/lang/Object;"
+ "Ljava/lang/Object;"
+ "Ljava/lang/Object;"
+ ")I", null, null);
mv.visitCode();
mv.visitLdcInsn(new Integer(3));
mv.visitInsn(IRETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
}
cw.visitEnd();
return cw.toByteArray();
}
public static void main(String args[] ) throws Throwable {
ByteClassLoader bcl = new ByteClassLoader();
Class<?> d = bcl.loadBytes("D", bytesForD());
Class<?> t = bcl.loadBytes("T", bytesForT());
/**
* The bytecodes for a class p/T defining a methods test() and test(11args)
* that contain an invokeExact of a particular methodHandle, I.m.
*
* Test will be passed values that may imperfectly implement I,
* and thus may in turn throw exceptions.
*
* @return
* @throws Exception
*/
public static byte[] bytesForT() throws Exception {
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES
| ClassWriter.COMPUTE_MAXS);
MethodVisitor mv;
cw.visit(V1_8, ACC_PUBLIC + ACC_SUPER, "p/T", null, "java/lang/Object", null);
{
mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
mv.visitCode();
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V");
mv.visitInsn(RETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
}
// static int test(I)
{
mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "test", "(Lp/I;)I", null, null);
mv.visitCode();
mv.visitLdcInsn(new Handle(Opcodes.H_INVOKEINTERFACE, "p/I", "m", "()I"));
mv.visitVarInsn(ALOAD, 0);
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle",
"invokeExact", "(Lp/I;)I");
mv.visitInsn(IRETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
}
// static int test(I,11args)
{
mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "test", "(Lp/I;BCSIJLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)I", null, null);
mv.visitCode();
mv.visitLdcInsn(new Handle(Opcodes.H_INVOKEINTERFACE, "p/I", "m", "(BCSIJLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)I"));
mv.visitVarInsn(ALOAD, 0);
mv.visitVarInsn(ILOAD, 1);
mv.visitVarInsn(ILOAD, 2);
mv.visitVarInsn(ILOAD, 3);
mv.visitVarInsn(ILOAD, 4);
mv.visitVarInsn(LLOAD, 5);
mv.visitVarInsn(ALOAD, 7);
mv.visitVarInsn(ALOAD, 8);
mv.visitVarInsn(ALOAD, 9);
mv.visitVarInsn(ALOAD, 10);
mv.visitVarInsn(ALOAD, 11);
mv.visitVarInsn(ALOAD, 12);
mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle",
"invokeExact", "(Lp/I;BCSIJLjava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)I");
mv.visitInsn(IRETURN);
mv.visitMaxs(0, 0);
mv.visitEnd();
}
cw.visitEnd();
return cw.toByteArray();
}
private static void tryAndCheckThrown(
List<Throwable> lt, byte[] dBytes, String what, Class<?> expected, String jar_name)
throws Throwable {
tryAndCheckThrown(lt, "p.D", dBytes, what, expected, jar_name);
}
private static void tryAndCheckThrown(List<Throwable> lt, String d_name, byte[] dBytes, String what, Class<?> expected, String jar_name)
throws Throwable {
System.out.println("Methodhandle invokeExact I.m() for instance of " + what);
ByteClassLoader bcl1 = new ByteClassLoader(jar_name, readJarFiles, writeJarFiles);
try {
Object result = t.getMethod("test").invoke(null);
System.out.println("Expected AbstractMethodError wrapped in InvocationTargetException, saw no exception");
throw new Error("Missing expected exception");
Class<?> d1 = bcl1.loadBytes(d_name, dBytes);
Class<?> t1 = bcl1.loadBytes("p.T", bytesForT());
invokeTest(t1, d1, expected, lt);
} finally {
// Not necessary for others -- all class files are written in this call.
// (unless the VM crashes first).
bcl1.close();
}
System.out.println("Reflection invoke I.m() for instance of " + what);
ByteClassLoader bcl3 = new ByteClassLoader(jar_name, readJarFiles, false);
Class<?> d3 = bcl3.loadBytes(d_name, dBytes);
Class<?> t3 = bcl3.loadClass("p.Treflect");
invokeTest(t3, d3, expected, lt);
System.out.println("Bytecode invokeInterface I.m() for instance of " + what);
ByteClassLoader bcl2 = new ByteClassLoader(jar_name, readJarFiles, false);
Class<?> d2 = bcl2.loadBytes(d_name, dBytes);
Class<?> t2 = bcl2.loadClass("p.Tdirect");
badGoodBadGood(t2, d2, expected, lt);
}
private static void invokeTest(Class<?> t, Class<?> d, Class<?> expected, List<Throwable> lt)
throws Throwable {
try {
Method m = t.getMethod("test", p.I.class);
Object o = d.newInstance();
Object result = m.invoke(null, o);
if (expected != null) {
System.out.println("FAIL, Expected " + expected.getName()
+ " wrapped in InvocationTargetException, but nothing was thrown");
lt.add(new Error("Exception " + expected.getName() + " was not thrown"));
} else {
System.out.println("PASS, saw expected return.");
}
} catch (InvocationTargetException e) {
Throwable th = e.getCause();
if (th instanceof AbstractMethodError) {
th.printStackTrace(System.out);
System.out.println("PASS, saw expected exception (AbstractMethodError, wrapped in InvocationTargetException).");
th.printStackTrace(System.out);
if (expected != null) {
if (expected.isInstance(th)) {
System.out.println("PASS, saw expected exception (" + expected.getName() + ").");
} else {
System.out.println("FAIL, Expected " + expected.getName()
+ " wrapped in InvocationTargetException, saw " + th);
lt.add(th);
}
} else {
System.out.println("Expected AbstractMethodError wrapped in InvocationTargetException, saw " + th);
throw th;
System.out.println("FAIL, expected no exception, saw " + th);
lt.add(th);
}
}
System.out.println();
}
/* Many-arg versions of above */
private static void tryAndCheckThrownMany(List<Throwable> lt, byte[] dBytes, String what, Class<?> expected)
throws Throwable {
System.out.println("Methodhandle invokeExact I.m(11params) for instance of " + what);
ByteClassLoader bcl1 = new ByteClassLoader("p.D", readJarFiles, false);
try {
Class<?> d1 = bcl1.loadBytes("p.D", dBytes);
Class<?> t1 = bcl1.loadBytes("p.T", bytesForT());
invokeTestMany(t1, d1, expected, lt);
} finally {
bcl1.close(); // Not necessary for others -- all class files are written in this call.
}
{
System.out.println("Bytecode invokeInterface I.m(11params) for instance of " + what);
ByteClassLoader bcl2 = new ByteClassLoader("pD_m_pri_imp_pI", readJarFiles, false);
Class<?> d2 = bcl2.loadBytes("p.D", dBytes);
Class<?> t2 = bcl2.loadClass("p.Tdirect");
badGoodBadGoodMany(t2, d2, expected, lt);
}
{
System.out.println("Reflection invokeInterface I.m(11params) for instance of " + what);
ByteClassLoader bcl2 = new ByteClassLoader("pD_m_pri_imp_pI", readJarFiles, false);
Class<?> d2 = bcl2.loadBytes("p.D", dBytes);
Class<?> t2 = bcl2.loadClass("p.Treflect");
invokeTestMany(t2, d2, expected, lt);
}
}
private static void invokeTestMany(Class<?> t, Class<?> d, Class<?> expected, List<Throwable> lt)
throws Throwable {
try {
Method m = t.getMethod("test", p.I.class,
Byte.TYPE, Character.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE,
Object.class, Object.class, Object.class,
Object.class, Object.class, Object.class);
Object o = d.newInstance();
Byte b = 1;
Character c = 2;
Short s = 3;
Integer i = 4;
Long j = 5L;
Object o1 = b;
Object o2 = c;
Object o3 = s;
Object o4 = i;
Object o5 = j;
Object o6 = "6";
Object result = m.invoke(null, o, b, c, s, i, j,
o1, o2, o3, o4, o5, o6);
if (expected != null) {
System.out.println("FAIL, Expected " + expected.getName()
+ " wrapped in InvocationTargetException, but nothing was thrown");
lt.add(new Error("Exception " + expected.getName()
+ " was not thrown"));
} else {
System.out.println("PASS, saw expected return.");
}
} catch (InvocationTargetException e) {
Throwable th = e.getCause();
th.printStackTrace(System.out);
if (expected != null) {
if (expected.isInstance(th)) {
System.out.println("PASS, saw expected exception ("
+ expected.getName() + ").");
} else {
System.out.println("FAIL, Expected " + expected.getName()
+ " wrapped in InvocationTargetException, saw " + th);
lt.add(th);
}
} else {
System.out.println("FAIL, expected no exception, saw " + th);
lt.add(th);
}
}
System.out.println();
}
/**
* This tests a peculiar idiom for tickling the bug on older VMs that lack
* methodhandles. The bug (if not fixed) acts in the following way:
*
* When a broken receiver is passed to the first execution of an invokeinterface
* bytecode, the illegal access is detected before the effects of resolution are
* cached for later use, and so repeated calls with a broken receiver will always
* throw the correct error.
*
* If, however, a good receiver is passed to the invokeinterface, the effects of
* resolution will be successfully cached. A subsequent execution with a broken
* receiver will reuse the cached information, skip the detailed resolution work,
* and instead encounter a null pointer. By convention, that is the encoding for a
* missing abstract method, and an AbstractMethodError is thrown -- not the expected
* IllegalAccessError.
*
* @param t2 Test invocation class
* @param d2 Test receiver class
* @param expected expected exception type
* @param lt list of unexpected throwables seen
*/
private static void badGoodBadGood(Class<?> t2, Class<?> d2, Class<?> expected, List<Throwable> lt)
throws Throwable {
System.out.println(" Error input 1st time");
invokeTest(t2, d2, expected, lt);
System.out.println(" Good input (instance of Dok)");
invokeTest(t2, Dok.class, null, lt);
System.out.println(" Error input 2nd time");
invokeTest(t2, d2, expected, lt);
System.out.println(" Good input (instance of Dok)");
invokeTest(t2, Dok.class, null, lt);
}
private static void badGoodBadGoodMany(Class<?> t2, Class<?> d2, Class<?> expected, List<Throwable> lt)
throws Throwable {
System.out.println(" Error input 1st time");
invokeTestMany(t2, d2, expected, lt);
System.out.println(" Good input (instance of Dok)");
invokeTestMany(t2, Dok.class, null, lt);
System.out.println(" Error input 2nd time");
invokeTestMany(t2, d2, expected, lt);
System.out.println(" Good input (instance of Dok)");
invokeTestMany(t2, Dok.class, null, lt);
}
}

@ -22,12 +22,14 @@
*
*/
package p;
/**
* Test class -- implements I, which provides default for m, but this class
* declares it abstract which (should) hide the interface default, and throw
* an abstract method error if it is called (calling it requires bytecode hacking
* or inconsistent compilation).
* an abstract method error if called.
*
*/
public abstract class C implements I {
public abstract class C implements p.I {
public abstract int m();
}

@ -0,0 +1,31 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package p;
/**
* Test class -- implements I, extends E, both define m, so all should be well.
*/
public class Dok extends p.E {
}

@ -0,0 +1,38 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package p;
/**
* Test class -- implements I, which provides default for m, but this class
* redeclares it so that all its non-overriding descendants should call its
* method instead (with no error, assuming no descendant monkey business, which
* of course is NOT usually the case in this test).
*
*/
public abstract class E implements p.I {
public int m() {
return 2;
}
}

@ -0,0 +1,41 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package p;
/**
* Test class -- implements I, which provides default for m, but this class
* redeclares it so that all its non-overriding descendants should call its
* method instead (with no error, assuming no descendant monkey business, which
* of course is NOT usually the case in this test).
*
* Note that m is final -- one form of monkey business is attempting to redefine
* m.
*
*/
public abstract class F implements p.I {
final public int m() {
return 2;
}
}

@ -22,6 +22,16 @@
*
*/
package p;
/**
* Test interface I, provides default implementations for m() and m(11args).
*/
public interface I {
default public int m() { return 1; }
default public int m(byte b, char c, short s, int i, long l,
Object o1, Object o2, Object o3, Object o4, Object o5, Object o6) {
return 2;
}
}

@ -0,0 +1,47 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package p;
/**
* Invokes I.m directly using invokeInterface bytecodes.
*/
public class Tdirect {
public static int test(p.I i) {
int accum = 0;
for (int j = 0; j < 100000; j++) {
accum += i.m();
}
return accum;
}
public static int test(p.I ii, byte b, char c, short s, int i, long l,
Object o1, Object o2, Object o3, Object o4, Object o5, Object o6) {
int accum = 0;
for (int j = 0; j < 100000; j++) {
accum += ii.m(b,c,s,i,l,o1,o2,o3,o4,o5,o6);
}
return accum;
}
}

@ -0,0 +1,66 @@
/*
* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
package p;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Invokes I.m using reflection.
*/
public class Treflect {
public static int test(p.I ii) throws Throwable {
int accum = 0;
Method m = p.I.class.getMethod("m");
try {
for (int j = 0; j < 100000; j++) {
Object o = m.invoke(ii);
accum += ((Integer) o).intValue();
}
} catch (InvocationTargetException ite) {
throw ite.getCause();
}
return accum;
}
public static int test(p.I ii, byte b, char c, short s, int i, long l,
Object o1, Object o2, Object o3, Object o4, Object o5, Object o6)
throws Throwable {
Method m = p.I.class.getMethod("m", Byte.TYPE, Character.TYPE,
Short.TYPE, Integer.TYPE, Long.TYPE,
Object.class, Object.class, Object.class,
Object.class, Object.class, Object.class);
int accum = 0;
try {
for (int j = 0; j < 100000; j++) {
Object o = m.invoke(ii, b, c, s, i, l, o1, o2, o3, o4, o5, o6);
accum += ((Integer) o).intValue();
}
} catch (InvocationTargetException ite) {
throw ite.getCause();
}
return accum;
}
}

@ -21,7 +21,8 @@
# questions.
#
# @ignore 8028733
# @test @(#)Test6626217.sh
# @bug 6626217
# @summary Loader-constraint table allows arrays instead of only the base-classes

@ -1,6 +1,7 @@
#!/bin/sh
##
## @ignore 8028740
## @test Test6929067.sh
## @bug 6929067
## @bug 8021296

@ -22,6 +22,7 @@
*/
/*
* @ignore 8026154
* @test
* @bug 8005933
* @summary Test that -Xshare:auto uses CDS when explicitly specified with -server.

@ -21,6 +21,7 @@
# or visit www.oracle.com if you need additional information or have any
# questions.
# @ignore 8029139
# @test testme.sh
# @bug 8009062
# @summary Poor performance of JNI AttachCurrentThread after fix for 7017193

@ -22,6 +22,7 @@
*/
/*
* @ignore 8028095
* @test
* @key regression
* @bug 8020675

@ -22,6 +22,7 @@
*/
/*
* @ignore 8023735
* @test
* @bug 7051189 8023393
* @summary Need to suppress info message if -Xcheck:jni is used with libjsig.so

@ -24,6 +24,7 @@
#
##
## @ignore 8028806
## @test Test8017498.sh
## @bug 8017498
## @bug 8020791

@ -22,6 +22,7 @@
*/
/*
* @ignore 8028398
* @test
* @summary Test that touching noaccess area in class ReservedHeapSpace results in SIGSEGV/ACCESS_VIOLATION
* @library /testlibrary /testlibrary/whitebox

@ -1,383 +0,0 @@
#
# Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
#
# Common variables used by all the Java makefiles. This file should
# not contain rules.
#
# The build times report is turned off by setting REPORT_BUILD_TIMES to nothing.
# This is necessary for the target clobber/clean which will erase the
# directories where the buildtimes are stored.
REPORT_BUILD_TIMES=1
# Store the build times in this directory.
BUILDTIMESDIR=$(ABS_OUTPUTDIR)/tmp/buildtimes
# Record starting time for build of a sub repository.
define RecordStartTime
$(MKDIR) -p $(BUILDTIMESDIR)
$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_start_$1
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_start_$1_human_readable
endef
# Indicate that we started to build a sub repository and record starting time.
define MakeStart
$(call RecordStartTime,$1)
$(PRINTF) "\n\n%s\n%s\n##### %-60.60s #####\n%s\n\n" \
"########################################################################" \
"########################################################################" \
"Entering $1 for target(s) $2" \
"########################################################################"
endef
# Record ending time and calculate the difference and store it in a
# easy to read format. Handles builds that cross midnight. Expects
# that a build will never take 24 hours or more.
define RecordEndTime
$(DATE) '+%Y %m %d %H %M %S' | $(NAWK) '{ print $$1,$$2,$$3,$$4,$$5,$$6,($$4*3600+$$5*60+$$6) }' > $(BUILDTIMESDIR)/build_time_end_$1
$(DATE) '+%Y-%m-%d %H:%M:%S' > $(BUILDTIMESDIR)/build_time_end_$1_human_readable
$(ECHO) `$(CAT) $(BUILDTIMESDIR)/build_time_start_$1` `$(CAT) $(BUILDTIMESDIR)/build_time_end_$1` $1 | \
$(NAWK) '{ F=$$7; T=$$14; if (F > T) { T+=3600*24 }; D=T-F; H=int(D/3600); \
M=int((D-H*3600)/60); S=D-H*3600-M*60; printf("%02d:%02d:%02d %s\n",H,M,S,$$15); }' \
> $(BUILDTIMESDIR)/build_time_diff_$1
endef
# Indicate that we are done.
# Record ending time and print out the total time it took to build.
define MakeFinish
$(if $(REPORT_BUILD_TIMES),$(call RecordEndTime,$1),)
$(PRINTF) "%s\n##### %-60.60s #####\n%s\n##### %-60.60s #####\n%s\n\n" \
"########################################################################" \
"Leaving $1 for target(s) $2" \
"########################################################################" \
$(if $(REPORT_BUILD_TIMES),"Build time `$(CAT) $(BUILDTIMESDIR)/build_time_diff_$1` for target(s) $2","") \
"########################################################################"
endef
# Find all build_time_* files and print their contents in a list sorted
# on the name of the sub repository.
define ReportBuildTimes
$(PRINTF) -- "-- Build times ----------\nTarget %s\nStart %s\nEnd %s\n%s\n%s\n-------------------------\n" \
$1 \
"`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
"`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \
"`$(LS) $(BUILDTIMESDIR)/build_time_diff_* | $(GREP) -v _TOTAL | $(XARGS) $(CAT) | $(SORT) -k 2`" \
"`$(CAT) $(BUILDTIMESDIR)/build_time_diff_TOTAL`"
endef
ifdef OPENJDK
ifneq ($(OPENJDK),true)
x:=$(error "OPENJDK (if defined) can only be set to true")
endif
endif
# Define absolute paths to TOPDIRs
ABS_LANGTOOLS_TOPDIR:=$(call OptFullPath,"$(LANGTOOLS_TOPDIR)")
ABS_CORBA_TOPDIR:=$(call OptFullPath,"$(CORBA_TOPDIR)")
ABS_JAXP_TOPDIR:=$(call OptFullPath,"$(JAXP_TOPDIR)")
ABS_JAXWS_TOPDIR:=$(call OptFullPath,"$(JAXWS_TOPDIR)")
ABS_JDK_TOPDIR:=$(call OptFullPath,"$(JDK_TOPDIR)")
ABS_HOTSPOT_TOPDIR:=$(call OptFullPath,"$(HOTSPOT_TOPDIR)")
ABS_NASHORN_TOPDIR:=$(call OptFullPath,"$(NASHORN_TOPDIR)")
ABS_INSTALL_TOPDIR:=$(call OptFullPath,"$(INSTALL_TOPDIR)")
ABS_SPONSORS_TOPDIR:=$(call OptFullPath,"$(SPONSORS_TOPDIR)")
ABS_DEPLOY_TOPDIR:=$(call OptFullPath,"$(DEPLOY_TOPDIR)")
# Macro to return true or false if a file exists and is readable
define MkExists
$(shell if [ -r $1 ]; then $(ECHO) true; else $(ECHO) false; fi)
endef
HOTSPOT_SRC_AVAILABLE := $(call MkExists,$(HOTSPOT_TOPDIR)/make/Makefile)
ifndef BUILD_HOTSPOT
ifdef ALT_HOTSPOT_IMPORT_PATH
BUILD_HOTSPOT := false
else
BUILD_HOTSPOT := $(HOTSPOT_SRC_AVAILABLE)
endif
endif
LANGTOOLS_SRC_AVAILABLE := $(call MkExists,$(LANGTOOLS_TOPDIR)/make/Makefile)
ifndef BUILD_LANGTOOLS
ifdef ALT_LANGTOOLS_DIST
BUILD_LANGTOOLS := false
else
BUILD_LANGTOOLS := $(LANGTOOLS_SRC_AVAILABLE)
endif
endif
CORBA_SRC_AVAILABLE := $(call MkExists,$(CORBA_TOPDIR)/make/Makefile)
ifndef BUILD_CORBA
ifdef ALT_CORBA_DIST
BUILD_CORBA := false
else
BUILD_CORBA := $(CORBA_SRC_AVAILABLE)
endif
endif
JAXP_SRC_AVAILABLE := $(call MkExists,$(JAXP_TOPDIR)/make/Makefile)
ifndef BUILD_JAXP
ifdef ALT_JAXP_DIST
BUILD_JAXP := false
else
BUILD_JAXP := $(JAXP_SRC_AVAILABLE)
endif
endif
JAXWS_SRC_AVAILABLE := $(call MkExists,$(JAXWS_TOPDIR)/make/Makefile)
ifndef BUILD_JAXWS
ifdef ALT_JAXWS_DIST
BUILD_JAXWS := false
else
BUILD_JAXWS := $(JAXWS_SRC_AVAILABLE)
endif
endif
JDK_SRC_AVAILABLE := $(call MkExists,$(JDK_TOPDIR)/make/Makefile)
ifndef BUILD_JDK
BUILD_JDK := $(JDK_SRC_AVAILABLE)
endif
ifeq ($(JDK_SRC_AVAILABLE),true)
JDK_CLOSED_SRC_AVAILABLE := $(call MkExists,$(JDK_TOPDIR)/src/closed)
ifeq ($(JDK_CLOSED_SRC_AVAILABLE),false)
OPENJDK = true
endif
endif
NASHORN_SRC_AVAILABLE := $(call MkExists,$(NASHORN_TOPDIR)/make/Makefile)
ifndef BUILD_NASHORN
ifdef ALT_NASHORN_DIST
BUILD_NASHORN := false
else
BUILD_NASHORN := $(NASHORN_SRC_AVAILABLE)
endif
endif
DEPLOY_SRC_AVAILABLE := $(call MkExists,$(DEPLOY_TOPDIR)/make/Makefile)
ifndef BUILD_DEPLOY
BUILD_DEPLOY := $(DEPLOY_SRC_AVAILABLE)
endif
INSTALL_SRC_AVAILABLE := $(call MkExists,$(INSTALL_TOPDIR)/make/Makefile)
ifndef BUILD_INSTALL
ifdef DEV_ONLY
BUILD_INSTALL := false
else
BUILD_INSTALL := $(INSTALL_SRC_AVAILABLE)
endif
endif
SPONSORS_SRC_AVAILABLE := $(call MkExists,$(SPONSORS_TOPDIR)/make/Makefile)
ifndef BUILD_SPONSORS
ifdef DEV_ONLY
BUILD_SPONSORS := false
else
BUILD_SPONSORS := $(SPONSORS_SRC_AVAILABLE)
endif
endif
# Do we build the source bundles?
BUNDLE_RULES = $(JDK_TOPDIR)/make/closed/bundles.gmk
ifeq ($(SKIP_BUNDLES_BUILD), true)
BUNDLE_RULES_AVAILABLE := false
else
BUNDLE_RULES_AVAILABLE := $(call MkExists,$(BUNDLE_RULES))
endif
# Current things we do NOT build for OPENJDK
ifdef OPENJDK
BUILD_DEPLOY = false
BUILD_INSTALL = false
BUILD_SPONSORS = false
BUNDLE_RULES_AVAILABLE := false
# These could be over-ridden on the command line or in environment
ifndef SKIP_FASTDEBUG_BUILD
SKIP_FASTDEBUG_BUILD = true
endif
ifndef SKIP_DEBUG_BUILD
SKIP_DEBUG_BUILD = true
endif
ifndef SKIP_COMPARE_IMAGES
SKIP_COMPARE_IMAGES = true
endif
else
# Various non-OPENJDK reasons to NOT build the deploy repository
ifeq ($(ARCH), ia64)
BUILD_DEPLOY=false
endif
ifeq ($(ARCH), sparcv9)
BUILD_DEPLOY=false
endif
ifeq ($(ARCH), amd64)
ifeq ($(PLATFORM), solaris)
BUILD_DEPLOY=false
endif
endif
endif
ifndef SKIP_PRODUCT_BUILD
SKIP_PRODUCT_BUILD = false
endif
# Many reasons why we would want to skip the comparison to previous jdk
ifndef SKIP_COMPARE_IMAGES
ifeq ($(BUILD_JDK), false)
SKIP_COMPARE_IMAGES = true
endif
ifeq ($(BUILD_DEPLOY), false)
SKIP_COMPARE_IMAGES = true
endif
ifeq ($(BUILD_INSTALL), false)
SKIP_COMPARE_IMAGES = true
endif
ifdef DEV_ONLY
SKIP_COMPARE_IMAGES = true
endif
endif
# Select defaults if these are not set to true or false
ifndef SKIP_DEBUG_BUILD
SKIP_DEBUG_BUILD=true
endif
ifndef SKIP_FASTDEBUG_BUILD
SKIP_FASTDEBUG_BUILD=true
endif
# Select javadoc setting GENERATE_DOCS
ifndef NO_DOCS
# Default value (we want javadoc run)
GENERATE_DOCS=true
# No DOCS build when JDK_UPDATE_VERSION set on non-OPENJDK builds
ifndef OPENJDK
ifdef JDK_UPDATE_VERSION
GENERATE_DOCS=false
endif
endif
# If langtools, corba, jaxp, and jaxws are not being built,
# a full jdk javadoc is not possible
ifneq ($(BUILD_LANGTOOLS), true)
GENERATE_DOCS=false
endif
ifneq ($(BUILD_CORBA), true)
GENERATE_DOCS=false
endif
ifneq ($(BUILD_JAXP), true)
GENERATE_DOCS=false
endif
ifneq ($(BUILD_JAXWS), true)
GENERATE_DOCS=false
endif
ifeq ($(GENERATE_DOCS),false)
NO_DOCS=true
endif
else
GENERATE_DOCS=false
endif
# Output directory for hotspot build
HOTSPOT_DIR = $(ABS_OUTPUTDIR)/hotspot
# If we are building components
ifndef ALT_LANGTOOLS_DIST
LANGTOOLS_OUTPUTDIR = $(ABS_OUTPUTDIR)/langtools
ABS_LANGTOOLS_DIST = $(LANGTOOLS_OUTPUTDIR)/dist
endif
ifndef ALT_CORBA_DIST
CORBA_OUTPUTDIR = $(ABS_OUTPUTDIR)/corba
ABS_CORBA_DIST = $(CORBA_OUTPUTDIR)/dist
endif
ifndef ALT_JAXP_DIST
JAXP_OUTPUTDIR = $(ABS_OUTPUTDIR)/jaxp
ABS_JAXP_DIST = $(JAXP_OUTPUTDIR)/dist
endif
ifndef ALT_JAXWS_DIST
JAXWS_OUTPUTDIR = $(ABS_OUTPUTDIR)/jaxws
ABS_JAXWS_DIST = $(JAXWS_OUTPUTDIR)/dist
endif
ifndef ALT_NASHORN_DIST
NASHORN_OUTPUTDIR = $(ABS_OUTPUTDIR)/nashorn
ABS_NASHORN_DIST = $(NASHORN_OUTPUTDIR)/dist
endif
# Common make arguments (supplied to all component builds)
COMMON_BUILD_ARGUMENTS = \
JDK_TOPDIR=$(ABS_JDK_TOPDIR) \
JDK_MAKE_SHARED_DIR=$(ABS_JDK_TOPDIR)/make/common/shared \
EXTERNALSANITYCONTROL=true \
SOURCE_LANGUAGE_VERSION=$(SOURCE_LANGUAGE_VERSION) \
TARGET_CLASS_VERSION=$(TARGET_CLASS_VERSION) \
MILESTONE=$(MILESTONE) \
BUILD_NUMBER=$(BUILD_NUMBER) \
JDK_BUILD_NUMBER=$(JDK_BUILD_NUMBER) \
FULL_VERSION=$(FULL_VERSION) \
PREVIOUS_JDK_VERSION=$(PREVIOUS_JDK_VERSION) \
JDK_VERSION=$(JDK_VERSION) \
JDK_MKTG_VERSION=$(JDK_MKTG_VERSION) \
JDK_MAJOR_VERSION=$(JDK_MAJOR_VERSION) \
JDK_MINOR_VERSION=$(JDK_MINOR_VERSION) \
JDK_MICRO_VERSION=$(JDK_MICRO_VERSION) \
PREVIOUS_MAJOR_VERSION=$(PREVIOUS_MAJOR_VERSION) \
PREVIOUS_MINOR_VERSION=$(PREVIOUS_MINOR_VERSION) \
PREVIOUS_MICRO_VERSION=$(PREVIOUS_MICRO_VERSION)
ifdef OPENJDK
COMMON_BUILD_ARGUMENTS += OPENJDK=$(OPENJDK)
endif
ifdef ARCH_DATA_MODEL
COMMON_BUILD_ARGUMENTS += ARCH_DATA_MODEL=$(ARCH_DATA_MODEL)
endif
ifeq ($(DEBUG_NAME), debug)
COMMON_BUILD_ARGUMENTS += VARIANT=DBG DEBUG_CLASSFILES=true
endif
ifeq ($(DEBUG_NAME), fastdebug)
COMMON_BUILD_ARGUMENTS += VARIANT=DBG FASTDEBUG=true DEBUG_CLASSFILES=true
endif
ifdef COOKED_JDK_UPDATE_VERSION
COMMON_BUILD_ARGUMENTS += COOKED_JDK_UPDATE_VERSION=$(COOKED_JDK_UPDATE_VERSION)
endif
ifdef COOKED_BUILD_NUMBER
COMMON_BUILD_ARGUMENTS += COOKED_BUILD_NUMBER=$(COOKED_BUILD_NUMBER)
endif
ifdef ANT_HOME
COMMON_BUILD_ARGUMENTS += ANT_HOME="$(ANT_HOME)"
endif
# When all repos support FULL_DEBUG_SYMBOLS and ZIP_DEBUGINFO_FILES,
# then these can be set here:
#ifdef FULL_DEBUG_SYMBOLS
# COMMON_BUILD_ARGUMENTS += FULL_DEBUG_SYMBOLS=$(FULL_DEBUG_SYMBOLS)
#endif
#
#ifdef ZIP_DEBUGINFO_FILES
# COMMON_BUILD_ARGUMENTS += ZIP_DEBUGINFO_FILES="$(ZIP_DEBUGINFO_FILES)"
#endif

@ -266,7 +266,7 @@ COMMON_JAVADOCFLAGS = \
-use \
-keywords \
-Xdoclint:none \
-Xprofilespath $(JDK_TOPDIR)/makefiles/profile-rtjar-includes.txt \
-Xprofilespath $(JDK_TOPDIR)/make/profile-rtjar-includes.txt \
$(ADDITIONAL_JAVADOCFLAGS)
ifdef OPENJDK
@ -1158,6 +1158,28 @@ $(DIRECTORY_CACHE): $(ALL_EXISTING_SOURCE_DIRS)
#############################################################
#release version of core packages ########
# The rel-coredocs and rel-docs targets were added by Eric Armstrong. rel-coredocs
# assumes the kind of large, 32-bit machine used in the javapubs group's docs-release
# process. It specifies memory settings accordingly to maximize performance.
#
# The performance settings, like the sanity check, are most important for the core
# docs--the platform APIs. Running javadoc on those APIs takes a significant amount
# of time and memory. Setting the initial heap size as large as possible is important
# to prevent thrashing as the heap grows. Setting the maximum as large as necessary
# is also important to keep the job from failing.
#
# -J-Xmx512 sets a maximum of 512, which became necessary in 6.0
# -J-Xms256 sets starting size to 256 (default is 8)
#
# rel-coredocs also includes a sanity check to help ensure that BUILD_NUMBER and
# MILESTONE are specified properly when docs are built outside of the normal release
# engineering process, with the intention of releasing them on the web or in a downloaded
# docs bundle. (When invoked in release engineering's control build, the values are always
# set properly. But when the targets are run by themselves, they default to b00 and
# "internal"--which silently sabotage the result of a build that can take many hours
# to complete.
# Maximize performance and ensure that build number & milestone are set.
rel-coredocs: sanitycheckcoredocs

@ -69,7 +69,7 @@ ifeq ($(SKIP_BOOT_CYCLE),false)
BRIDGE_TARGETS += bootcycle-images
endif
bridgeBuild: bridge2configure
@cd $(root_dir) && $(MAKE) -f NewMakefile.gmk $(BRIDGE_TARGETS)
@cd $(root_dir) && $(MAKE) -f Makefile $(BRIDGE_TARGETS)
# Bridge from old Makefile ALT settings to configure options
bridge2configure: $(BUILD_DIR_ROOT)/.bridge2configureOpts

@ -29,7 +29,7 @@
include $(SPEC)
# Load the vital tools for all the makefiles.
include $(SRC_ROOT)/common/makefiles/MakeBase.gmk
include $(SRC_ROOT)/make/common/MakeBase.gmk
# Include the corresponding custom file, if present.
-include $(CUSTOM_MAKE_DIR)/Main.gmk
@ -81,51 +81,51 @@ start-make: $(SPEC)
langtools: langtools-only
langtools-only: start-make
@$(call TargetEnter)
@($(CD) $(LANGTOOLS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildLangtools.gmk)
@($(CD) $(LANGTOOLS_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildLangtools.gmk)
@$(call TargetExit)
corba: langtools corba-only
corba-only: start-make
@$(call TargetEnter)
@($(CD) $(CORBA_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildCorba.gmk)
@($(CD) $(CORBA_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildCorba.gmk)
@$(call TargetExit)
jaxp: langtools jaxp-only
jaxp-only: start-make
@$(call TargetEnter)
@($(CD) $(JAXP_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxp.gmk)
@($(CD) $(JAXP_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxp.gmk)
@$(call TargetExit)
jaxws: langtools jaxp jaxws-only
jaxws-only: start-make
@$(call TargetEnter)
@($(CD) $(JAXWS_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxws.gmk)
@($(CD) $(JAXWS_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJaxws.gmk)
@$(call TargetExit)
ifeq ($(BUILD_HOTSPOT),true)
hotspot: hotspot-only
hotspot-only: start-make
@$(call TargetEnter)
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
@($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f HotspotWrapper.gmk)
@$(call TargetExit)
endif
jdk: langtools hotspot corba jaxp jaxws jdk-only
jdk-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET))
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk $(JDK_TARGET))
@$(call TargetExit)
nashorn: jdk nashorn-only
nashorn-only: start-make
@$(call TargetEnter)
@($(CD) $(NASHORN_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk)
@($(CD) $(NASHORN_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildNashorn.gmk)
@$(call TargetExit)
demos: jdk demos-only
demos-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk demos)
@$(call TargetExit)
# Note: This double-colon rule is intentional, to support
@ -133,19 +133,19 @@ demos-only: start-make
images:: source-tips demos nashorn images-only
images-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk images)
@$(call TargetExit)
overlay-images: source-tips demos overlay-images-only
overlay-images-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk overlay-images)
@$(call TargetExit)
profiles: profiles-oscheck source-tips jdk hotspot profiles-only
profiles-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk profiles)
@$(call TargetExit)
profiles-oscheck:
@ -156,25 +156,25 @@ profiles-oscheck:
install: images install-only
install-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk install)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk install)
@$(call TargetExit)
docs: jdk docs-only
docs-only: start-make
@$(call TargetEnter)
@($(CD) $(SRC_ROOT)/common/makefiles/javadoc && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
@($(CD) $(SRC_ROOT)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f Javadoc.gmk docs)
@$(call TargetExit)
sign-jars: jdk sign-jars-only
sign-jars-only: start-make
@$(call TargetEnter)
@($(CD) $(JDK_TOPDIR)/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk sign-jars)
@($(CD) $(JDK_TOPDIR)/make && $(BUILD_LOG_WRAPPER) $(MAKE) $(MAKE_ARGS) -f BuildJdk.gmk sign-jars)
@$(call TargetExit)
bootcycle-images: images bootcycle-images-only
bootcycle-images-only: start-make
@$(ECHO) Boot cycle build step 2: Building a new JDK image using previously built image
@($(CD) $(SRC_ROOT)/common/makefiles && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
@($(CD) $(SRC_ROOT) && $(BUILD_LOG_WRAPPER) $(MAKE) SPEC=$(dir $(SPEC))bootcycle-spec.gmk images)
test: images test-only
test-only: start-make

@ -1,41 +0,0 @@
README-pre-components:
---------------------
Current pre-components are langtools, jaxws, jaxp, and corba.
Pre-components can use ant to build but must have a make/Makefile for
building (a GNU make Makefile).
All ant knowledge is being isolated in the workspaces that use it.
Also for various reasons it is nice to have a Makefile wrapper over the
running of ant, but in general having to do
anything with shell commands is much easier to do in a Makefile
than in an ant script.
The make/makefile rules are:
Variables:
ALT_BOOTDIR The jdk home to use to build, if provided
ALT_LANGTOOLS_DIST The dist area from a langtools build to use, if provided
ALT_OUTPUTDIR Parent dir of build and dist directories, if provided
VARIANT If DBG, debug build, if OPT, optimized build
TARGET_CLASS_VERSION The classfile version number (currently 7)
ANT_HOME Home of ant to use, if provided
QUIET If defined, be quiet
VERBOSE If defined, be verbose
JDK_VERSION Version being built
FULL_VERSION Full version string for this jdk build
MILESTONE fcs, beta, internal or empty
BUILD_NUMBER Number of the jdk build
JPRT_ARCHIVE_BUNDLE Path to zip bundle to create for JPRT
Targets:
all Build everything, including dist
build Build build area
clean Clean up
clobber Same as clean (don't ask)
sanity Perform any sanity checks, exit non-zero if errors
jprt_build_product JPRT product build, zip results into JPRT_ARCHIVE_BUNDLE
jprt_build_debug JPRT debug build, zip results into JPRT_ARCHIVE_BUNDLE
jprt_build_fastdebug JPRT fastdebug build, zip results into JPRT_ARCHIVE_BUNDLE
Then of course we expect a dist/lib/classes.jar, dist/lib/src.zip and dist/lib/bin.zip.

@ -339,7 +339,7 @@ define add_file_to_copy_and_clean
$$($1_BIN)$$($2_TARGET) : $2
$(MKDIR) -p $$(@D)
$(CAT) $$< | $(SED) -e 's/\([^\\]\):/\1\\:/g' -e 's/\([^\\]\)=/\1\\=/g' -e 's/#.*/#/g' \
| $(SED) -f "$(SRC_ROOT)/common/makefiles/support/unicode2x.sed" \
| $(SED) -f "$(SRC_ROOT)/make/common/support/unicode2x.sed" \
| $(SED) -e '/^#/d' -e '/^$$$$/d' \
-e :a -e '/\\$$$$/N; s/\\\n//; ta' \
-e 's/^[ \t]*//;s/[ \t]*$$$$//' \

@ -38,8 +38,8 @@ _MAKEBASE_GMK := 1
# Then you need to use ListPathsSafely, which optimistically splits the output into several shell
# calls as well as use compression on recurrent file paths segments, to get around the potential
# command line length problem that exists in cygwin and other shells.
compress_pre:=$(strip $(shell $(CAT) $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-pre-compress.incl))
compress_post:=$(strip $(shell $(CAT) $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-post-compress.incl))
compress_pre:=$(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-pre-compress.incl))
compress_post:=$(strip $(shell $(CAT) $(SRC_ROOT)/make/common/support/ListPathsSafely-post-compress.incl))
compress_paths=$(compress_pre)\
$(subst $(SRC_ROOT),X97,\
$(subst $(OUTPUT_ROOT),X98,\
@ -47,7 +47,7 @@ $(subst X,X00,\
$(subst $(SPACE),\n,$(strip $1)))))\
$(compress_post)
decompress_paths=$(SED) -f $(SRC_ROOT)/common/makefiles/support/ListPathsSafely-uncompress.sed -e 's|X99|\\n|g' \
decompress_paths=$(SED) -f $(SRC_ROOT)/make/common/support/ListPathsSafely-uncompress.sed -e 's|X99|\\n|g' \
-e 's|X98|$(OUTPUT_ROOT)|g' -e 's|X97|$(SRC_ROOT)|g' \
-e 's|X00|X|g' | tr '\n' '$2'

@ -1,56 +0,0 @@
#
# Copyright (c) 2001, 2011, 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. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
################################################################
# CORBA TARGETS
################################################################
CORBA_BUILD_ARGUMENTS = \
$(COMMON_BUILD_ARGUMENTS) \
ALT_OUTPUTDIR=$(CORBA_OUTPUTDIR) \
ALT_BOOTDIR=$(BOOTDIR) \
ALT_JDK_IMPORT_PATH=$(JDK_IMPORT_PATH)
ifeq ($(BUILD_LANGTOOLS), true)
CORBA_BUILD_ARGUMENTS += ALT_LANGTOOLS_DIST=$(ABS_LANGTOOLS_DIST)
endif
corba: corba-build
corba-build:
$(MKDIR) -p $(CORBA_OUTPUTDIR)
@$(call MakeStart,corba,all)
($(CD) $(CORBA_TOPDIR)/make && \
$(MAKE) $(CORBA_BUILD_ARGUMENTS) all)
@$(call MakeFinish,corba,all)
corba-clobber::
$(MKDIR) -p $(CORBA_OUTPUTDIR)
@$(call MakeStart,corba,clobber)
($(CD) $(CORBA_TOPDIR)/make && \
$(MAKE) $(CORBA_BUILD_ARGUMENTS) clobber)
@$(call MakeFinish,corba,clobber)
.PHONY: corba corba-build corba-clobber

@ -1,110 +0,0 @@
#
# Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. Oracle designates this
# particular file as subject to the "Classpath" exception as provided
# by Oracle in the LICENSE file that accompanied this code.
#
# 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.
#
################################################################
# DEPLOY TARGETS
################################################################
deploy: deploy-build
DEPLOY = deploy
# put the generated bundles in their own place in OUTPUTDIR
DEPLOY_OUTPUTDIR = $(ABS_OUTPUTDIR)
# NO_IMAGES may be set in conjunction with DEV_ONLY
ifdef NO_IMAGES
IMAGES_TARGET =
else
IMAGES_TARGET = images
endif
DEPLOY_BUILD_TARGETS = sanity deploy
ifneq ($(JQS), off)
ifeq ($(ARCH_DATA_MODEL), 32)
ifeq ($(PLATFORM), windows)
DEPLOY_BUILD_TARGETS += jqs-all
endif
endif
endif
ifndef DEV_ONLY
DEPLOY_BUILD_TARGETS += images
else
DEPLOY_BUILD_TARGETS += $(IMAGES_TARGET)
endif
DEPLOY_BUILD_ARGUMENTS = $(COMMON_BUILD_ARGUMENTS) \
ALT_OUTPUTDIR=$(DEPLOY_OUTPUTDIR)
ifeq ($(BUILD_LANGTOOLS), true)
DEPLOY_BUILD_ARGUMENTS += ALT_LANGTOOLS_DIST=$(ABS_LANGTOOLS_DIST)
endif
ifdef ALT_IMAGE_DIR
DEPLOY_BUILD_ARGUMENTS += ALT_IMAGE_DIR=$(ALT_IMAGE_DIR)
endif
ifdef ALT_BUNDLE_DATE
DEPLOY_BUILD_ARGUMENTS += ALT_BUNDLE_DATE=$(ALT_BUNDLE_DATE)
endif
ifdef ALT_JAVAWS_BOOTDIR
DEPLOY_BUILD_ARGUMENTS += ALT_JAVAWS_BOOTDIR=$(ALT_JAVAWS_BOOTDIR)
endif
ifdef CERT
DEPLOY_BUILD_ARGUMENTS += CERT=$(CERT)
endif
ifdef PKEY
DEPLOY_BUILD_ARGUMENTS += PKEY=$(PKEY)
endif
deploy-build:
ifeq ($(BUILD_DEPLOY), true)
@$(call MakeStart,deploy,$(DEPLOY_BUILD_TARGETS))
($(CD) $(DEPLOY_TOPDIR)/make && \
$(MAKE) $(DEPLOY_BUILD_TARGETS) $(DEPLOY_BUILD_ARGUMENTS))
@$(call MakeFinish,deploy,$(DEPLOY_BUILD_TARGETS))
endif
deploy-clobber::
ifeq ($(BUILD_DEPLOY), true)
@$(call MakeStart,deploy,clobber)
($(CD) $(DEPLOY_TOPDIR)/make && \
$(MAKE) clobber $(DEPLOY_BUILD_ARGUMENTS))
@$(call MakeFinish,deploy,clobber)
endif
deploy-sanity::
ifeq ($(BUILD_DEPLOY), true)
($(CD) $(DEPLOY_TOPDIR)/make && \
$(MAKE) sanity $(DEPLOY_BUILD_ARGUMENTS))
endif
.PHONY: deploy deploy-build deploy-clobber deploy-sanity

Some files were not shown because too many files have changed in this diff Show More