This commit is contained in:
Prasanta Sadhukhan 2019-04-03 13:30:05 +05:30
commit 00df041948
163 changed files with 1671 additions and 725 deletions

View File

@ -72,7 +72,7 @@ define SetupBundleFileBody
$(BUNDLES_OUTPUTDIR)/$$($1_BUNDLE_NAME): $$($1_FILES)
$$(call MakeTargetDir)
# If any of the files contain a space in the file name, CacheFind
# If any of the files contain a space in the file name, FindFiles
# will have replaced it with ?. Tar does not accept that so need to
# switch it back.
$$(foreach d, $$($1_BASE_DIRS), \
@ -166,11 +166,12 @@ endif
################################################################################
ifneq ($(filter product-bundles legacy-bundles, $(MAKECMDGOALS)), )
$(eval $(call FillCacheFind, $(IMAGES_OUTPUTDIR)))
SYMBOLS_EXCLUDE_PATTERN := %.debuginfo %.diz %.pdb %.map
ALL_JDK_FILES := $(call CacheFind, $(JDK_IMAGE_DIR))
# There may be files with spaces in the names, so use ShellFindFiles
# explicitly.
ALL_JDK_FILES := $(call ShellFindFiles, $(JDK_IMAGE_DIR))
# Create special filter rules when dealing with unzipped .dSYM directories on
# macosx
@ -201,11 +202,11 @@ ifneq ($(filter product-bundles legacy-bundles, $(MAKECMDGOALS)), )
$(ALL_JDK_FILES) \
) \
) \
$(call CacheFind, $(SYMBOLS_IMAGE_DIR))
$(call FindFiles, $(SYMBOLS_IMAGE_DIR))
TEST_DEMOS_BUNDLE_FILES := $(filter $(JDK_IMAGE_HOMEDIR)/demo/%, $(ALL_JDK_FILES))
ALL_JRE_FILES := $(call CacheFind, $(JRE_IMAGE_DIR))
ALL_JRE_FILES := $(call ShellFindFiles, $(JRE_IMAGE_DIR))
# Create special filter rules when dealing with unzipped .dSYM directories on
# macosx
@ -266,7 +267,7 @@ endif
################################################################################
ifneq ($(filter test-bundles, $(MAKECMDGOALS)), )
TEST_BUNDLE_FILES := $(call CacheFind, $(TEST_IMAGE_DIR))
TEST_BUNDLE_FILES := $(call FindFiles, $(TEST_IMAGE_DIR))
$(eval $(call SetupBundleFile, BUILD_TEST_BUNDLE, \
BUNDLE_NAME := $(TEST_BUNDLE_NAME), \
@ -280,7 +281,7 @@ endif
################################################################################
ifneq ($(filter docs-bundles, $(MAKECMDGOALS)), )
DOCS_BUNDLE_FILES := $(call CacheFind, $(DOCS_IMAGE_DIR))
DOCS_BUNDLE_FILES := $(call FindFiles, $(DOCS_IMAGE_DIR))
$(eval $(call SetupBundleFile, BUILD_DOCS_BUNDLE, \
BUNDLE_NAME := $(DOCS_BUNDLE_NAME), \
@ -295,7 +296,7 @@ endif
################################################################################
ifneq ($(filter jcov-bundles, $(MAKECMDGOALS)), )
JCOV_BUNDLE_FILES := $(call CacheFind, $(JCOV_IMAGE_DIR))
JCOV_BUNDLE_FILES := $(call FindFiles, $(JCOV_IMAGE_DIR))
$(eval $(call SetupBundleFile, BUILD_JCOV_BUNDLE, \
BUNDLE_NAME := $(JCOV_BUNDLE_NAME), \

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -43,7 +43,7 @@ $(eval $(call IncludeCustomExtension, CompileDemos-pre.gmk))
# Prepare the find cache.
DEMO_SRC_DIRS += $(TOPDIR)/src/demo
$(eval $(call FillCacheFind, $(wildcard $(DEMO_SRC_DIRS))))
$(call FillFindCache, $(DEMO_SRC_DIRS))
# Append demo goals to this variable.
TARGETS =
@ -237,11 +237,11 @@ $(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%: $(DEMO_SHARE_SRC)/nbproject/%
ifeq ($(call isTargetOs, solaris), true)
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
$(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
else
TARGETS += $(patsubst $(DEMO_SHARE_SRC)/nbproject/%, \
$(SUPPORT_OUTPUTDIR)/demos/image/nbproject/%, \
$(call CacheFind, $(DEMO_SHARE_SRC)/nbproject))
$(call FindFiles, $(DEMO_SHARE_SRC)/nbproject))
endif
################################################################################
@ -250,7 +250,7 @@ ifneq ($(filter images, $(MAKECMDGOALS)), )
$(eval $(call SetupCopyFiles, COPY_TO_TEST_IMAGE, \
SRC := $(SUPPORT_OUTPUTDIR)/demos/image, \
DEST := $(TEST_IMAGE_DIR)/jdk/demos, \
FILES := $(call CacheFind, $(SUPPORT_OUTPUTDIR)/demos/image), \
FILES := $(call FindFiles, $(SUPPORT_OUTPUTDIR)/demos/image), \
))
IMAGES_TARGETS := $(COPY_TO_TEST_IMAGE)

View File

@ -653,7 +653,7 @@ endif
ifneq ($(wildcard $(IMPORT_MODULE_DIR)), )
$(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
$(call CacheFind, $(IMPORT_MODULE_DIR))
$(call FindFiles, $(IMPORT_MODULE_DIR))
$(call MakeDir, $(@D))
# Do not delete marker and build meta data files
$(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2019, 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
@ -35,7 +35,7 @@ LIBS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_LIBS)))
CMDS_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CMDS)))
CONF_DIR := $(wildcard $(addsuffix /$(MODULE), $(IMPORT_MODULES_CONF)))
$(eval $(call FillCacheFind, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR)))
$(call FillFindCache, $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR))
ifneq ($(LIBS_DIR), )
ifeq ($(call isTargetOs, windows), true)
@ -45,21 +45,21 @@ ifneq ($(LIBS_DIR), )
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/bin, \
FILES := $(filter $(TO_BIN_FILTER), \
$(call CacheFind, $(LIBS_DIR))) \
$(call FindFiles, $(LIBS_DIR))) \
))
$(eval $(call SetupCopyFiles, COPY_LIBS_TO_LIB, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter-out $(TO_BIN_FILTER), \
$(call CacheFind, $(LIBS_DIR))) \
$(call FindFiles, $(LIBS_DIR))) \
))
TARGETS += $(COPY_LIBS_TO_BIN) $(COPY_LIBS_TO_LIB)
else
$(eval $(call SetupCopyFiles, COPY_LIBS, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
FILES := $(filter %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
))
# Use relative links if the import dir is inside the OUTPUTDIR, otherwise
@ -75,7 +75,7 @@ ifneq ($(LIBS_DIR), )
$(eval $(call SetupCopyFiles, LINK_LIBS, \
SRC := $(LIBS_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call CacheFind, $(LIBS_DIR))), \
FILES := $(filter-out %$(SHARED_LIBRARY_SUFFIX), $(call FindFiles, $(LIBS_DIR))), \
MACRO := $(LINK_MACRO), \
LOG_ACTION := $(LOG_ACTION), \
))
@ -87,7 +87,7 @@ ifneq ($(CMDS_DIR), )
$(eval $(call SetupCopyFiles, COPY_CMDS, \
SRC := $(CMDS_DIR), \
DEST := $(JDK_OUTPUTDIR)/bin, \
FILES := $(call CacheFind, $(CMDS_DIR)), \
FILES := $(call FindFiles, $(CMDS_DIR)), \
))
TARGETS += $(COPY_CMDS)
endif
@ -96,7 +96,7 @@ ifneq ($(CONF_DIR), )
$(eval $(call SetupCopyFiles, COPY_CONF, \
SRC := $(CONF_DIR), \
DEST := $(JDK_OUTPUTDIR)/lib, \
FILES := $(call CacheFind, $(CONF_DIR)), \
FILES := $(call FindFiles, $(CONF_DIR)), \
))
TARGETS += $(COPY_CONF)
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2019, 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
@ -39,7 +39,7 @@ MODULES_TO_COPY := $(sort \
COPY_CLASSES_TARGET := $(BUILDJDK_OUTPUTDIR)/jdk/modules/java.base/_the.buildjdk-copy-marker
$(COPY_CLASSES_TARGET): $(call CacheFind, $(wildcard \
$(COPY_CLASSES_TARGET): $(call FindFiles, $(wildcard \
$(addprefix $(JDK_OUTPUTDIR)/modules/, $(MODULES_TO_COPY))))
$(call LogInfo, Copying java modules to buildjdk: $(MODULES_TO_COPY))
$(RM) -r $(BUILDJDK_OUTPUTDIR)/jdk/modules
@ -56,7 +56,7 @@ TARGETS += $(COPY_CLASSES_TARGET)
$(eval $(call SetupCopyFiles, COPY_SUPPORT_HEADERS, \
SRC := $(OUTPUTDIR), \
DEST := $(BUILDJDK_OUTPUTDIR), \
FILES := $(call CacheFind, $(wildcard \
FILES := $(call FindFiles, $(wildcard \
$(addprefix $(SUPPORT_OUTPUTDIR)/headers/, $(MODULES_TO_COPY)))), \
))

View File

@ -53,33 +53,33 @@ INCLUDE_HEADERS_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \
MAN_DIR ?= $(firstword $(wildcard $(addsuffix /$(MODULE), \
$(SUPPORT_OUTPUTDIR)/modules_man $(IMPORT_MODULES_MAN))))
$(eval $(call FillCacheFind, \
$(call FillFindCache, \
$(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \
))
)
ifneq ($(LIBS_DIR), )
JMOD_FLAGS += --libs $(LIBS_DIR)
DEPS += $(call CacheFind, $(LIBS_DIR))
DEPS += $(call FindFiles, $(LIBS_DIR))
endif
ifneq ($(CMDS_DIR), )
JMOD_FLAGS += --cmds $(CMDS_DIR)
DEPS += $(call CacheFind, $(CMDS_DIR))
DEPS += $(call FindFiles, $(CMDS_DIR))
endif
ifneq ($(CONF_DIR), )
JMOD_FLAGS += --config $(CONF_DIR)
DEPS += $(call CacheFind, $(CONF_DIR))
DEPS += $(call FindFiles, $(CONF_DIR))
endif
ifneq ($(CLASSES_DIR), )
JMOD_FLAGS += --class-path $(CLASSES_DIR)
DEPS += $(call CacheFind, $(CLASSES_DIR))
DEPS += $(call FindFiles, $(CLASSES_DIR))
endif
ifneq ($(INCLUDE_HEADERS_DIR), )
JMOD_FLAGS += --header-files $(INCLUDE_HEADERS_DIR)
DEPS += $(call CacheFind, $(INCLUDE_HEADERS_DIR))
DEPS += $(call FindFiles, $(INCLUDE_HEADERS_DIR))
endif
ifneq ($(MAN_DIR), )
JMOD_FLAGS += --man-pages $(MAN_DIR)
DEPS += $(call CacheFind, $(MAN_DIR))
DEPS += $(call FindFiles, $(MAN_DIR))
endif
# If a specific modules_legal dir exists for this module, only pick up files
@ -93,7 +93,7 @@ LEGAL_NOTICES := \
)
LEGAL_NOTICES_PATH := $(call PathList, $(LEGAL_NOTICES))
DEPS += $(call CacheFind, $(LEGAL_NOTICES))
DEPS += $(call FindFiles, $(LEGAL_NOTICES))
JMOD_FLAGS += --legal-notices $(LEGAL_NOTICES_PATH)
@ -147,7 +147,7 @@ endif
# the actual command. Filter that out using wildcard before adding to DEPS.
DEPS += $(wildcard $(JMOD_CMD))
ifeq ($(EXTERNAL_BUILDJDK), false)
DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
DEPS += $(call FindFiles, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
endif
# If creating interim versions of jmods, certain files need to be filtered out

View File

@ -337,7 +337,7 @@ define SetupApiDocsGenerationBody
$$(SUPPORT_OUTPUTDIR)/docs/$1.vardeps)
# Get a list of all files in all the source dirs for all included modules
$1_SOURCE_DEPS := $$(call CacheFind, $$(wildcard $$(foreach module, \
$1_SOURCE_DEPS := $$(call FindFiles, $$(wildcard $$(foreach module, \
$$($1_ALL_MODULES), $$(call FindModuleSrcDirs, $$(module)))))
$$(eval $$(call SetupExecute, javadoc_$1, \
@ -484,7 +484,7 @@ $(eval $(call SetupApiDocsGeneration, REFERENCE_API, \
GLOBAL_SPECS_RESOURCES_DIR := $(TOPDIR)/make/data/docs-resources/
$(eval $(call SetupCopyFiles, COPY_GLOBAL_RESOURCES, \
SRC := $(GLOBAL_SPECS_RESOURCES_DIR), \
FILES := $(call CacheFind, $(GLOBAL_SPECS_RESOURCES_DIR)), \
FILES := $(call FindFiles, $(GLOBAL_SPECS_RESOURCES_DIR)), \
DEST := $(DOCS_OUTPUTDIR), \
))
JDK_INDEX_TARGETS += $(COPY_GLOBAL_RESOURCES)
@ -509,10 +509,10 @@ COPY_SPEC_FILTER := %.html %.gif %.jpg %.mib %.css
$(foreach m, $(ALL_MODULES), \
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
$(foreach d, $(SPECS_$m), \
$(if $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
$(if $(filter $(COPY_SPEC_FILTER), $(call FindFiles, $d)), \
$(eval $(call SetupCopyFiles, COPY_$m, \
SRC := $d, \
FILES := $(filter $(COPY_SPEC_FILTER), $(call CacheFind, $d)), \
FILES := $(filter $(COPY_SPEC_FILTER), $(call FindFiles, $d)), \
DEST := $(DOCS_OUTPUTDIR)/specs/, \
)) \
$(eval JDK_SPECS_TARGETS += $(COPY_$m)) \
@ -529,11 +529,11 @@ ifeq ($(ENABLE_PANDOC), true)
$(foreach m, $(ALL_MODULES), \
$(eval SPECS_$m := $(call FindModuleSpecsDirs, $m)) \
$(foreach d, $(SPECS_$m), \
$(if $(filter %.md, $(call CacheFind, $d)), \
$(if $(filter %.md, $(call FindFiles, $d)), \
$(eval $m_$d_NAME := SPECS_TO_HTML_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
$(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
SRC := $d, \
FILES := $(filter %.md, $(call CacheFind, $d)), \
FILES := $(filter %.md, $(call FindFiles, $d)), \
DEST := $(DOCS_OUTPUTDIR)/specs/, \
CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \
)) \
@ -556,11 +556,11 @@ ifeq ($(ENABLE_PANDOC), true)
$(foreach m, $(ALL_MODULES), \
$(eval MAN_$m := $(call FindModuleManDirs, $m)) \
$(foreach d, $(MAN_$m), \
$(if $(filter %.md, $(call CacheFind, $d)), \
$(if $(filter %.md, $(call FindFiles, $d)), \
$(eval $m_$d_NAME := MAN_TO_HTML_$m_$(strip $(call RelativePath, $d, $(TOPDIR)))) \
$(eval $(call SetupProcessMarkdown, $($m_$d_NAME), \
SRC := $d, \
FILES := $(filter %.md, $(call CacheFind, $d)), \
FILES := $(filter %.md, $(call FindFiles, $d)), \
DEST := $(DOCS_OUTPUTDIR)/specs/man, \
FILTER := $(PANDOC_HTML_MANPAGE_FILTER), \
CSS := $(GLOBAL_SPECS_DEFAULT_CSS_FILE), \

View File

@ -183,21 +183,14 @@ endif
ifeq ($(GCOV_ENABLED), true)
GCOV_FIND_EXPR := -type f -name "*.gcno"
$(eval $(call SetupCopyFiles,COPY_HOTSPOT_GCOV_GCNO, \
$(eval $(call SetupCopyFiles,COPY_GCOV_GCNO, \
SRC := $(OUTPUTDIR), \
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
FILES := $(shell $(FIND) $(HOTSPOT_OUTPUTDIR) $(GCOV_FIND_EXPR))))
FILES := $(call FindFiles, $(HOTSPOT_OUTPUTDIR) \
$(SUPPORT_OUTPUTDIR)/native, *.gcno) \
))
SYMBOLS_TARGETS += $(COPY_HOTSPOT_GCOV_GCNO)
$(eval $(call SetupCopyFiles,COPY_JDK_GCOV_GCNO, \
SRC := $(OUTPUTDIR), \
DEST := $(SYMBOLS_IMAGE_DIR)/gcov, \
FILES := $(shell $(FIND) $(SUPPORT_OUTPUTDIR)/native $(GCOV_FIND_EXPR))))
SYMBOLS_TARGETS += $(COPY_JDK_GCOV_GCNO)
SYMBOLS_TARGETS += $(COPY_GCOV_GCNO)
endif
@ -230,10 +223,10 @@ else
# On Macosx, if debug symbols have not been zipped, find all files inside *.dSYM
# dirs.
ifeq ($(call isTargetOs, macosx), true)
$(eval $(call FillCacheFind, \
$(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs))
$(call FillFindCache, \
$(SUPPORT_OUTPUTDIR)/modules_cmds $(SUPPORT_OUTPUTDIR)/modules_libs)
FindDebuginfoFiles = \
$(if $(wildcard $1), $(call containing, .dSYM/, $(call CacheFind, $1)))
$(if $(wildcard $1), $(call containing, .dSYM/, $(call FindFiles, $1)))
endif
endif

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -264,13 +264,9 @@ ifeq ($(HAS_SPEC),)
endif
endif
# The --no-print-directory is needed to make the call from
# FindTest.gmk to Test.gmk work with LOG=debug/trace. See
# JDK-8213736
$$(main_targets_file):
@( cd $$(topdir) && \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R --no-print-directory \
-f $$(topdir)/make/Main.gmk \
$$(MAKE) $$(MAKE_LOG_FLAGS) -r -R -f $$(topdir)/make/Main.gmk \
-I $$(topdir)/make/common SPEC=$(strip $2) NO_RECIPES=true \
$$(MAKE_LOG_VARS) \
create-main-targets-include )

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -52,13 +52,13 @@ ifeq ($(call isTargetOs, macosx), true)
$(eval $(call SetupCopyFiles, COPY_JDK_IMAGE, \
SRC := $(JDK_IMAGE_DIR), \
DEST := $(JDK_MACOSX_CONTENTS_DIR)/Home, \
FILES := $(call CacheFind, $(JDK_IMAGE_DIR)), \
FILES := $(call FindFiles, $(JDK_IMAGE_DIR)), \
))
$(eval $(call SetupCopyFiles, COPY_JRE_IMAGE, \
SRC := $(JRE_IMAGE_DIR), \
DEST := $(JRE_MACOSX_CONTENTS_DIR)/Home, \
FILES := $(call CacheFind, $(JRE_IMAGE_DIR)), \
FILES := $(call FindFiles, $(JRE_IMAGE_DIR)), \
))
$(JDK_MACOSX_CONTENTS_DIR)/MacOS/libjli.dylib:

View File

@ -338,6 +338,12 @@ default: all
run-test-prebuilt:
@$(RM) -f $(MAKESUPPORT_OUTPUTDIR)/exit-with-error
# The lazy initialization of the cache file in FindTests.gmk does not
# always work with RunTests.gmk. To guarantee that the jtreg test groups
# are always found and parsed, call FindTests.gmk stand alone once
# before calling RunTests.gmk.
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/common/FindTests.gmk \
SPEC=$(SPEC) FINDTESTS_STAND_ALONE=true
@cd $(TOPDIR) && $(MAKE) $(MAKE_ARGS) -f make/RunTests.gmk run-test \
TEST="$(TEST)"

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2019, 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
@ -87,6 +87,7 @@ ifeq ($(SRC_GENERATED), true)
EXCLUDE_FILES := $(SRC_ZIP_EXCLUDE_FILES), \
SUFFIXES := .java, \
ZIP := $(SUPPORT_OUTPUTDIR)/src.zip, \
FOLLOW_SYMLINKS := true, \
))
do-zip: $(BUILD_SRC_ZIP)

View File

@ -26,6 +26,16 @@
ifndef _FIND_TESTS_GMK
_FIND_TESTS_GMK := 1
# This makefile can be called directly to just trigger generation of the cache
# makefile. If so, SPEC and MakeBase.gmk need to be included.
ifeq ($(FINDTESTS_STAND_ALONE), true)
include $(SPEC)
include MakeBase.gmk
endif
# Make sure this variable is not lazy evaled.
ALL_NAMED_TESTS :=
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, common/FindTests.gmk))
@ -35,32 +45,40 @@ TEST_BASEDIRS += $(TOPDIR)/test $(TOPDIR)
# JTREG_TESTROOTS might have been set by a custom extension
JTREG_TESTROOTS += $(addprefix $(TOPDIR)/test/, hotspot/jtreg jdk langtools nashorn jaxp)
################################################################################
# Find the Jtreg test groups for the given component.
#
# Parameter 1 is the jtreg root dir. This name is used as variable prefix.
#
# After this macro has been evaluated, the following variables are defined for
# the component:
# JTREG_TESTROOT - The path to the root of the test directory
# JTREG_GROUP_FILES - The file(s) containing the group definitions
# JTREG_TEST_GROUPS - The name of the test groups that the component defines
#
FindJtregGroups = $(NamedParamsMacroTemplate)
define FindJtregGroupsBody
ifneq ($$(wildcard $1), )
$1_JTREG_GROUP_FILENAMES := $$(shell $$(SED) -n -e 's/\[\(.*\)\]/\1/g' \
-e 's/^groups\w*=//p' $1/TEST.ROOT)
$1_JTREG_GROUP_FILES := $$(addprefix $1/, $$($1_JTREG_GROUP_FILENAMES))
$1_JTREG_TEST_GROUPS := $$(strip $$(shell $$(SED) -n \
-e 's/^\#.*//g' \
-e 's/\([^ ]*\)\w*=.*/\1/gp' $$(wildcard $$($1_JTREG_GROUP_FILES)) \
| $$(SORT) -u))
endif
endef
# Extract the names of the Jtreg group files from the TEST.ROOT files. The
# TEST.ROOT files being properties files can be interpreted as makefiles so
# use include to get at the contents instead of expensive shell calls. We are
# looking for the "groups" property in each file.
JTREG_ROOT_FILES := $(addsuffix /TEST.ROOT, $(JTREG_TESTROOTS))
JTREG_GROUP_FILES :=
$(foreach root, $(JTREG_TESTROOTS), \
$(eval include $(root)/TEST.ROOT) \
$(eval $(root)_JTREG_GROUP_FILES := $$(addprefix $(root)/, $$(groups))) \
$(eval JTREG_GROUP_FILES += $$($(root)_JTREG_GROUP_FILES)) \
)
# Configure definitions for all available test components
$(foreach root, $(JTREG_TESTROOTS), $(eval $(call FindJtregGroups, $(root))))
# Cache the expensive to calculate test names in a generated makefile.
FIND_TESTS_CACHE_FILE := $(MAKESUPPORT_OUTPUTDIR)/find-tests.gmk
# If this file is deemed outdated, it will automatically get regenerated
# by this rule before being included below.
#
# When calling TestMake.gmk, override the log level to avoid any kind of debug
# output being captured into the generated makefile.
$(FIND_TESTS_CACHE_FILE): $(JTREG_ROOT_FILES) $(JTREG_GROUP_FILES)
$(call MakeTargetDir)
( $(foreach root, $(JTREG_TESTROOTS), \
$(PRINTF) "\n$(root)_JTREG_TEST_GROUPS := " ; \
$(SED) -n -e 's/^\#.*//g' -e 's/\([^ ]*\)\w*=.*/\1/gp' \
$($(root)_JTREG_GROUP_FILES) \
| $(SORT) -u | $(TR) '\n' ' ' ; \
) \
$(PRINTF) "\nMAKE_TEST_TARGETS := " ; \
$(MAKE) -s --no-print-directory $(MAKE_ARGS) LOG_LEVEL=warn \
SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets \
) > $@
-include $(FIND_TESTS_CACHE_FILE)
# Create a list of all available Jtreg test groups in all components
JTREG_TEST_GROUPS += $(sort $(foreach root, $(JTREG_TESTROOTS), \
@ -70,18 +88,15 @@ JTREG_TEST_GROUPS += $(sort $(foreach root, $(JTREG_TESTROOTS), \
# ALL_NAMED_TESTS might have been set by a custom extension
ALL_NAMED_TESTS += $(JTREG_TEST_GROUPS)
# Add the make test targets
ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
# Add Gtest
ALL_NAMED_TESTS += gtest
# Add microbenchmarks
ALL_NAMED_TESTS += micro
# Find make test targets
MAKE_TEST_TARGETS := $(shell $(MAKE) -s --no-print-directory $(MAKE_ARGS) \
SPEC=$(SPEC) -f $(TOPDIR)/test/make/TestMake.gmk print-targets)
ALL_NAMED_TESTS += $(addprefix make-, $(MAKE_TEST_TARGETS))
# Add special tests
ALL_NAMED_TESTS += failure-handler make

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -124,9 +124,9 @@ define SetupJarArchiveBody
ifeq ($$($1_DEPENDENCIES), )
# Add all source roots to the find cache since we are likely going to run find
# on these more than once. The cache will only be updated if necessary.
$$(eval $$(call FillCacheFind, $$($1_FIND_LIST)))
$$(call FillFindCache, $$($1_FIND_LIST))
$1_DEPENDENCIES:=$$(filter $$(addprefix %,$$($1_SUFFIXES)), \
$$(call CacheFind,$$($1_SRCS)))
$$(call FindFiles,$$($1_SRCS)))
ifneq (,$$($1_GREP_INCLUDE_PATTERNS))
$1_DEPENDENCIES:=$$(filter $$(addsuffix %,$$($1_GREP_INCLUDE_PATTERNS)),$$($1_DEPENDENCIES))
endif
@ -137,7 +137,7 @@ define SetupJarArchiveBody
$1_DEPENDENCIES+=$$(wildcard $$(foreach src, $$($1_SRCS), \
$$(addprefix $$(src)/, $$($1_EXTRA_FILES))) $$($1_EXTRA_FILES))
ifeq (,$$($1_SKIP_METAINF))
$1_DEPENDENCIES+=$$(call CacheFind,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
$1_DEPENDENCIES+=$$(call FindFiles,$$(wildcard $$(addsuffix /META-INF,$$($1_SRCS))))
endif
endif
# The dependency list should never be empty

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -222,13 +222,12 @@ define SetupJavaCompilationBody
) \
)
$$(call MakeDir,$$($1_BIN))
# Add all source roots to the find cache since we are likely going to run find
# on these more than once. The cache will only be updated if necessary.
$$(eval $$(call FillCacheFind, $$($1_SRC)))
# Find all files in the source trees. Preserve order of source roots so that
# the first version in case of multiple instances of the same file is selected.
# CacheFind does not preserve order so need to call it for each root.
$1_ALL_SRCS += $$($1_EXTRA_FILES) $$(foreach s, $$($1_SRC), $$(call CacheFind, $$s))
# Order src files according to the order of the src dirs. Correct odering is
# needed for correct overriding between different source roots.
$1_ALL_SRC_RAW := $$(call FindFiles, $$($1_SRC))
$1_ALL_SRCS := $$($1_EXTRA_FILES) \
$$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_ALL_SRC_RAW)))
# Extract the java files.
$1_SRCS := $$(filter %.java, $$($1_ALL_SRCS))

View File

@ -64,10 +64,12 @@ define NEWLINE
endef
# In GNU Make 4.0 and higher, there is a file function for writing to files.
# Certain features only work in newer version of GNU Make. The build will still
# function in 3.81, but will be less performant.
ifeq (4.0, $(firstword $(sort 4.0 $(MAKE_VERSION))))
HAS_FILE_FUNCTION := true
CORRECT_FUNCTION_IN_RECIPE_EVALUATION := true
RWILDCARD_WORKS := true
endif
@ -341,74 +343,116 @@ endef
################################################################################
ifneq ($(DISABLE_CACHE_FIND), true)
# In Cygwin, finds are very costly, both because of expensive forks and because
# of bad file system caching. Find is used extensively in $(shell) commands to
# find source files. This makes rerunning make with no or few changes rather
# expensive. To speed this up, these two macros are used to cache the results
# of simple find commands for reuse.
# Recursive wildcard function. Walks down directories recursively and matches
# files with the search patterns. Patterns use standard file wildcards (* and
# ?).
#
# Runs a find and stores both the directories where it was run and the results.
# This macro can be called multiple times to add to the cache. Only finds files
# with no filters.
# $1 - Directories to start search in
# $2 - Search patterns
rwildcard = \
$(strip \
$(foreach d, \
$(patsubst %/,%,$(sort $(dir $(wildcard $(addsuffix /*/*, $(strip $1)))))), \
$(call rwildcard,$d,$2) \
) \
$(call DoubleDollar, $(wildcard $(foreach p, $2, $(addsuffix /$(strip $p), $(strip $1))))) \
)
# Find non directories using recursive wildcard function. This function may
# be used directly when a small amount of directories is expected to be
# searched and caching is not expected to be of use.
#
# $1 - Directory to start search in
# $2 - Optional search patterns, defaults to '*'.
WildcardFindFiles = \
$(sort $(strip \
$(eval WildcardFindFiles_result := $(call rwildcard,$(patsubst %/,%,$1),$(if $(strip $2),$2,*))) \
$(filter-out $(patsubst %/,%,$(sort $(dir $(WildcardFindFiles_result)))), \
$(WildcardFindFiles_result) \
) \
))
# Find non directories using the find utility in the shell. Safe to call for
# non existing directories, or directories containing wildcards.
#
# Files containing space will get spaces replaced with ? because GNU Make
# cannot handle lists of files with space in them. By using ?, make will match
# the wildcard to space in many situations so we don't need to replace back
# to space on every use. While not a complete solution it does allow some uses
# of CacheFind to function with spaces in file names, including for
# SetupCopyFiles.
# of FindFiles to function with spaces in file names, including for
# SetupCopyFiles. Unfortunately this does not work for WildcardFindFiles so
# if files with spaces are anticipated, use ShellFindFiles directly.
#
# Needs to be called with $(eval )
#
# Even if the performance benifit is negligible on other platforms, keep the
# functionality active unless explicitly disabled to exercise it more.
#
# Initialize FIND_CACHE_DIRS with := to make it a non recursively-expanded variable
FIND_CACHE_DIRS :=
# Param 1 - Dirs to find in
# Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
define FillCacheFind
# Filter out already cached dirs. The - is needed when FIND_CACHE_DIRS is empty
# since filter out will then return empty.
FIND_CACHE_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS), $1)
ifneq ($$(FIND_CACHE_NEW_DIRS), )
# Remove any trailing slash from dirs in the cache dir list
FIND_CACHE_DIRS += $$(patsubst %/,%, $$(FIND_CACHE_NEW_DIRS))
FIND_CACHE := $$(sort $$(FIND_CACHE) \
$$(shell $(FIND) $$(wildcard $$(FIND_CACHE_NEW_DIRS)) \
\( -type f -o -type l \) $2 | $(TR) ' ' '?'))
endif
endef
# Mimics find by looking in the cache if all of the directories have been cached.
# Otherwise reverts to shell find. This is safe to call on all platforms, even if
# cache is deactivated.
#
# $1 can be either a directory or a file. If it's a directory, make
# sure we have exactly one trailing slash before the wildcard.
# The extra - is needed when FIND_CACHE_DIRS is empty but should be harmless.
#
# Param 1 - Dirs to find in
# Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
# Param 3 - (optional) options to find.
define CacheFind
$(if $(filter-out $(addsuffix /%,- $(FIND_CACHE_DIRS)) $(FIND_CACHE_DIRS),$1), \
$(if $(wildcard $1), $(shell $(FIND) $3 $(wildcard $1) \( -type f -o -type l \) $2 \
| $(TR) ' ' '?')), \
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(FIND_CACHE)))
endef
else
# If CacheFind is disabled, just run the find command.
# Param 1 - Dirs to find in
# Param 2 - (optional) specialization. Normally "-a \( ... \)" expression.
define CacheFind
$(if $(wildcard $1, \
$(shell $(FIND) $(wildcard $1) \( -type f -o -type l \) $2 | $(TR) ' ' '?') \
# $1 - Directories to start search in.
# $2 - Optional search patterns, empty means find everything. Patterns use
# standard file wildcards (* and ?) and should not be quoted.
# $3 - Optional options to find.
ShellFindFiles = \
$(if $(wildcard $1), \
$(sort \
$(shell $(FIND) $3 $(patsubst %/,%,$(wildcard $1)) \( -type f -o -type l \) \
$(if $(strip $2), -a \( -name "$(firstword $2)" \
$(foreach p, $(filter-out $(firstword $2), $2), -o -name "$(p)") \)) \
| $(TR) ' ' '?' \
) \
) \
)
endef
# Find non directories using the method most likely to work best for the
# current build host
#
# $1 - Directory to start search in
# $2 - Optional search patterns, defaults to '*'.
ifeq ($(OPENJDK_BUILD_OS)-$(RWILDCARD_WORKS), windows-true)
DirectFindFiles = $(WildcardFindFiles)
else
DirectFindFiles = $(ShellFindFiles)
endif
# Finds files using a cache that is populated by FillFindCache below. If any of
# the directories given have not been cached, DirectFindFiles is used for
# everything. Caching is especially useful in Cygwin, where file finds are very
# costly.
#
# $1 - Directories to start search in.
# $2 - Optional search patterns. If used, no caching is done.
CacheFindFiles_CACHED_DIRS :=
CacheFindFiles_CACHED_FILES :=
CacheFindFiles = \
$(if $2, \
$(call DirectFindFiles, $1, $2) \
, \
$(if $(filter-out $(addsuffix /%, $(CacheFindFiles_CACHED_DIRS)) \
$(CacheFindFiles_CACHED_DIRS), $1), \
$(call DirectFindFiles, $1) \
, \
$(filter $(addsuffix /%,$(patsubst %/,%,$1)) $1,$(CacheFindFiles_CACHED_FILES)) \
) \
)
# Explicitly adds files to the find cache used by CacheFindFiles.
#
# $1 - Directories to start search in
FillFindCache = \
$(eval CacheFindFiles_NEW_DIRS := $$(filter-out $$(addsuffix /%,\
$$(CacheFindFiles_CACHED_DIRS)) $$(CacheFindFiles_CACHED_DIRS), $1)) \
$(if $(CacheFindFiles_NEW_DIRS), \
$(eval CacheFindFiles_CACHED_DIRS += $$(patsubst %/,%,$$(CacheFindFiles_NEW_DIRS))) \
$(eval CacheFindFiles_CACHED_FILES := $$(sort $$(CacheFindFiles_CACHED_FILES) \
$$(call DirectFindFiles, $$(CacheFindFiles_NEW_DIRS)))) \
)
# Findfiles is the default macro that should be used to find files in the file
# system. This function does not always support files with spaces in the names.
# If files with spaces are anticipated, use ShellFindFiles directly.
#
# $1 - Directories to start search in.
# $2 - Optional search patterns, empty means find everything. Patterns use
# standard file wildcards (* and ?) and should not be quoted.
ifeq ($(DISABLE_CACHE_FIND), true)
FindFiles = $(DirectFindFiles)
else
FindFiles = $(CacheFindFiles)
endif
################################################################################

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -505,7 +505,7 @@ define SetupNativeCompilationBody
$$(foreach d, $$($1_SRC), $$(if $$(wildcard $$d), , \
$$(error SRC specified to SetupNativeCompilation $1 contains missing directory $$d)))
$1_SRCS_RAW = $$(call CacheFind, $$($1_SRC))
$1_SRCS_RAW := $$(call FindFiles, $$($1_SRC))
# Order src files according to the order of the src dirs
$1_SRCS := $$(foreach d, $$($1_SRC), $$(filter $$d%, $$($1_SRCS_RAW)))
$1_SRCS := $$(filter $$(NATIVE_SOURCE_EXTENSIONS), $$($1_SRCS))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2015, 2019, 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
@ -77,8 +77,7 @@ define SetupTestFilesCompilationBody
# Locate all files with the matching prefix
$1_FILE_LIST := \
$$(shell $$(FIND) $$($1_SOURCE_DIRS) -type f \( -name "$$($1_PREFIX)*.c" \
-o -name "$$($1_PREFIX)*.cpp" \))
$$(call FindFiles, $$($1_SOURCE_DIRS), $$($1_PREFIX)*.c $$($1_PREFIX)*.cpp)
$1_EXCLUDE_PATTERN := $$(addprefix %/, $$($1_EXCLUDE))
$1_FILTERED_FILE_LIST := $$(filter-out $$($1_EXCLUDE_PATTERN), $$($1_FILE_LIST))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2019, 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
@ -103,7 +103,7 @@ define SetupTextFileProcessingBody
$$(error SOURCE_DIRS contains directory $$(src) outside \
SOURCE_BASE_DIR $$($1_SOURCE_BASE_DIR) (in $1))))
endif
$1_SOURCE_FILES := $$(sort $$(call CacheFind,$$($1_SOURCE_DIRS)))
$1_SOURCE_FILES := $$(sort $$(call FindFiles,$$($1_SOURCE_DIRS)))
$1_EXCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_EXCLUDE_FILES)))
$1_INCLUDE_FILES:=$$(foreach i,$$($1_SOURCE_DIRS),$$(addprefix $$i/,$$($1_INCLUDE_FILES)))
$1_SOURCE_FILES := $$(filter-out $$($1_EXCLUDE_FILES),$$($1_SOURCE_FILES))

View File

@ -70,8 +70,8 @@ _sequence-do = \
################################################################################
# Replace question marks with space in string. This macro needs to be called on
# files from CacheFind in case any of them contains space in their file name,
# since CacheFind replaces space with ?.
# files from FindFiles in case any of them contains space in their file name,
# since FindFiles replaces space with ?.
# Param 1 - String to replace in
DecodeSpace = \
$(subst ?,$(SPACE),$(strip $1))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -48,6 +48,8 @@ endif
# src dir
# SUFFIXES
# EXTRA_DEPS
# FOLLOW_SYMLINKS - Set to explicitly follow symlinks. Affects performance of
# finding files.
# ZIP_OPTIONS extra options to pass to zip
SetupZipArchive = $(NamedParamsMacroTemplate)
define SetupZipArchiveBody
@ -62,9 +64,14 @@ define SetupZipArchiveBody
$1_FIND_LIST := $$($1_SRC)
endif
# Find all files in the source tree. Follow symlinks in this find since that is
# what zip does.
$1_ALL_SRCS := $$(call not-containing,_the.,$$(call CacheFind,$$($1_FIND_LIST), , -L))
# Find all files in the source tree.
# If asked to, follow symlinks in this find since that is what zip does. To do
# this, we need to call ShellFindFiles directly.
ifeq ($$($1_FOLLOW_SYMLINKS), true)
$1_ALL_SRCS := $$(call not-containing,_the.,$$(call ShellFindFiles,$$($1_FIND_LIST), , -L))
else
$1_ALL_SRCS := $$(call not-containing,_the.,$$(call FindFiles,$$($1_FIND_LIST)))
endif
# Filter on suffixes if set
ifneq ($$($1_SUFFIXES),)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -40,7 +40,7 @@ ifneq ($(wildcard $(INCLUDE_SOURCE_DIR)/*), )
$(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE, \
SRC := $(INCLUDE_SOURCE_DIR), \
DEST := $(INCLUDE_TARGET_DIR), \
FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_DIR))), \
FILES := $(filter %.h, $(call FindFiles, $(INCLUDE_SOURCE_DIR))), \
))
TARGETS += $(COPY_EXPORTED_INCLUDE)
@ -56,7 +56,7 @@ ifneq ($(wildcard $(INCLUDE_SOURCE_OS_DIR)/*), )
$(eval $(call SetupCopyFiles, COPY_EXPORTED_INCLUDE_OS, \
SRC := $(INCLUDE_SOURCE_OS_DIR), \
DEST := $(INCLUDE_TARGET_DIR)/$(OPENJDK_TARGET_OS_INCLUDE_SUBDIR), \
FILES := $(filter %.h, $(call CacheFind, $(INCLUDE_SOURCE_OS_DIR))), \
FILES := $(filter %.h, $(call FindFiles, $(INCLUDE_SOURCE_OS_DIR))), \
))
TARGETS += $(COPY_EXPORTED_INCLUDE_OS)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2019, 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
@ -65,7 +65,7 @@ PROC_SRC_SUBDIRS := \
PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))
PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
PROC_SRCS := $(filter %.java, $(call FindFiles, $(PROC_SRC_DIRS)))
ALL_SRC_DIRS := $(SRC_DIR) $(wildcard $(SRC_DIR)/*/src)
SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2019, 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
@ -39,7 +39,7 @@ PROC_SRC_SUBDIRS := \
PROC_SRC_DIRS := $(patsubst %, $(SRC_DIR)/%/src, $(PROC_SRC_SUBDIRS))
PROC_SRCS := $(filter %.java, $(call CacheFind, $(PROC_SRC_DIRS)))
PROC_SRCS := $(filter %.java, $(call FindFiles, $(PROC_SRC_DIRS)))
ALL_SRC_DIRS := $(SRC_DIR) $(wildcard $(SRC_DIR)/*/src)
SOURCEPATH := $(call PathList, $(ALL_SRC_DIRS))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2014, 2019, 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
@ -64,7 +64,7 @@ endef
define SetupCompileProperties
# Lookup the properties that need to be compiled into resource bundles.
PROPSOURCES := $2 \
$$(shell $(FIND) $(TOPDIR)/src/$(MODULE)/share/classes -name "*.properties")
$$(call FindFiles, $(TOPDIR)/src/$(MODULE)/share/classes, *.properties)
# Filter out any excluded translations
PROPSOURCES := $$(call FilterExcludedTranslations, $$(PROPSOURCES), .properties)

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -28,16 +28,16 @@
# into LocaleDataMetaInfo.java
# First go look for all locale files
LOCALE_FILES := $(shell $(FIND) \
LOCALE_FILES := $(call FindFiles, \
$(TOPDIR)/src/$(MODULE)/share/classes/sun/text/resources \
$(TOPDIR)/src/$(MODULE)/share/classes/sun/util/resources \
-name "FormatData_*.java" -o -name "FormatData_*.properties" -o \
-name "CollationData_*.java" -o -name "CollationData_*.properties" -o \
-name "TimeZoneNames_*.java" -o -name "TimeZoneNames_*.properties" -o \
-name "LocaleNames_*.java" -o -name "LocaleNames_*.properties" -o \
-name "CurrencyNames_*.java" -o -name "CurrencyNames_*.properties" -o \
-name "CalendarData_*.java" -o -name "CalendarData_*.properties" -o \
-name "BreakIteratorInfo_*.java" -o -name "BreakIteratorRules_*.java")
$(TOPDIR)/src/$(MODULE)/share/classes/sun/util/resources, \
FormatData_*.java FormatData_*.properties \
CollationData_*.java CollationData_*.properties \
TimeZoneNames_*.java TimeZoneNames_*.properties \
LocaleNames_*.java LocaleNames_*.properties \
CurrencyNames_*.java CurrencyNames_*.properties \
CalendarData_*.java CalendarData_*.properties \
BreakIteratorInfo_*.java BreakIteratorRules_*.java)
# Then translate the locale files into for example: FormatData_sv
LOCALE_RESOURCES := $(sort $(subst .properties,,$(subst .java,,$(notdir $(LOCALE_FILES)))))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -68,7 +68,7 @@ define SetupCompilePropertiesBody
endif
# Locate all properties files in the given source dirs.
$1_SRC_FILES := $$(filter %.properties, $$(call CacheFind, $$($1_SRC_DIRS)))
$1_SRC_FILES := $$(call FindFiles, $$($1_SRC_DIRS), *.properties)
ifneq ($$($1_EXCLUDE), )
$1_SRC_FILES := $$(filter-out $$($1_EXCLUDE), $$($1_SRC_FILES))

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2019, 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
@ -167,7 +167,7 @@ JVM_OPTIMIZATION ?= HIGHEST_JVM
JVM_STRIPFLAGS ?= $(STRIPFLAGS)
# This source set is reused so save in cache.
$(eval $(call FillCacheFind, $(JVM_SRC_DIRS)))
$(call FillFindCache, $(JVM_SRC_DIRS))
################################################################################
# Now set up the actual compilation of the main hotspot native library

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 2019, 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
@ -70,7 +70,7 @@ ifeq ($(call isTargetOs, linux), true)
# significantly reduce the GC pause time on 32 bit Linux/Unix platforms by
# compiling without the PIC flag (-fPIC on linux).
# See 6454213 for more details.
ALL_SRC := $(filter %.cpp, $(call CacheFind, $(TOPDIR)/src/hotspot/share))
ALL_SRC := $(call FindFiles, $(TOPDIR)/src/hotspot/share, *.cpp)
NONPIC_FILTER := $(addsuffix %, $(addprefix $(TOPDIR)/src/hotspot/share/, \
memory oops gc))
# Due to what looks like a bug in the old build implementation of this, add a

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -29,7 +29,7 @@ include LibCommon.gmk
$(eval $(call IncludeCustomExtension, lib/Lib-java.base.gmk))
# Prepare the find cache.
$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.base/*/native)))
$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.base/*/native))
################################################################################
# Create all the core libraries

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2011, 2019, 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
@ -29,7 +29,7 @@ include LibCommon.gmk
$(eval $(call IncludeCustomExtension, lib/Lib-java.desktop.gmk))
# Prepare the find cache.
$(eval $(call FillCacheFind, $(wildcard $(TOPDIR)/src/java.desktop/*/native)))
$(call FillFindCache, $(wildcard $(TOPDIR)/src/java.desktop/*/native))
################################################################################
# Create the AWT/2D libraries

View File

@ -46,7 +46,18 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
Register addr, Register count, RegSet saved_regs) {
if (is_oop) {
bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0;
if (!dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
if (ShenandoahSATBBarrier && !dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
Label done;
// Avoid calling runtime if count == 0
__ cbz(count, done);
// Is marking active?
Address gc_state(rthread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
__ ldrb(rscratch1, gc_state);
__ tbz(rscratch1, ShenandoahHeap::MARKING_BITPOS, done);
__ push(saved_regs, sp);
if (count == c_rarg0) {
if (addr == c_rarg1) {
@ -68,6 +79,7 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
__ call_VM_leaf(CAST_FROM_FN_PTR(address, ShenandoahRuntime::write_ref_array_pre_oop_entry), 2);
}
__ pop(saved_regs, sp);
__ bind(done);
}
}
}

View File

@ -66,26 +66,22 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
}
#endif
if (!dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
if (ShenandoahSATBBarrier && !dest_uninitialized && !ShenandoahHeap::heap()->heuristics()->can_do_traversal_gc()) {
Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
#ifndef _LP64
__ push(thread);
__ get_thread(thread);
#endif
Label filtered;
Address in_progress(thread, in_bytes(ShenandoahThreadLocalData::satb_mark_queue_active_offset()));
// Is marking active?
if (in_bytes(SATBMarkQueue::byte_width_of_active()) == 4) {
__ cmpl(in_progress, 0);
} else {
assert(in_bytes(SATBMarkQueue::byte_width_of_active()) == 1, "Assumption");
__ cmpb(in_progress, 0);
}
Label done;
// Short-circuit if count == 0.
__ testptr(count, count);
__ jcc(Assembler::zero, done);
NOT_LP64(__ pop(thread);)
__ jcc(Assembler::equal, filtered);
// Avoid runtime call when not marking.
Address gc_state(thread, in_bytes(ShenandoahThreadLocalData::gc_state_offset()));
__ testb(gc_state, ShenandoahHeap::MARKING);
__ jcc(Assembler::zero, done);
__ pusha(); // push registers
#ifdef _LP64
@ -111,7 +107,8 @@ void ShenandoahBarrierSetAssembler::arraycopy_prologue(MacroAssembler* masm, Dec
dst, count);
#endif
__ popa();
__ bind(filtered);
__ bind(done);
NOT_LP64(__ pop(thread);)
}
}

View File

@ -761,10 +761,6 @@ struct CopyToArchive : StackObj {
return true;
}
unsigned int hash = java_lang_String::hash_code(s);
if (hash == 0) {
// We do not archive Strings with a 0 hashcode because ......
return true;
}
java_lang_String::set_hash(s, hash);
oop new_s = StringTable::create_archived_string(s, Thread::current());

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2019, 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
@ -738,30 +738,6 @@ void CompilerOracle::parse_from_string(const char* str, void (*parse_line)(char*
parse_line(token);
}
void CompilerOracle::append_comment_to_file(const char* message) {
assert(has_command_file(), "command file must be specified");
fileStream stream(fopen(cc_file(), "at"));
stream.print("# ");
for (int index = 0; message[index] != '\0'; index++) {
stream.put(message[index]);
if (message[index] == '\n') stream.print("# ");
}
stream.cr();
}
void CompilerOracle::append_exclude_to_file(const methodHandle& method) {
assert(has_command_file(), "command file must be specified");
fileStream stream(fopen(cc_file(), "at"));
stream.print("exclude ");
method->method_holder()->name()->print_symbol_on(&stream);
stream.print(".");
method->name()->print_symbol_on(&stream);
method->signature()->print_symbol_on(&stream);
stream.cr();
stream.cr();
}
void compilerOracle_init() {
CompilerOracle::parse_from_string(CompileCommand, CompilerOracle::parse_from_line);
CompilerOracle::parse_from_string(CompileOnly, CompilerOracle::parse_compile_only);

View File

@ -83,10 +83,6 @@ class CompilerOracle : AllStatic {
static void parse_from_line(char* line);
static void parse_compile_only(char * line);
// For updating the oracle file
static void append_comment_to_file(const char* message);
static void append_exclude_to_file(const methodHandle& method);
// Tells whether there are any methods to print for print_method_statistics()
static bool should_print_methods();
};

View File

@ -2731,7 +2731,7 @@ class RegisterHumongousWithInCSetFastTestClosure : public HeapRegionClosure {
// The remembered set might contain references to already freed
// regions. Filter out such entries to avoid failing card table
// verification.
if (g1h->is_in_closed_subset(ct->addr_for(card_ptr))) {
if (g1h->is_in(ct->addr_for(card_ptr))) {
if (*card_ptr != G1CardTable::dirty_card_val()) {
*card_ptr = G1CardTable::dirty_card_val();
_dcq.enqueue(card_ptr);
@ -4608,11 +4608,6 @@ void G1CollectedHeap::rebuild_region_sets(bool free_list_only) {
used(), recalculate_used());
}
bool G1CollectedHeap::is_in_closed_subset(const void* p) const {
HeapRegion* hr = heap_region_containing(p);
return hr->is_in(p);
}
// Methods for the mutator alloc region
HeapRegion* G1CollectedHeap::new_mutator_alloc_region(size_t word_size,

View File

@ -1119,8 +1119,6 @@ public:
return _hrm->reserved();
}
virtual bool is_in_closed_subset(const void* p) const;
G1HotCardCache* g1_hot_card_cache() const { return _hot_card_cache; }
G1CardTable* card_table() const {

View File

@ -1766,17 +1766,17 @@ class G1RemarkThreadsClosure : public ThreadClosure {
G1CMSATBBufferClosure _cm_satb_cl;
G1CMOopClosure _cm_cl;
MarkingCodeBlobClosure _code_cl;
int _thread_parity;
uintx _claim_token;
public:
G1RemarkThreadsClosure(G1CollectedHeap* g1h, G1CMTask* task) :
_cm_satb_cl(task, g1h),
_cm_cl(g1h, task),
_code_cl(&_cm_cl, !CodeBlobToOopClosure::FixRelocations),
_thread_parity(Threads::thread_claim_parity()) {}
_claim_token(Threads::thread_claim_token()) {}
void do_thread(Thread* thread) {
if (thread->claim_oops_do(true, _thread_parity)) {
if (thread->claim_threads_do(true, _claim_token)) {
SATBMarkQueue& queue = G1ThreadLocalData::satb_mark_queue(thread);
queue.apply_closure_and_empty(&_cm_satb_cl);
if (thread->is_Java_thread()) {

View File

@ -61,7 +61,7 @@ template <class T> void G1VerifyOopClosure::do_oop_work(T* p) {
_cc++;
oop obj = CompressedOops::decode_not_null(heap_oop);
bool failed = false;
if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _verify_option)) {
if (!_g1h->is_in(obj) || _g1h->is_obj_dead_cond(obj, _verify_option)) {
MutexLockerEx x(ParGCRareEvent_lock,
Mutex::_no_safepoint_check_flag);
LogStreamHandle(Error, gc, verify) yy;
@ -69,7 +69,7 @@ template <class T> void G1VerifyOopClosure::do_oop_work(T* p) {
yy.cr();
yy.print_cr("----------");
}
if (!_g1h->is_in_closed_subset(obj)) {
if (!_g1h->is_in(obj)) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
yy.print_cr("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));

View File

@ -514,7 +514,7 @@ public:
if (!CompressedOops::is_null(heap_oop)) {
oop obj = CompressedOops::decode_not_null(heap_oop);
bool failed = false;
if (!_g1h->is_in_closed_subset(obj) || _g1h->is_obj_dead_cond(obj, _vo)) {
if (!_g1h->is_in(obj) || _g1h->is_obj_dead_cond(obj, _vo)) {
MutexLockerEx x(ParGCRareEvent_lock,
Mutex::_no_safepoint_check_flag);
@ -522,7 +522,7 @@ public:
log.error("----------");
}
ResourceMark rm;
if (!_g1h->is_in_closed_subset(obj)) {
if (!_g1h->is_in(obj)) {
HeapRegion* from = _g1h->heap_region_containing((HeapWord*)p);
log.error("Field " PTR_FORMAT " of live obj " PTR_FORMAT " in region " HR_FORMAT,
p2i(p), p2i(_containing_obj), HR_FORMAT_PARAMS(from));

View File

@ -59,11 +59,6 @@ public:
virtual GrowableArray<GCMemoryManager*> memory_managers();
virtual GrowableArray<MemoryPool*> memory_pools();
// override
virtual bool is_in_closed_subset(const void* p) const {
return is_in(p);
}
DefNewGeneration* young_gen() const {
assert(_young_gen->kind() == Generation::DefNew, "Wrong generation type");
return static_cast<DefNewGeneration*>(_young_gen);

View File

@ -575,3 +575,8 @@ void CollectedHeap::deduplicate_string(oop str) {
size_t CollectedHeap::obj_size(oop obj) const {
return obj->size();
}
uint32_t CollectedHeap::hash_oop(oop obj) const {
const uintptr_t addr = cast_from_oop<uintptr_t>(obj);
return static_cast<uint32_t>(addr >> LogMinObjAlignment);
}

View File

@ -239,37 +239,7 @@ class CollectedHeap : public CHeapObj<mtInternal> {
DEBUG_ONLY(bool is_in_or_null(const void* p) const { return p == NULL || is_in(p); })
// Let's define some terms: a "closed" subset of a heap is one that
//
// 1) contains all currently-allocated objects, and
//
// 2) is closed under reference: no object in the closed subset
// references one outside the closed subset.
//
// Membership in a heap's closed subset is useful for assertions.
// Clearly, the entire heap is a closed subset, so the default
// implementation is to use "is_in_reserved". But this may not be too
// liberal to perform useful checking. Also, the "is_in" predicate
// defines a closed subset, but may be too expensive, since "is_in"
// verifies that its argument points to an object head. The
// "closed_subset" method allows a heap to define an intermediate
// predicate, allowing more precise checking than "is_in_reserved" at
// lower cost than "is_in."
// One important case is a heap composed of disjoint contiguous spaces,
// such as the Garbage-First collector. Such heaps have a convenient
// closed subset consisting of the allocated portions of those
// contiguous spaces.
// Return "TRUE" iff the given pointer points into the heap's defined
// closed subset (which defaults to the entire heap).
virtual bool is_in_closed_subset(const void* p) const {
return is_in_reserved(p);
}
bool is_in_closed_subset_or_null(const void* p) const {
return p == NULL || is_in_closed_subset(p);
}
virtual uint32_t hash_oop(oop obj) const;
void set_gc_cause(GCCause::Cause v) {
if (UsePerfData) {

View File

@ -824,7 +824,6 @@ void GenCollectedHeap::process_roots(StrongRootsScope* scope,
CLDClosure* weak_cld_closure,
CodeBlobToOopClosure* code_roots) {
// General roots.
assert(Threads::thread_claim_parity() != 0, "must have called prologue code");
assert(code_roots != NULL, "code root closure should always be set");
// _n_termination for _process_strong_tasks should be set up stream
// in a method not running in a GC worker. Otherwise the GC worker

View File

@ -234,10 +234,9 @@ public:
void collect(GCCause::Cause cause, GenerationType max_generation);
// Returns "TRUE" iff "p" points into the committed areas of the heap.
// The methods is_in(), is_in_closed_subset() and is_in_youngest() may
// be expensive to compute in general, so, to prevent
// their inadvertent use in product jvm's, we restrict their use to
// assertion checking or verification only.
// The methods is_in() and is_in_youngest() may be expensive to compute
// in general, so, to prevent their inadvertent use in product jvm's, we
// restrict their use to assertion checking or verification only.
bool is_in(const void* p) const;
// Returns true if the reference is to an object in the reserved space

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2019, 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
@ -37,7 +37,7 @@ MarkScope::~MarkScope() {
}
StrongRootsScope::StrongRootsScope(uint n_threads) : _n_threads(n_threads) {
Threads::change_thread_claim_parity();
Threads::change_thread_claim_token();
}
StrongRootsScope::~StrongRootsScope() {

View File

@ -132,12 +132,23 @@ void ShenandoahBarrierSet::write_ref_array(HeapWord* start, size_t count) {
template <class T>
void ShenandoahBarrierSet::write_ref_array_pre_work(T* dst, size_t count) {
shenandoah_assert_not_in_cset_loc_except(dst, _heap->cancelled_gc());
if (ShenandoahSATBBarrier && _heap->is_concurrent_mark_in_progress()) {
assert(ShenandoahThreadLocalData::satb_mark_queue(Thread::current()).is_active(), "Shouldn't be here otherwise");
assert(ShenandoahSATBBarrier, "Shouldn't be here otherwise");
assert(count > 0, "Should have been filtered before");
Thread* thread = Thread::current();
ShenandoahMarkingContext* ctx = _heap->marking_context();
bool has_forwarded = _heap->has_forwarded_objects();
T* elem_ptr = dst;
for (size_t i = 0; i < count; i++, elem_ptr++) {
T heap_oop = RawAccess<>::oop_load(elem_ptr);
if (!CompressedOops::is_null(heap_oop)) {
enqueue(CompressedOops::decode_not_null(heap_oop));
oop obj = CompressedOops::decode_not_null(heap_oop);
if (has_forwarded) {
obj = resolve_forwarded_not_null(obj);
}
if (!ctx->is_marked(obj)) {
ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue_known_active(obj);
}
}
}
@ -309,12 +320,10 @@ oop ShenandoahBarrierSet::write_barrier(oop obj) {
}
oop ShenandoahBarrierSet::storeval_barrier(oop obj) {
if (ShenandoahStoreValEnqueueBarrier) {
if (!CompressedOops::is_null(obj)) {
if (ShenandoahStoreValEnqueueBarrier && !CompressedOops::is_null(obj) && _heap->is_concurrent_traversal_in_progress()) {
obj = write_barrier(obj);
enqueue(obj);
}
}
if (ShenandoahStoreValReadBarrier) {
obj = resolve_forwarded(obj);
}
@ -329,14 +338,14 @@ void ShenandoahBarrierSet::keep_alive_barrier(oop obj) {
void ShenandoahBarrierSet::enqueue(oop obj) {
shenandoah_assert_not_forwarded_if(NULL, obj, _heap->is_concurrent_traversal_in_progress());
if (!_satb_mark_queue_set.is_active()) return;
assert(_satb_mark_queue_set.is_active(), "only get here when SATB active");
// Filter marked objects before hitting the SATB queues. The same predicate would
// be used by SATBMQ::filter to eliminate already marked objects downstream, but
// filtering here helps to avoid wasteful SATB queueing work to begin with.
if (!_heap->requires_marking<false>(obj)) return;
ShenandoahThreadLocalData::satb_mark_queue(Thread::current()).enqueue(obj);
ShenandoahThreadLocalData::satb_mark_queue(Thread::current()).enqueue_known_active(obj);
}
void ShenandoahBarrierSet::on_thread_create(Thread* thread) {

View File

@ -141,7 +141,7 @@ private:
bool arraycopy_loop(T* src, T* dst, size_t length, Klass* bound, bool disjoint);
template <typename T, bool CHECKCAST, bool SATB, ShenandoahBarrierSet::ArrayCopyStoreValMode STOREVAL_MODE>
bool arraycopy_element(T* cur_src, T* cur_dst, Klass* bound, Thread* thread);
bool arraycopy_element(T* cur_src, T* cur_dst, Klass* bound, Thread* const thread, ShenandoahMarkingContext* const ctx);
public:
// Callbacks for runtime accesses.

View File

@ -28,6 +28,9 @@
#include "gc/shenandoah/shenandoahBarrierSet.hpp"
#include "gc/shenandoah/shenandoahBrooksPointer.inline.hpp"
#include "gc/shenandoah/shenandoahHeap.inline.hpp"
#include "gc/shenandoah/shenandoahHeapRegion.hpp"
#include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
#include "gc/shenandoah/shenandoahThreadLocalData.hpp"
bool ShenandoahBarrierSet::need_update_refs_barrier() {
return _heap->is_update_refs_in_progress() ||
@ -59,7 +62,8 @@ inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_ato
} while ((! oopDesc::equals_raw(compare_value, expected)) && oopDesc::equals_raw(resolve_forwarded(compare_value), resolve_forwarded(expected)));
if (oopDesc::equals_raw(expected, compare_value)) {
const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
if (keep_alive && ShenandoahSATBBarrier && !CompressedOops::is_null(compare_value)) {
if (keep_alive && ShenandoahSATBBarrier && !CompressedOops::is_null(compare_value) &&
ShenandoahHeap::heap()->is_concurrent_mark_in_progress()) {
ShenandoahBarrierSet::barrier_set()->enqueue(compare_value);
}
}
@ -72,7 +76,8 @@ inline oop ShenandoahBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_ato
oop previous = Raw::oop_atomic_xchg(new_value, addr);
if (ShenandoahSATBBarrier) {
const bool keep_alive = (decorators & AS_NO_KEEPALIVE) == 0;
if (keep_alive && !CompressedOops::is_null(previous)) {
if (keep_alive && !CompressedOops::is_null(previous) &&
ShenandoahHeap::heap()->is_concurrent_mark_in_progress()) {
ShenandoahBarrierSet::barrier_set()->enqueue(previous);
}
}
@ -134,7 +139,7 @@ bool ShenandoahBarrierSet::arraycopy_loop_3(T* src, T* dst, size_t length, Klass
template <typename T, bool CHECKCAST, bool SATB, ShenandoahBarrierSet::ArrayCopyStoreValMode STOREVAL_MODE>
bool ShenandoahBarrierSet::arraycopy_loop(T* src, T* dst, size_t length, Klass* bound, bool disjoint) {
Thread* thread = Thread::current();
ShenandoahMarkingContext* ctx = _heap->marking_context();
ShenandoahEvacOOMScope oom_evac_scope;
// We need to handle four cases:
@ -161,7 +166,7 @@ bool ShenandoahBarrierSet::arraycopy_loop(T* src, T* dst, size_t length, Klass*
T* cur_dst = dst;
T* src_end = src + length;
for (; cur_src < src_end; cur_src++, cur_dst++) {
if (!arraycopy_element<T, CHECKCAST, SATB, STOREVAL_MODE>(cur_src, cur_dst, bound, thread)) {
if (!arraycopy_element<T, CHECKCAST, SATB, STOREVAL_MODE>(cur_src, cur_dst, bound, thread, ctx)) {
return false;
}
}
@ -170,7 +175,7 @@ bool ShenandoahBarrierSet::arraycopy_loop(T* src, T* dst, size_t length, Klass*
T* cur_src = src + length - 1;
T* cur_dst = dst + length - 1;
for (; cur_src >= src; cur_src--, cur_dst--) {
if (!arraycopy_element<T, CHECKCAST, SATB, STOREVAL_MODE>(cur_src, cur_dst, bound, thread)) {
if (!arraycopy_element<T, CHECKCAST, SATB, STOREVAL_MODE>(cur_src, cur_dst, bound, thread, ctx)) {
return false;
}
}
@ -179,14 +184,26 @@ bool ShenandoahBarrierSet::arraycopy_loop(T* src, T* dst, size_t length, Klass*
}
template <typename T, bool CHECKCAST, bool SATB, ShenandoahBarrierSet::ArrayCopyStoreValMode STOREVAL_MODE>
bool ShenandoahBarrierSet::arraycopy_element(T* cur_src, T* cur_dst, Klass* bound, Thread* thread) {
bool ShenandoahBarrierSet::arraycopy_element(T* cur_src, T* cur_dst, Klass* bound, Thread* const thread, ShenandoahMarkingContext* const ctx) {
T o = RawAccess<>::oop_load(cur_src);
if (SATB) {
assert(ShenandoahThreadLocalData::satb_mark_queue(thread).is_active(), "Shouldn't be here otherwise");
T prev = RawAccess<>::oop_load(cur_dst);
if (!CompressedOops::is_null(prev)) {
oop prev_obj = CompressedOops::decode_not_null(prev);
enqueue(prev_obj);
switch (STOREVAL_MODE) {
case NONE:
break;
case READ_BARRIER:
case WRITE_BARRIER:
// The write-barrier case cannot really happen. It's traversal-only and traversal
// doesn't currently use SATB. And even if it did, it would not be fatal to just do the normal RB here.
prev_obj = ShenandoahBarrierSet::resolve_forwarded_not_null(prev_obj);
}
if (!ctx->is_marked(prev_obj)) {
ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue_known_active(prev_obj);
}
}
}

View File

@ -213,15 +213,15 @@ public:
class ShenandoahSATBThreadsClosure : public ThreadClosure {
private:
ShenandoahSATBBufferClosure* _satb_cl;
int _thread_parity;
uintx _claim_token;
public:
ShenandoahSATBThreadsClosure(ShenandoahSATBBufferClosure* satb_cl) :
_satb_cl(satb_cl),
_thread_parity(Threads::thread_claim_parity()) {}
_claim_token(Threads::thread_claim_token()) {}
void do_thread(Thread* thread) {
if (thread->claim_oops_do(true, _thread_parity)) {
if (thread->claim_threads_do(true, _claim_token)) {
ShenandoahThreadLocalData::satb_mark_queue(thread).apply_closure_and_empty(_satb_cl);
}
}

View File

@ -436,6 +436,7 @@ ShenandoahHeap::ShenandoahHeap(ShenandoahCollectorPolicy* policy) :
_cycle_memory_manager("Shenandoah Cycles", "end of GC cycle"),
_gc_timer(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
_soft_ref_policy(),
_log_min_obj_alignment_in_bytes(LogMinObjAlignmentInBytes),
_ref_processor(NULL),
_marking_context(NULL),
_bitmap_size(0),

View File

@ -505,6 +505,8 @@ private:
ConcurrentGCTimer* _gc_timer;
SoftRefPolicy _soft_ref_policy;
// For exporting to SA
int _log_min_obj_alignment_in_bytes;
public:
ShenandoahMonitoringSupport* monitoring_support() { return _monitoring_support; }
GCMemoryManager* cycle_memory_manager() { return &_cycle_memory_manager; }

View File

@ -51,7 +51,8 @@ JRT_LEAF(void, ShenandoahRuntime::write_ref_field_pre_entry(oopDesc* orig, JavaT
}
shenandoah_assert_correct(NULL, orig);
// store the original value that was in the field reference
ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue(orig);
assert(ShenandoahThreadLocalData::satb_mark_queue(thread).is_active(), "Shouldn't be here otherwise");
ShenandoahThreadLocalData::satb_mark_queue(thread).enqueue_known_active(orig);
JRT_END
JRT_LEAF(oopDesc*, ShenandoahRuntime::write_barrier_JRT(oopDesc* src))

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
*
* 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
@ -28,12 +28,27 @@
#include "gc/shenandoah/shenandoahMonitoringSupport.hpp"
#define VM_STRUCTS_SHENANDOAH(nonstatic_field, volatile_nonstatic_field, static_field) \
static_field(ShenandoahHeapRegion, RegionSizeBytes, size_t) \
nonstatic_field(ShenandoahHeap, _num_regions, size_t) \
nonstatic_field(ShenandoahHeap, _regions, ShenandoahHeapRegion**) \
nonstatic_field(ShenandoahHeap, _log_min_obj_alignment_in_bytes, int) \
volatile_nonstatic_field(ShenandoahHeap, _used, size_t) \
volatile_nonstatic_field(ShenandoahHeap, _committed, size_t) \
static_field(ShenandoahHeapRegion, RegionSizeBytes, size_t) \
static_field(ShenandoahHeapRegion, RegionSizeBytesShift, size_t) \
nonstatic_field(ShenandoahHeapRegion, _state, ShenandoahHeapRegion::RegionState) \
nonstatic_field(ShenandoahHeapRegion, _region_number, size_t) \
#define VM_INT_CONSTANTS_SHENANDOAH(declare_constant, declare_constant_with_value)
#define VM_INT_CONSTANTS_SHENANDOAH(declare_constant, declare_constant_with_value) \
declare_constant(ShenandoahHeapRegion::_empty_uncommitted) \
declare_constant(ShenandoahHeapRegion::_empty_committed) \
declare_constant(ShenandoahHeapRegion::_regular) \
declare_constant(ShenandoahHeapRegion::_humongous_start) \
declare_constant(ShenandoahHeapRegion::_humongous_cont) \
declare_constant(ShenandoahHeapRegion::_pinned_humongous_start) \
declare_constant(ShenandoahHeapRegion::_cset) \
declare_constant(ShenandoahHeapRegion::_pinned) \
declare_constant(ShenandoahHeapRegion::_pinned_cset) \
declare_constant(ShenandoahHeapRegion::_trash) \
#define VM_TYPES_SHENANDOAH(declare_type, \
declare_toplevel_type, \
@ -42,5 +57,6 @@
declare_type(ShenandoahHeapRegion, ContiguousSpace) \
declare_toplevel_type(ShenandoahHeap*) \
declare_toplevel_type(ShenandoahHeapRegion*) \
declare_toplevel_type(ShenandoahHeapRegion::RegionState) \
#endif // SHARE_GC_SHENANDOAH_VMSTRUCTS_SHENANDOAH_HPP

View File

@ -110,8 +110,8 @@ bool ZCollectedHeap::is_in(const void* p) const {
return is_in_reserved(p) && _heap.is_in((uintptr_t)p);
}
bool ZCollectedHeap::is_in_closed_subset(const void* p) const {
return is_in(p);
uint32_t ZCollectedHeap::hash_oop(oop obj) const {
return _heap.hash_oop(obj);
}
HeapWord* ZCollectedHeap::allocate_new_tlab(size_t min_size, size_t requested_size, size_t* actual_size) {

View File

@ -72,7 +72,8 @@ public:
virtual bool is_maximal_no_gc() const;
virtual bool is_in(const void* p) const;
virtual bool is_in_closed_subset(const void* p) const;
virtual uint32_t hash_oop(oop obj) const;
virtual HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded);
virtual MetaWord* satisfy_failed_metadata_allocation(ClassLoaderData* loader_data,

View File

@ -103,6 +103,7 @@ public:
size_t unsafe_max_tlab_alloc() const;
bool is_in(uintptr_t addr) const;
uint32_t hash_oop(oop obj) const;
// Block
uintptr_t block_start(uintptr_t addr) const;

View File

@ -27,6 +27,7 @@
#include "gc/z/zAddress.inline.hpp"
#include "gc/z/zForwarding.inline.hpp"
#include "gc/z/zForwardingTable.inline.hpp"
#include "gc/z/zHash.inline.hpp"
#include "gc/z/zHeap.hpp"
#include "gc/z/zMark.inline.hpp"
#include "gc/z/zOop.inline.hpp"
@ -44,6 +45,11 @@ inline ReferenceDiscoverer* ZHeap::reference_discoverer() {
return &_reference_processor;
}
inline uint32_t ZHeap::hash_oop(oop obj) const {
const uintptr_t offset = ZAddress::offset(ZOop::to_address(obj));
return ZHash::address_to_uint32(offset);
}
inline bool ZHeap::is_object_live(uintptr_t addr) const {
ZPage* page = _page_table.get(addr);
return page->is_object_live(addr);

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2019, 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
@ -179,7 +179,7 @@ ZRootsIterator::ZRootsIterator() :
_code_cache(this) {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
ZStatTimer timer(ZSubPhasePauseRootsSetup);
Threads::change_thread_claim_parity();
Threads::change_thread_claim_token();
COMPILER2_PRESENT(DerivedPointerTable::clear());
if (ClassUnloading) {
nmethod::oops_do_marking_prologue();
@ -404,7 +404,7 @@ ZThreadRootsIterator::ZThreadRootsIterator() :
_threads(this) {
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
ZStatTimer timer(ZSubPhasePauseRootsSetup);
Threads::change_thread_claim_parity();
Threads::change_thread_claim_token();
}
ZThreadRootsIterator::~ZThreadRootsIterator() {

View File

@ -565,12 +565,12 @@ JRT_END
JRT_LEAF(jboolean, JVMCIRuntime::validate_object(JavaThread* thread, oopDesc* parent, oopDesc* child))
bool ret = true;
if(!Universe::heap()->is_in_closed_subset(parent)) {
if(!Universe::heap()->is_in(parent)) {
tty->print_cr("Parent Object " INTPTR_FORMAT " not in heap", p2i(parent));
parent->print();
ret=false;
}
if(!Universe::heap()->is_in_closed_subset(child)) {
if(!Universe::heap()->is_in(child)) {
tty->print_cr("Child Object " INTPTR_FORMAT " not in heap", p2i(child));
child->print();
ret=false;

View File

@ -56,7 +56,7 @@ void OopIterateClosure::verify(T* p) {
T heap_oop = RawAccess<>::oop_load(p);
if (!CompressedOops::is_null(heap_oop)) {
oop o = CompressedOops::decode_not_null(heap_oop);
assert(Universe::heap()->is_in_closed_subset(o),
assert(Universe::heap()->is_in(o),
"should be in closed *p " PTR_FORMAT " " PTR_FORMAT, p2i(p), p2i(o));
}
}

View File

@ -280,9 +280,7 @@ void ConstantPool::archive_resolved_references(Thread* THREAD) {
rr->obj_at_put(i, NULL);
if (p != NULL && i < ref_map_len) {
int index = object_to_cp_index(i);
// Skip the entry if the string hash code is 0 since the string
// is not included in the shared string_table, see StringTable::copy_shared_string.
if (tag_at(index).is_string() && java_lang_String::hash_code(p) != 0) {
if (tag_at(index).is_string()) {
oop op = StringTable::create_archived_string(p, THREAD);
// If the String object is not archived (possibly too large),
// NULL is returned. Also set it in the array, so we won't

View File

@ -122,12 +122,6 @@ bool oopDesc::is_oop_or_null(oop obj, bool ignore_mark_word) {
}
#ifndef PRODUCT
// used only for asserts
bool oopDesc::is_unlocked_oop() const {
if (!Universe::heap()->is_in_reserved(this)) return false;
return mark()->is_unlocked();
}
#if INCLUDE_CDS_JAVA_HEAP
bool oopDesc::is_archived_object(oop p) {
return HeapShared::is_archived_object(p);

View File

@ -256,7 +256,6 @@ class oopDesc {
static bool is_oop(oop obj, bool ignore_mark_word = false);
static bool is_oop_or_null(oop obj, bool ignore_mark_word = false);
#ifndef PRODUCT
inline bool is_unlocked_oop() const;
static bool is_archived_object(oop p) NOT_CDS_JAVA_HEAP_RETURN_(false);
#endif

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2019, 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
@ -181,17 +181,9 @@ class JvmtiTagHashmap : public CHeapObj<mtInternal> {
// hash a given key (oop) with the specified size
static unsigned int hash(oop key, int size) {
ZGC_ONLY(assert(ZAddressMetadataShift >= sizeof(unsigned int) * BitsPerByte, "cast removes the metadata bits");)
// shift right to get better distribution (as these bits will be zero
// with aligned addresses)
key = Access<>::resolve(key);
unsigned int addr = (unsigned int)(cast_from_oop<intptr_t>(key));
#ifdef _LP64
return (addr >> 3) % size;
#else
return (addr >> 2) % size;
#endif
const oop obj = Access<>::resolve(key);
const unsigned int hash = Universe::heap()->hash_oop(obj);
return hash % size;
}
// hash a given key (oop)

View File

@ -316,7 +316,7 @@ oop MethodHandles::init_method_MemberName(Handle mname, CallInfo& info) {
}
Handle resolved_method = info.resolved_method_name();
assert(java_lang_invoke_ResolvedMethodName::vmtarget(resolved_method()) == m(),
assert(java_lang_invoke_ResolvedMethodName::vmtarget(resolved_method()) == m() || m->is_old(),
"Should not change after link resolution");
oop mname_oop = mname();

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2019, 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
@ -219,7 +219,7 @@ public:
NMethodMarkingTask(NMethodMarkingThreadClosure* cl) :
AbstractGangTask("Parallel NMethod Marking"),
_cl(cl) {
Threads::change_thread_claim_parity();
Threads::change_thread_claim_token();
}
~NMethodMarkingTask() {

View File

@ -238,8 +238,8 @@ Thread::Thread() {
set_last_handle_mark(NULL);
DEBUG_ONLY(_missed_ic_stub_refill_verifier = NULL);
// This initial value ==> never claimed.
_oops_do_parity = 0;
// Initial value of zero ==> never claimed.
_threads_do_token = 0;
_threads_hazard_ptr = NULL;
_threads_list_ptr = NULL;
_nested_threads_hazard_ptr_cnt = 0;
@ -885,16 +885,14 @@ bool Thread::is_interrupted(Thread* thread, bool clear_interrupted) {
// GC Support
bool Thread::claim_oops_do_par_case(int strong_roots_parity) {
int thread_parity = _oops_do_parity;
if (thread_parity != strong_roots_parity) {
jint res = Atomic::cmpxchg(strong_roots_parity, &_oops_do_parity, thread_parity);
if (res == thread_parity) {
bool Thread::claim_par_threads_do(uintx claim_token) {
uintx token = _threads_do_token;
if (token != claim_token) {
uintx res = Atomic::cmpxchg(claim_token, &_threads_do_token, token);
if (res == token) {
return true;
} else {
guarantee(res == strong_roots_parity, "Or else what?");
return false;
}
guarantee(res == claim_token, "invariant");
}
return false;
}
@ -3472,7 +3470,7 @@ JavaThread* Threads::_thread_list = NULL;
int Threads::_number_of_threads = 0;
int Threads::_number_of_non_daemon_threads = 0;
int Threads::_return_code = 0;
int Threads::_thread_claim_parity = 0;
uintx Threads::_thread_claim_token = 1; // Never zero.
size_t JavaThread::_stack_size_at_create = 0;
#ifdef ASSERT
@ -3532,14 +3530,14 @@ void Threads::threads_do(ThreadClosure* tc) {
}
void Threads::possibly_parallel_threads_do(bool is_par, ThreadClosure* tc) {
int cp = Threads::thread_claim_parity();
uintx claim_token = Threads::thread_claim_token();
ALL_JAVA_THREADS(p) {
if (p->claim_oops_do(is_par, cp)) {
if (p->claim_threads_do(is_par, claim_token)) {
tc->do_thread(p);
}
}
VMThread* vmt = VMThread::vm_thread();
if (vmt->claim_oops_do(is_par, cp)) {
if (vmt->claim_threads_do(is_par, claim_token)) {
tc->do_thread(vmt);
}
}
@ -4525,27 +4523,39 @@ void Threads::oops_do(OopClosure* f, CodeBlobClosure* cf) {
VMThread::vm_thread()->oops_do(f, cf);
}
void Threads::change_thread_claim_parity() {
// Set the new claim parity.
assert(_thread_claim_parity >= 0 && _thread_claim_parity <= 2,
"Not in range.");
_thread_claim_parity++;
if (_thread_claim_parity == 3) _thread_claim_parity = 1;
assert(_thread_claim_parity >= 1 && _thread_claim_parity <= 2,
"Not in range.");
void Threads::change_thread_claim_token() {
if (++_thread_claim_token == 0) {
// On overflow of the token counter, there is a risk of future
// collisions between a new global token value and a stale token
// for a thread, because not all iterations visit all threads.
// (Though it's pretty much a theoretical concern for non-trivial
// token counter sizes.) To deal with the possibility, reset all
// the thread tokens to zero on global token overflow.
struct ResetClaims : public ThreadClosure {
virtual void do_thread(Thread* t) {
t->claim_threads_do(false, 0);
}
} reset_claims;
Threads::threads_do(&reset_claims);
// On overflow, update the global token to non-zero, to
// avoid the special "never claimed" initial thread value.
_thread_claim_token = 1;
}
}
#ifdef ASSERT
void assert_thread_claimed(const char* kind, Thread* t, uintx expected) {
const uintx token = t->threads_do_token();
assert(token == expected,
"%s " PTR_FORMAT " has incorrect value " UINTX_FORMAT " != "
UINTX_FORMAT, kind, p2i(t), token, expected);
}
void Threads::assert_all_threads_claimed() {
ALL_JAVA_THREADS(p) {
const int thread_parity = p->oops_do_parity();
assert((thread_parity == _thread_claim_parity),
"Thread " PTR_FORMAT " has incorrect parity %d != %d", p2i(p), thread_parity, _thread_claim_parity);
assert_thread_claimed("Thread", p, _thread_claim_token);
}
VMThread* vmt = VMThread::vm_thread();
const int thread_parity = vmt->oops_do_parity();
assert((thread_parity == _thread_claim_parity),
"VMThread " PTR_FORMAT " has incorrect parity %d != %d", p2i(vmt), thread_parity, _thread_claim_parity);
assert_thread_claimed("VMThread", VMThread::vm_thread(), _thread_claim_token);
}
#endif // ASSERT

View File

@ -338,9 +338,8 @@ class Thread: public ThreadShadow {
// Point to the last handle mark
HandleMark* _last_handle_mark;
// The parity of the last strong_roots iteration in which this thread was
// claimed as a task.
int _oops_do_parity;
// Claim value for parallel iteration over threads.
uintx _threads_do_token;
// Support for GlobalCounter
private:
@ -647,27 +646,28 @@ class Thread: public ThreadShadow {
// Apply "cf->do_code_blob" (if !NULL) to all code blobs active in frames
virtual void oops_do(OopClosure* f, CodeBlobClosure* cf);
// Handles the parallel case for the method below.
// Handles the parallel case for claim_threads_do.
private:
bool claim_oops_do_par_case(int collection_parity);
bool claim_par_threads_do(uintx claim_token);
public:
// Requires that "collection_parity" is that of the current roots
// iteration. If "is_par" is false, sets the parity of "this" to
// "collection_parity", and returns "true". If "is_par" is true,
// uses an atomic instruction to set the current threads parity to
// "collection_parity", if it is not already. Returns "true" iff the
// Requires that "claim_token" is that of the current iteration.
// If "is_par" is false, sets the token of "this" to
// "claim_token", and returns "true". If "is_par" is true,
// uses an atomic instruction to set the current thread's token to
// "claim_token", if it is not already. Returns "true" iff the
// calling thread does the update, this indicates that the calling thread
// has claimed the thread's stack as a root group in the current
// collection.
bool claim_oops_do(bool is_par, int collection_parity) {
// has claimed the thread in the current iteration.
bool claim_threads_do(bool is_par, uintx claim_token) {
if (!is_par) {
_oops_do_parity = collection_parity;
_threads_do_token = claim_token;
return true;
} else {
return claim_oops_do_par_case(collection_parity);
return claim_par_threads_do(claim_token);
}
}
uintx threads_do_token() const { return _threads_do_token; }
// jvmtiRedefineClasses support
void metadata_handles_do(void f(Metadata*));
@ -750,7 +750,6 @@ protected:
Monitor* owned_locks() const { return _owned_locks; }
bool owns_locks() const { return owned_locks() != NULL; }
bool owns_locks_but_compiled_lock() const;
int oops_do_parity() const { return _oops_do_parity; }
// Deadlock detection
bool allow_allocation() { return _allow_allocation_count == 0; }
@ -2223,7 +2222,7 @@ class Threads: AllStatic {
static int _number_of_threads;
static int _number_of_non_daemon_threads;
static int _return_code;
static int _thread_claim_parity;
static uintx _thread_claim_token;
#ifdef ASSERT
static bool _vm_complete;
#endif
@ -2256,21 +2255,23 @@ class Threads: AllStatic {
// Does not include JNI_VERSION_1_1
static jboolean is_supported_jni_version(jint version);
// The "thread claim parity" provides a way for threads to be claimed
// The "thread claim token" provides a way for threads to be claimed
// by parallel worker tasks.
//
// Each thread contains a "parity" field. A task will claim the
// thread only if its parity field is the same as the global parity,
// which is updated by calling change_thread_claim_parity().
// Each thread contains a "token" field. A task will claim the
// thread only if its token is different from the global token,
// which is updated by calling change_thread_claim_token(). When
// a thread is claimed, it's token is set to the global token value
// so other threads in the same iteration pass won't claim it.
//
// For this to work change_thread_claim_parity() needs to be called
// For this to work change_thread_claim_token() needs to be called
// exactly once in sequential code before starting parallel tasks
// that should claim threads.
//
// New threads get their parity set to 0 and change_thread_claim_parity()
// never sets the global parity to 0.
static int thread_claim_parity() { return _thread_claim_parity; }
static void change_thread_claim_parity();
// New threads get their token set to 0 and change_thread_claim_token()
// never sets the global token to 0.
static uintx thread_claim_token() { return _thread_claim_token; }
static void change_thread_claim_token();
static void assert_all_threads_claimed() NOT_DEBUG_RETURN;
// Apply "f->do_oop" to all root oops in all threads.
@ -2324,6 +2325,8 @@ class Threads: AllStatic {
// Deoptimizes all frames tied to marked nmethods
static void deoptimized_wrt_marked_nmethods();
struct Test; // For private gtest access.
};

View File

@ -1510,8 +1510,14 @@ public final class String
public int hashCode() {
int h = hash;
if (h == 0 && value.length > 0) {
hash = h = isLatin1() ? StringLatin1.hashCode(value)
h = isLatin1() ? StringLatin1.hashCode(value)
: StringUTF16.hashCode(value);
// Avoid issuing a store if the calculated value is also zero:
// in addition to a minor performance benefit, this allows storing
// Strings with zero hash code in read-only memory.
if (h != 0) {
hash = h;
}
}
return h;
}

View File

@ -160,6 +160,7 @@ grant codeBase "jrt:/jdk.internal.vm.compiler" {
grant codeBase "jrt:/jdk.internal.vm.compiler.management" {
permission java.lang.RuntimePermission "accessClassInPackage.jdk.internal.vm.compiler.collections";
permission java.lang.RuntimePermission "accessClassInPackage.jdk.vm.ci.runtime";
permission java.lang.RuntimePermission "accessClassInPackage.jdk.vm.ci.services";
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.core.common";
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.debug";
permission java.lang.RuntimePermission "accessClassInPackage.org.graalvm.compiler.hotspot";

View File

@ -1065,8 +1065,11 @@ Java_sun_nio_fs_WindowsNativeDispatcher_CreateSymbolicLink0(JNIEnv* env,
// Allow creation of symbolic links when the process is not elevated.
// Developer Mode must be enabled for this option to function, otherwise
// it will be ignored.
DWORD dwFlags = (DWORD)flags | SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
// it will be ignored. Check that symbol is available in current build SDK.
DWORD dwFlags = (DWORD)flags;
#ifdef SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE
dwFlags |= SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE;
#endif
// On Windows 64-bit this appears to succeed even when there are
// insufficient privileges

View File

@ -237,7 +237,7 @@ public abstract class BaseFileManager implements JavaFileManager {
return true;
}
// where
private static final Set<Option> javacFileManagerOptions =
protected static final Set<Option> javacFileManagerOptions =
Option.getJavacFileManagerOptions();
@Override @DefinedBy(Api.COMPILER)

View File

@ -27,6 +27,7 @@ package com.sun.tools.javac.file;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
import java.net.MalformedURLException;
@ -71,6 +72,7 @@ import javax.tools.StandardJavaFileManager;
import com.sun.tools.javac.file.RelativePath.RelativeDirectory;
import com.sun.tools.javac.file.RelativePath.RelativeFile;
import com.sun.tools.javac.main.Option;
import com.sun.tools.javac.resources.CompilerProperties.Errors;
import com.sun.tools.javac.util.Assert;
import com.sun.tools.javac.util.Context;
@ -128,6 +130,19 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
protected SortFiles sortFiles;
/**
* We use a two-layered map instead of a map with a complex key because we don't want to reindex
* the values for every Location+RelativeDirectory pair. Once the PathsAndContainers are needed
* for a single Location, we should know all valid RelativeDirectory mappings. Because the
* indexing is costly for very large classpaths, this can result in a significant savings.
*/
private Map<Location, Map<RelativeDirectory, java.util.List<PathAndContainer>>>
pathsAndContainersByLocationAndRelativeDirectory = new HashMap<>();
/** Containers that have no indexing by {@link RelativeDirectory}, keyed by {@link Location}. */
private Map<Location, java.util.List<PathAndContainer>> nonIndexingContainersByLocation =
new HashMap<>();
/**
* Register a Context.Factory to create a JavacFileManager.
*/
@ -338,6 +353,13 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
ListBuffer<JavaFileObject> resultList) throws IOException;
public abstract JavaFileObject getFileObject(Path userPath, RelativeFile name) throws IOException;
public abstract void close() throws IOException;
public abstract boolean maintainsDirectoryIndex();
/**
* The directories this container indexes if {@link #maintainsDirectoryIndex()}, otherwise
* an empty iterable.
*/
public abstract Iterable<RelativeDirectory> indexedDirectories();
}
private static final Container MISSING_CONTAINER = new Container() {
@ -354,6 +376,14 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
}
@Override
public void close() throws IOException {}
@Override
public boolean maintainsDirectoryIndex() {
return false;
}
@Override
public Iterable<RelativeDirectory> indexedDirectories() {
return List.nil();
}
};
private final class JRTImageContainer implements Container {
@ -407,6 +437,16 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
@Override
public void close() throws IOException {
}
@Override
public boolean maintainsDirectoryIndex() {
return false;
}
@Override
public Iterable<RelativeDirectory> indexedDirectories() {
return List.nil();
}
}
private synchronized JRTIndex getJRTIndex() {
@ -498,6 +538,16 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
@Override
public void close() throws IOException {
}
@Override
public boolean maintainsDirectoryIndex() {
return false;
}
@Override
public Iterable<RelativeDirectory> indexedDirectories() {
return List.nil();
}
}
private static final Set<FileVisitOption> NO_FILE_VISIT_OPTIONS = Set.of();
@ -506,7 +556,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
private final class ArchiveContainer implements Container {
private final Path archivePath;
private final FileSystem fileSystem;
private final Map<RelativePath, Path> packages;
private final Map<RelativeDirectory, Path> packages;
public ArchiveContainer(Path archivePath) throws IOException, ProviderNotFoundException, SecurityException {
this.archivePath = archivePath;
@ -604,6 +654,16 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
public void close() throws IOException {
fileSystem.close();
}
@Override
public boolean maintainsDirectoryIndex() {
return true;
}
@Override
public Iterable<RelativeDirectory> indexedDirectories() {
return packages.keySet();
}
}
/**
@ -654,6 +714,8 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
@Override @DefinedBy(Api.COMPILER)
public void flush() {
contentCache.clear();
pathsAndContainersByLocationAndRelativeDirectory.clear();
nonIndexingContainersByLocation.clear();
}
/**
@ -704,15 +766,12 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
nullCheck(packageName);
nullCheck(kinds);
Iterable<? extends Path> path = getLocationAsPaths(location);
if (path == null)
return List.nil();
RelativeDirectory subdirectory = RelativeDirectory.forPackage(packageName);
ListBuffer<JavaFileObject> results = new ListBuffer<>();
for (Path directory : path) {
Container container = getContainer(directory);
for (PathAndContainer pathAndContainer : pathsAndContainers(location, subdirectory)) {
Path directory = pathAndContainer.path;
Container container = pathAndContainer.container;
container.list(directory, subdirectory, kinds, recurse, results);
}
@ -927,6 +986,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
{
nullCheck(location);
locations.setLocation(location, asPaths(searchpath));
clearCachesForLocation(location);
}
@Override @DefinedBy(Api.COMPILER)
@ -936,6 +996,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
{
nullCheck(location);
locations.setLocation(location, nullCheck(searchpath));
clearCachesForLocation(location);
}
@Override @DefinedBy(Api.COMPILER)
@ -945,11 +1006,113 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
}
@Override @DefinedBy(Api.COMPILER)
public Iterable<? extends Path> getLocationAsPaths(Location location) {
public Collection<? extends Path> getLocationAsPaths(Location location) {
nullCheck(location);
return locations.getLocation(location);
}
private java.util.List<PathAndContainer> pathsAndContainers(
Location location, RelativeDirectory relativeDirectory) throws IOException {
try {
return pathsAndContainersByLocationAndRelativeDirectory.computeIfAbsent(
location, this::indexPathsAndContainersByRelativeDirectory)
.computeIfAbsent(
relativeDirectory, d -> nonIndexingContainersByLocation.get(location));
} catch (UncheckedIOException e) {
throw e.getCause();
}
}
private Map<RelativeDirectory, java.util.List<PathAndContainer>> indexPathsAndContainersByRelativeDirectory(
Location location) {
Map<RelativeDirectory, java.util.List<PathAndContainer>> result = new HashMap<>();
java.util.List<PathAndContainer> allPathsAndContainers = pathsAndContainers(location);
// First collect all of the containers that don't maintain their own index on
// RelativeDirectory. These need to always be included for all mappings
java.util.List<PathAndContainer> nonIndexingContainers = new ArrayList<>();
for (PathAndContainer pathAndContainer : allPathsAndContainers) {
if (!pathAndContainer.container.maintainsDirectoryIndex()) {
nonIndexingContainers.add(pathAndContainer);
}
}
// Next, use the container that do maintain their own RelativeDirectory index to create a
// single master index.
for (PathAndContainer pathAndContainer : allPathsAndContainers) {
Container container = pathAndContainer.container;
if (container.maintainsDirectoryIndex()) {
for (RelativeDirectory directory : container.indexedDirectories()) {
result.computeIfAbsent(directory, d -> new ArrayList<>(nonIndexingContainers))
.add(pathAndContainer);
}
}
}
nonIndexingContainersByLocation.put(location, nonIndexingContainers);
// Sorting preserves the search order used in the uncached Location path, which has
// maintains consistency with the classpath order
result.values().forEach(pathAndContainerList -> Collections.sort(pathAndContainerList));
return result;
}
/**
* For each {@linkplain #getLocationAsPaths(Location) path of the location}, compute the
* corresponding {@link Container}.
*/
private java.util.List<PathAndContainer> pathsAndContainers(Location location) {
Collection<? extends Path> paths = getLocationAsPaths(location);
if (paths == null) {
return List.nil();
}
java.util.List<PathAndContainer> pathsAndContainers =
new ArrayList<>(paths.size());
for (Path path : paths) {
Container container;
try {
container = getContainer(path);
} catch (IOException e) {
throw new UncheckedIOException(e);
}
pathsAndContainers.add(new PathAndContainer(path, container, pathsAndContainers.size()));
}
return pathsAndContainers;
}
private static class PathAndContainer implements Comparable<PathAndContainer> {
private final Path path;
private final Container container;
private final int index;
PathAndContainer(Path path, Container container, int index) {
this.path = path;
this.container = container;
this.index = index;
}
@Override
public int compareTo(PathAndContainer other) {
return index - other.index;
}
@Override
public boolean equals(Object o) {
if (o == null || !(o instanceof PathAndContainer)) {
return false;
}
PathAndContainer that = (PathAndContainer) o;
return path.equals(that.path)
&& container.equals(that.container)
&& index == this.index;
}
@Override
public int hashCode() {
return Objects.hash(path, container, index);
}
}
@Override @DefinedBy(Api.COMPILER)
public boolean contains(Location location, FileObject fo) throws IOException {
nullCheck(location);
@ -1008,6 +1171,7 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
nullCheck(location);
checkModuleOrientedOrOutputLocation(location);
locations.setLocationForModule(location, nullCheck(moduleName), nullCheck(paths));
clearCachesForLocation(location);
}
@Override @DefinedBy(Api.COMPILER)
@ -1163,4 +1327,19 @@ public class JavacFileManager extends BaseFileManager implements StandardJavaFil
}
};
}
@Override
public boolean handleOption(Option option, String value) {
if (javacFileManagerOptions.contains(option)) {
pathsAndContainersByLocationAndRelativeDirectory.clear();
nonIndexingContainersByLocation.clear();
}
return super.handleOption(option, value);
}
private void clearCachesForLocation(Location location) {
nullCheck(location);
pathsAndContainersByLocationAndRelativeDirectory.remove(location);
nonIndexingContainersByLocation.remove(location);
}
}

View File

@ -64,6 +64,8 @@ public abstract class CollectedHeap extends VMObject {
public abstract long capacity();
public abstract long used();
public long oopOffset() { return 0; }
public MemRegion reservedRegion() {
return new MemRegion(addr.addOffsetTo(reservedFieldOffset));
}

View File

@ -0,0 +1,94 @@
/*
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
*
* 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 sun.jvm.hotspot.gc.shenandoah;
import sun.jvm.hotspot.utilities.BitMap;
import sun.jvm.hotspot.utilities.BitMapInterface;
import java.util.HashMap;
public class ShenandoahBitMap implements BitMapInterface {
private HashMap<ShenandoahHeapRegion, BitMap> regionToBitMap = new HashMap<>();
private ShenandoahHeap heap;
ShenandoahBitMap(ShenandoahHeap heap) {
this.heap = heap;
}
@Override
public boolean at(long offset) {
ShenandoahHeapRegion region = heap.regionAtOffset(offset);
BitMap bitmap = regionToBitMap.get(region);
if (bitmap == null) {
return false;
} else {
int index = toBitMapOffset(offset, region);
return bitmap.at(index);
}
}
@Override
public void atPut(long offset, boolean value) {
ShenandoahHeapRegion region = heap.regionAtOffset(offset);
BitMap bitmap = getOrAddBitMap(region);
int index = toBitMapOffset(offset, region);
bitmap.atPut(index, value);
}
@Override
public void clear() {
for (BitMap bitMap : regionToBitMap.values()) {
bitMap.clear();
}
}
private int toBitMapOffset(long offset, ShenandoahHeapRegion region) {
long regionSize = ShenandoahHeapRegion.regionSizeBytes();
long regionOffset = region.regionNumber() * regionSize;
long offsetInRegion = offset - regionOffset;
if (offsetInRegion < 0 || offsetInRegion >= regionSize) {
throw new RuntimeException("Unexpected negative offset: " + offsetInRegion);
}
return (int)(offsetInRegion >>> heap.getLogMinObjAlignmentInBytes());
}
private BitMap getOrAddBitMap(ShenandoahHeapRegion region) {
BitMap bitMap = regionToBitMap.get(region);
if (bitMap == null) {
long regionSize = ShenandoahHeapRegion.regionSizeBytes();
long maxNumObjects = regionSize >>> heap.getLogMinObjAlignmentInBytes();
if (maxNumObjects > Integer.MAX_VALUE) {
throw new RuntimeException("int overflow");
}
int intMaxNumObjects = (int)maxNumObjects;
bitMap = new BitMap(intMaxNumObjects);
regionToBitMap.put(region, bitMap);
}
return bitMap;
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved.
*
* 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
@ -28,10 +28,14 @@ import sun.jvm.hotspot.gc.shared.CollectedHeapName;
import sun.jvm.hotspot.gc.shared.LiveRegionsClosure;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.runtime.VMObjectFactory;
import sun.jvm.hotspot.types.AddressField;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.memory.MemRegion;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.utilities.BitMapInterface;
import java.io.PrintStream;
import java.util.Observable;
import java.util.Observer;
@ -40,6 +44,11 @@ public class ShenandoahHeap extends CollectedHeap {
static private CIntegerField numRegions;
static private CIntegerField used;
static private CIntegerField committed;
static private AddressField regions;
static private CIntegerField logMinObjAlignmentInBytes;
static private long regionPtrFieldSize;
static private long brookPtrSize;
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@ -53,6 +62,21 @@ public class ShenandoahHeap extends CollectedHeap {
numRegions = type.getCIntegerField("_num_regions");
used = type.getCIntegerField("_used");
committed = type.getCIntegerField("_committed");
regions = type.getAddressField("_regions");
logMinObjAlignmentInBytes = type.getCIntegerField("_log_min_obj_alignment_in_bytes");
brookPtrSize = db.lookupIntConstant("HeapWordSize").longValue();
Type regionPtrType = db.lookupType("ShenandoahHeapRegion*");
regionPtrFieldSize = regionPtrType.getSize();
}
public ShenandoahHeap(Address addr) {
super(addr);
}
@Override
public long oopOffset() {
return brookPtrSize;
}
@Override
@ -78,10 +102,35 @@ public class ShenandoahHeap extends CollectedHeap {
return committed.getValue(addr);
}
public int getLogMinObjAlignmentInBytes() {
return logMinObjAlignmentInBytes.getJInt(addr);
}
public ShenandoahHeapRegion getRegion(long index) {
if (index < numOfRegions()) {
Address arrayAddr = regions.getValue(addr);
Address regAddr = arrayAddr.getAddressAt(index * regionPtrFieldSize);
ShenandoahHeapRegion region = VMObjectFactory.newObject(ShenandoahHeapRegion.class, regAddr);
region.setHeap(this);
return region;
}
return null;
}
public ShenandoahHeapRegion regionAtOffset(long offset) {
long index = offset >>> ShenandoahHeapRegion.regionSizeBytesShift();
if (index < 0 || index >= numOfRegions()) {
throw new RuntimeException("Invalid offset: " + offset);
}
return getRegion(index);
}
@Override
public void liveRegionsIterate(LiveRegionsClosure closure) {
// Operation (currently) not supported with Shenandoah GC.
System.err.println("Warning: Operation not supported with Shenandoah GC");
for (long index = 0; index < numOfRegions(); index ++) {
ShenandoahHeapRegion region = getRegion(index);
closure.doLiveRegions(region);
}
}
@Override
@ -92,7 +141,9 @@ public class ShenandoahHeap extends CollectedHeap {
tty.println(" region size " + ShenandoahHeapRegion.regionSizeBytes() / 1024 + " K");
}
public ShenandoahHeap(Address addr) {
super(addr);
@Override
public BitMapInterface createBitMap(long bits) {
return new ShenandoahBitMap(this);
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2017, 2019, Red Hat, Inc. All rights reserved.
*
* 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
@ -23,19 +23,43 @@
package sun.jvm.hotspot.gc.shenandoah;
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.gc.shared.ContiguousSpace;
import sun.jvm.hotspot.types.CIntegerField;
import sun.jvm.hotspot.gc.shared.LiveRegionsProvider;
import sun.jvm.hotspot.memory.MemRegion;
import sun.jvm.hotspot.oops.Mark;
import sun.jvm.hotspot.oops.Oop;
import sun.jvm.hotspot.oops.UnknownOopException;
import sun.jvm.hotspot.types.*;
import sun.jvm.hotspot.runtime.VM;
import sun.jvm.hotspot.types.Type;
import sun.jvm.hotspot.types.TypeDataBase;
import sun.jvm.hotspot.debugger.Address;
import sun.jvm.hotspot.utilities.AddressOps;
import java.util.ArrayList;
import java.util.List;
import java.util.Observable;
import java.util.Observer;
public class ShenandoahHeapRegion extends ContiguousSpace {
private static CIntegerField RegionSizeBytes;
public class ShenandoahHeapRegion extends ContiguousSpace implements LiveRegionsProvider {
private static int EmptyUncommitted;
private static int EmptyCommitted;
private static int Regular;
private static int HumongousStart;
private static int HumongousCont;
private static int PinnedHumongousStart;
private static int CSet;
private static int Pinned;
private static int PinnedCSet;
private static int Trash;
private static CIntegerField RegionSizeBytesField;
private static Field RegionStateField;
private static CIntegerField RegionNumberField;
private static CIntegerField RegionSizeBytesShiftField;
private ShenandoahHeap heap;
static {
VM.registerVMInitializedObserver(new Observer() {
public void update(Observable o, Object data) {
@ -46,12 +70,154 @@ public class ShenandoahHeapRegion extends ContiguousSpace {
static private synchronized void initialize(TypeDataBase db) {
Type type = db.lookupType("ShenandoahHeapRegion");
RegionSizeBytes = type.getCIntegerField("RegionSizeBytes");
RegionSizeBytesField = type.getCIntegerField("RegionSizeBytes");
RegionStateField = type.getField("_state");
RegionNumberField = type.getCIntegerField("_region_number");
RegionSizeBytesShiftField = type.getCIntegerField("RegionSizeBytesShift");
EmptyUncommitted = db.lookupIntConstant("ShenandoahHeapRegion::_empty_uncommitted").intValue();
EmptyCommitted = db.lookupIntConstant("ShenandoahHeapRegion::_empty_committed").intValue();
Regular = db.lookupIntConstant("ShenandoahHeapRegion::_regular").intValue();
HumongousStart = db.lookupIntConstant("ShenandoahHeapRegion::_humongous_start").intValue();
HumongousCont = db.lookupIntConstant("ShenandoahHeapRegion::_humongous_cont").intValue();
PinnedHumongousStart = db.lookupIntConstant("ShenandoahHeapRegion::_pinned_humongous_start").intValue();
CSet = db.lookupIntConstant("ShenandoahHeapRegion::_cset").intValue();
Pinned = db.lookupIntConstant("ShenandoahHeapRegion::_pinned").intValue();
PinnedCSet = db.lookupIntConstant("ShenandoahHeapRegion::_pinned_cset").intValue();
Trash = db.lookupIntConstant("ShenandoahHeapRegion::_trash").intValue();
}
public static long regionSizeBytes() { return RegionSizeBytes.getValue(); }
public static long regionSizeBytes() {
return RegionSizeBytesField.getValue();
}
public static int regionSizeBytesShift() {
return RegionSizeBytesShiftField.getJInt();
}
public ShenandoahHeapRegion(Address addr) {
super(addr);
}
public void setHeap(ShenandoahHeap heap) {
this.heap = heap;
}
@Override
public int hashCode() {
return (int)regionNumber();
}
@Override
public boolean equals(Object other) {
if (other instanceof ShenandoahHeapRegion) {
ShenandoahHeapRegion otherRegion = (ShenandoahHeapRegion)other;
return otherRegion.regionNumber() == regionNumber();
}
return false;
}
public List<MemRegion> getLiveRegions() {
List<MemRegion> res = new ArrayList<>();
int state = regionState();
if (state == EmptyUncommitted || state == EmptyCommitted || state == Trash) {
// No live data
} else if (state == HumongousCont) {
// Handled by HumongousStart
} else if (state == HumongousStart || state == PinnedHumongousStart) {
handleHumongousRegion(res);
} else if (state == Regular || state == Pinned) {
handleRegularRegion(res);
} else if (state == CSet || state == PinnedCSet) {
// CSet
handleCSetRegion(res);
} else {
throw new RuntimeException("Unknown region state: " + state);
}
return res;
}
/*
* Note: RegionState is an enum on JVM side. Seems that there is not
* a standard way to read enum value. We read it as an integer
* from the field's offset.
*/
private int regionState() {
long offset = RegionStateField.getOffset();
return addr.getJIntAt(offset);
}
private void handleHumongousRegion(List<MemRegion> res) {
long index = regionNumber();
Address topAddr = top();
ShenandoahHeapRegion region = heap.getRegion(++ index);
while (region.regionState() == HumongousCont) {
topAddr = region.top();
region = heap.getRegion(++ index);
}
res.add(new MemRegion(bottom(), topAddr));
}
private void handleRegularRegion(List<MemRegion> res) {
res.add(new MemRegion(bottom(), top()));
}
// Filter out forwarded objects, they should be counted in other regions
private void handleCSetRegion(List<MemRegion> res) {
Address end = top();
Address start = bottom();
Address regionStart = null;
Address regionEnd = null;
while (AddressOps.lessThan(start, end)) {
long size = getObjectSize(start);
if (hasForwardee(start)) {
// has to-space object, skip this one
if (regionEnd != null) {
MemRegion mr = new MemRegion(regionStart, regionEnd);
res.add(mr);
regionStart = null;
regionEnd = null;
}
} else {
if (regionStart == null) {
regionStart = start;
} else {
regionEnd = start.addOffsetTo(heap.oopOffset() + size);
}
}
start = start.addOffsetTo(heap.oopOffset() + size);
}
if (regionStart != null) {
MemRegion mr = new MemRegion(regionStart, top());
res.add(mr);
}
}
public long regionNumber() {
return RegionNumberField.getValue(addr);
}
private boolean hasForwardee(Address rawPtr) {
// Use Mark as a helper to read forward pointer value.
Mark mark = new Mark(rawPtr);
Address forwardee = mark.valueAsAddress();
return (forwardee != rawPtr.addOffsetTo(heap.oopOffset()));
}
private long getObjectSize(Address rawPtr) {
// Dealing with a raw pointer, offsets forward pointer to find real Oop.
OopHandle handle = rawPtr.addOffsetToAsOopHandle(heap.oopOffset());
Oop obj = null;
try {
// Best effort, may fail
obj = VM.getVM().getObjectHeap().newOop(handle);
} catch (UnknownOopException exp) {
throw new RuntimeException(" UnknownOopException " + exp);
}
return obj.getObjectSize();
}
}

View File

@ -256,6 +256,8 @@ public class ObjectHeap {
while (handle.lessThan(top)) {
Oop obj = null;
// Raw pointer walk
handle = handle.addOffsetToAsOopHandle(heap.oopOffset());
try {
obj = newOop(handle);

View File

@ -0,0 +1,178 @@
/*
* Copyright (c) 2019, 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 "memory/allocation.hpp"
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "runtime/thread.hpp"
#include "runtime/vmOperations.hpp"
#include "runtime/vmThread.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/ostream.hpp"
#include "unittest.hpp"
struct Threads::Test : public AllStatic {
class VM_TestClaimOverflow;
class CountThreads;
class CheckClaims;
};
class Threads::Test::CountThreads : public ThreadClosure {
uintx _claim_token;
uint _java_threads_count;
uint _non_java_threads_count;
bool _need_claim;
public:
CountThreads(uintx claim_token, bool need_claim) :
_claim_token(claim_token),
_java_threads_count(0),
_non_java_threads_count(0),
_need_claim(need_claim)
{}
virtual void do_thread(Thread* t) {
if (!_need_claim || t->claim_threads_do(true, _claim_token)) {
if (t->is_Java_thread()) {
++_java_threads_count;
} else {
++_non_java_threads_count;
}
}
}
uint java_threads_count() const { return _java_threads_count; }
uint non_java_threads_count() const { return _non_java_threads_count; }
uint count() const { return _java_threads_count + _non_java_threads_count; }
};
class Threads::Test::CheckClaims : public ThreadClosure {
uintx _claim_token;
uint _java_threads_claimed;
uint _java_threads_unclaimed;
uint _non_java_threads_claimed;
uint _non_java_threads_unclaimed;
public:
CheckClaims(uintx claim_token) :
_claim_token(claim_token),
_java_threads_claimed(0),
_java_threads_unclaimed(0),
_non_java_threads_claimed(0),
_non_java_threads_unclaimed(0)
{}
virtual void do_thread(Thread* t) {
uintx thread_token = t->threads_do_token();
if (thread_token == _claim_token) {
if (t->is_Java_thread()) {
++_java_threads_claimed;
} else {
++_non_java_threads_claimed;
}
} else {
if (t->is_Java_thread()) {
++_java_threads_unclaimed;
} else {
++_non_java_threads_unclaimed;
}
}
}
uint java_threads_claimed() const { return _java_threads_claimed; }
uint java_threads_unclaimed() const { return _java_threads_unclaimed; }
uint non_java_threads_claimed() const { return _non_java_threads_claimed; }
uint non_java_threads_unclaimed() const { return _non_java_threads_unclaimed; }
uint claimed() const {
return _java_threads_claimed + _non_java_threads_claimed;
}
uint unclaimed() const {
return _java_threads_unclaimed + _non_java_threads_unclaimed;
}
};
class Threads::Test::VM_TestClaimOverflow : public VM_GTestExecuteAtSafepoint {
public:
void doit() {
// Prevent changes to the NJT list while we're conducting our test.
MutexLockerEx ml(NonJavaThreadsList_lock, Mutex::_no_safepoint_check_flag);
_thread_claim_token = max_uintx - 1;
ASSERT_EQ(max_uintx - 1, thread_claim_token());
CountThreads count1(thread_claim_token(), true);
threads_do(&count1);
tty->print_cr("Testing claim overflow with %u threads", count1.count());
// At least the main thread and the VM thread.
ASSERT_LE(2u, count1.count());
ASSERT_LE(1u, count1.java_threads_count());
ASSERT_LE(1u, count1.non_java_threads_count());
ASSERT_EQ(max_uintx - 1, thread_claim_token());
CheckClaims check1(thread_claim_token());
threads_do(&check1);
ASSERT_EQ(count1.count(), check1.claimed());
ASSERT_EQ(count1.java_threads_count(), check1.java_threads_claimed());
ASSERT_EQ(0u, check1.java_threads_unclaimed());
ASSERT_EQ(count1.non_java_threads_count(), check1.non_java_threads_claimed());
ASSERT_EQ(0u, check1.non_java_threads_unclaimed());
change_thread_claim_token(); // No overflow yet.
ASSERT_EQ(max_uintx, thread_claim_token());
CountThreads count2(thread_claim_token(), false); // Claimed by PPTD below
possibly_parallel_threads_do(true, &count2);
ASSERT_EQ(count1.java_threads_count(), count2.java_threads_count());
ASSERT_EQ(1u, count2.non_java_threads_count()); // Only VM thread
CheckClaims check2(thread_claim_token());
threads_do(&check2);
ASSERT_EQ(count2.java_threads_count(), check2.java_threads_claimed());
ASSERT_EQ(0u, check2.java_threads_unclaimed());
ASSERT_EQ(1u, check2.non_java_threads_claimed()); // Only VM thread
ASSERT_EQ(count1.non_java_threads_count(),
check2.non_java_threads_claimed() +
check2.non_java_threads_unclaimed());
change_thread_claim_token(); // Expect overflow.
ASSERT_EQ(uintx(1), thread_claim_token());
// Verify all threads have claim value of 0 after change overflow.
CheckClaims check3(0);
threads_do(&check3);
ASSERT_EQ(count1.count(), check3.claimed());
ASSERT_EQ(0u, check3.unclaimed());
}
};
// Test overflow handling in Threads::change_thread_claim_token().
TEST_VM(ThreadsTest, claim_overflow) {
Threads::Test::VM_TestClaimOverflow op;
ThreadInVMfromNative invm(JavaThread::current());
VMThread::execute(&op);
}

View File

@ -139,13 +139,6 @@ serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java 8214
#############################################################################
# :hotspot_gc_shenandoah
gc/shenandoah/TestStringDedup.java 8220671,8221102 generic-all
gc/shenandoah/TestStringDedupStress.java 8220671,8221102 generic-all
#############################################################################
# :hotspot_misc
#############################################################################

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -30,7 +30,7 @@ do
echo creating $file for $module...
cat > $file <<EOF
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -66,7 +66,7 @@ do
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox\$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:$module
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:$module
*/
EOF

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.base 0% 50%
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.base 0% 50%
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.base 50% 100%
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.base 50% 100%
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.compiler
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.compiler
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.datatransfer
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.datatransfer
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.desktop 0% 50%
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.desktop 0% 50%
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.desktop 50% 100%
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.desktop 50% 100%
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.instrument
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.instrument
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.logging
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.logging
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.management
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.management
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.management.rmi
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.management.rmi
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.naming
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.naming
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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,17 +23,17 @@
/*
* @test
* @summary run CTW for all classes from jdk.packager module
* @summary run CTW for all classes from java.net.http module
*
* @library /test/lib / /testlibrary/ctw/src
* @modules java.base/jdk.internal.access
* java.base/jdk.internal.jimage
* java.base/jdk.internal.misc
* java.base/jdk.internal.reflect
* @modules jdk.packager
* @modules java.net.http
*
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:jdk.packager
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.net.http
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.prefs
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.prefs
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.rmi
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.rmi
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.scripting
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.scripting
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.security.jgss
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.security.jgss
*/

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2019, 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
@ -35,5 +35,5 @@
* @build sun.hotspot.WhiteBox
* @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.security.sasl
* @run driver/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:java.security.sasl
*/

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