Skip to content

Commit aba80ba

Browse files
committed
Merge
2 parents b7e3b3b + 7b81a9c commit aba80ba

File tree

857 files changed

+31912
-31298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

857 files changed

+31912
-31298
lines changed

make/Images.gmk

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2014, 2020, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -114,67 +114,66 @@ $(eval $(call SetupExecute, jlink_jre, \
114114

115115
JLINK_JRE_TARGETS := $(jlink_jre)
116116

117-
ifeq ($(BUILD_CDS_ARCHIVE), true)
117+
# Optimize CDS shared heap for small heap sizes, which are typically used
118+
# for small cloud-based apps that have the most critical start-up requirement.
119+
# The trade-off is that when larger heap sizes are used, the shared heap
120+
# may need to be relocated at runtime.
121+
CDS_DUMP_FLAGS = -Xmx128M -Xms128M
122+
123+
# Helper function for creating the CDS archives for the JDK and JRE
124+
#
125+
# Param1 - VM variant (e.g., server, client, zero, ...)
126+
# Param2 - _nocoops, or empty
127+
define CreateCDSArchive
128+
$1_$2_DUMP_EXTRA_ARG := $(if $(filter _nocoops, $2),-XX:-UseCompressedOops,)
129+
$1_$2_DUMP_TYPE := $(if $(filter _nocoops, $2),-NOCOOPS,)
130+
131+
# Only G1 supports dumping the shared heap, so explicitly use G1 if the JVM supports it.
132+
$1_$2_CDS_DUMP_FLAGS := $(CDS_DUMP_FLAGS) $(if $(filter g1gc, $(JVM_FEATURES_$1)),-XX:+UseG1GC)
133+
118134
ifeq ($(OPENJDK_TARGET_OS), windows)
119-
CDS_ARCHIVE := bin/server/classes.jsa
120-
CDS_NOCOOPS_ARCHIVE := bin/server/classes_nocoops.jsa
135+
$1_$2_CDS_ARCHIVE := bin/$1/classes$2.jsa
121136
else
122-
CDS_ARCHIVE := lib/server/classes.jsa
123-
CDS_NOCOOPS_ARCHIVE := lib/server/classes_nocoops.jsa
137+
$1_$2_CDS_ARCHIVE := lib/$1/classes$2.jsa
124138
endif
125139

126-
$(eval $(call SetupExecute, gen_cds_archive_jdk, \
127-
WARN := Creating CDS archive for jdk image, \
128-
DEPS := $(jlink_jdk), \
129-
OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_ARCHIVE), \
130-
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
131-
COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
132-
-XX:SharedArchiveFile=$(JDK_IMAGE_DIR)/$(CDS_ARCHIVE) \
133-
-Xmx128M -Xms128M $(LOG_INFO), \
140+
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jdk, \
141+
WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jdk image for $1, \
142+
INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
143+
DEPS := $$(jlink_jdk), \
144+
OUTPUT_FILE := $$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE), \
145+
SUPPORT_DIR := $$(SUPPORT_OUTPUTDIR)/images/jdk, \
146+
COMMAND := $$(FIXPATH) $$(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
147+
-XX:SharedArchiveFile=$$(JDK_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE) \
148+
-$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
134149
))
135150

136-
JDK_TARGETS += $(gen_cds_archive_jdk)
137-
138-
$(eval $(call SetupExecute, gen_cds_archive_jre, \
139-
WARN := Creating CDS archive for jre image, \
140-
DEPS := $(jlink_jre), \
141-
OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_ARCHIVE), \
142-
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
143-
COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
144-
-XX:SharedArchiveFile=$(JRE_IMAGE_DIR)/$(CDS_ARCHIVE) \
145-
-Xmx128M -Xms128M $(LOG_INFO), \
151+
JDK_TARGETS += $$($1_$2_gen_cds_archive_jdk)
152+
153+
$$(eval $$(call SetupExecute, $1_$2_gen_cds_archive_jre, \
154+
WARN := Creating CDS$$($1_$2_DUMP_TYPE) archive for jre image for $1, \
155+
INFO := Using CDS flags for $1: $$($1_$2_CDS_DUMP_FLAGS), \
156+
DEPS := $$(jlink_jre), \
157+
OUTPUT_FILE := $$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE), \
158+
SUPPORT_DIR := $$(SUPPORT_OUTPUTDIR)/images/jre, \
159+
COMMAND := $$(FIXPATH) $$(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
160+
-XX:SharedArchiveFile=$$(JRE_IMAGE_DIR)/$$($1_$2_CDS_ARCHIVE) \
161+
-$1 $$($1_$2_DUMP_EXTRA_ARG) $$($1_$2_CDS_DUMP_FLAGS) $$(LOG_INFO), \
146162
))
147163

148-
JRE_TARGETS += $(gen_cds_archive_jre)
164+
JRE_TARGETS += $$($1_$2_gen_cds_archive_jre)
165+
endef
166+
167+
ifeq ($(BUILD_CDS_ARCHIVE), true)
168+
$(foreach v, $(JVM_VARIANTS), \
169+
$(eval $(call CreateCDSArchive,$v,)) \
170+
)
149171

150172
ifeq ($(call isTargetCpuBits, 64), true)
151-
$(eval $(call SetupExecute, gen_cds_nocoops_archive_jdk, \
152-
WARN := Creating CDS-NOCOOPS archive for jdk image, \
153-
DEPS := $(jlink_jdk), \
154-
OUTPUT_FILE := $(JDK_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE), \
155-
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jdk, \
156-
COMMAND := $(FIXPATH) $(JDK_IMAGE_DIR)/bin/java -Xshare:dump \
157-
-XX:SharedArchiveFile=$(JDK_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE) \
158-
-XX:-UseCompressedOops \
159-
-Xmx128M -Xms128M $(LOG_INFO), \
160-
))
161-
162-
JDK_TARGETS += $(gen_cds_nocoops_archive_jdk)
163-
164-
$(eval $(call SetupExecute, gen_cds_nocoops_archive_jre, \
165-
WARN := Creating CDS-NOCOOPS archive for jre image, \
166-
DEPS := $(jlink_jre), \
167-
OUTPUT_FILE := $(JRE_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE), \
168-
SUPPORT_DIR := $(SUPPORT_OUTPUTDIR)/images/jre, \
169-
COMMAND := $(FIXPATH) $(JRE_IMAGE_DIR)/bin/java -Xshare:dump \
170-
-XX:SharedArchiveFile=$(JRE_IMAGE_DIR)/$(CDS_NOCOOPS_ARCHIVE) \
171-
-XX:-UseCompressedOops \
172-
-Xmx128M -Xms128M $(LOG_INFO), \
173-
))
174-
175-
JRE_TARGETS += $(gen_cds_nocoops_archive_jre)
173+
$(foreach v, $(JVM_VARIANTS), \
174+
$(eval $(call CreateCDSArchive,$v,_nocoops)) \
175+
)
176176
endif
177-
178177
endif
179178

180179
################################################################################

make/RunTests.gmk

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -349,13 +349,24 @@ ExpandJtregPath = \
349349
)) \
350350
)
351351

352+
# with test id: dir/Test.java#selection -> Test.java#selection -> .java#selection -> #selection
353+
# without: dir/Test.java -> Test.java -> .java -> <<empty string>>
354+
TestID = \
355+
$(subst .java,,$(suffix $(notdir $1)))
356+
357+
# The test id starting with a hash (#testid) will be stripped by all
358+
# evals in ParseJtregTestSelectionInner and will be reinserted by calling
359+
# TestID (if it is present).
360+
ParseJtregTestSelection = \
361+
$(call IfAppend, $(call ParseJtregTestSelectionInner, $1), $(call TestID, $1))
362+
352363
# Helper function to determine if a test specification is a Jtreg test
353364
#
354365
# It is a Jtreg test if it optionally begins with jtreg:, and then is either
355366
# an unspecified group name (possibly prefixed by :), or a group in a
356367
# specified test root, or a path to a test or test directory,
357368
# either absolute or relative to any of the TEST_BASEDIRS or test roots.
358-
define ParseJtregTestSelection
369+
define ParseJtregTestSelectionInner
359370
$(eval TEST_NAME := $(strip $(patsubst jtreg:%, %, $1))) \
360371
$(if $(or $(findstring :, $(TEST_NAME)), $(findstring /, $(TEST_NAME))), , \
361372
$(eval TEST_NAME := :$(TEST_NAME)) \
@@ -419,38 +430,26 @@ ifeq ($(TEST), )
419430
$(error Cannot continue)
420431
endif
421432

433+
ParseTestSelection = \
434+
$(strip $(or \
435+
$(call ParseCustomTestSelection, $1) \
436+
$(call ParseGtestTestSelection, $1) \
437+
$(call ParseMicroTestSelection, $1) \
438+
$(call ParseJtregTestSelection, $1) \
439+
$(call ParseSpecialTestSelection, $1) \
440+
))
441+
422442
# Now intelligently convert the test selection given by the user in TEST
423443
# into a list of fully qualified test descriptors of the tests to run.
424-
TESTS_TO_RUN :=
425-
$(foreach test, $(TEST), \
426-
$(eval PARSED_TESTS := $(call ParseCustomTestSelection, $(test))) \
427-
$(if $(strip $(PARSED_TESTS)), , \
428-
$(eval PARSED_TESTS += $(call ParseGtestTestSelection, $(test))) \
429-
) \
430-
$(if $(strip $(PARSED_TESTS)), , \
431-
$(eval PARSED_TESTS += $(call ParseMicroTestSelection, $(test))) \
432-
) \
433-
$(if $(strip $(PARSED_TESTS)), , \
434-
$(eval PARSED_TESTS += $(call ParseJtregTestSelection, $(test))) \
435-
) \
436-
$(if $(strip $(PARSED_TESTS)), , \
437-
$(eval PARSED_TESTS += $(call ParseSpecialTestSelection, $(test))) \
438-
) \
439-
$(if $(strip $(PARSED_TESTS)), , \
440-
$(eval UNKNOWN_TEST := $(test)) \
441-
) \
442-
$(eval TESTS_TO_RUN += $(PARSED_TESTS)) \
443-
)
444+
TESTS_TO_RUN := $(strip $(foreach test, $(TEST), $(call ParseTestSelection, $(test))))
445+
UNKNOWN_TEST := $(strip $(foreach test, $(TEST), $(if $(call ParseTestSelection, $(test)), , $(test))))
444446

445447
ifneq ($(UNKNOWN_TEST), )
446448
$(info Unknown test selection: '$(UNKNOWN_TEST)')
447449
$(info See doc/testing.[md|html] for help)
448450
$(error Cannot continue)
449451
endif
450452

451-
TESTS_TO_RUN := $(strip $(TESTS_TO_RUN))
452-
453-
454453
# Present the result of our parsing to the user
455454
$(info Test selection '$(TEST)', will run:)
456455
$(foreach test, $(TESTS_TO_RUN), $(info * $(test)))
@@ -786,6 +785,8 @@ define SetupRunJtregTestBody
786785
# symbol lookup in hserr files
787786
ifeq ($$(call isTargetOs, windows), true)
788787
$1_JTREG_BASIC_OPTIONS += -e:_NT_SYMBOL_PATH
788+
else ifeq ($$(call isTargetOs, linux), true)
789+
$1_JTREG_BASIC_OPTIONS += -e:_JVM_DWARF_PATH=$$(SYMBOLS_IMAGE_DIR)
789790
endif
790791

791792
$1_JTREG_BASIC_OPTIONS += \

make/autoconf/configure.ac

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,18 +191,15 @@ TOOLCHAIN_POST_DETECTION
191191
TOOLCHAIN_SETUP_BUILD_COMPILERS
192192
TOOLCHAIN_MISC_CHECKS
193193

194-
# Setup the JTReg Regression Test Harness.
195-
TOOLCHAIN_SETUP_JTREG
196-
197-
# Setup the Java Microbenchmark Harness (JMH)
198-
LIB_TESTS_SETUP_JMH
199-
200-
# Setup Jib dependency tool
201-
TOOLCHAIN_SETUP_JIB
202-
203194
# After toolchain setup, we need to process some flags to be able to continue.
204195
FLAGS_POST_TOOLCHAIN
205196

197+
# Setup the tools needed to test the JDK (JTReg Regression Test Harness,
198+
# Java Microbenchmark Harness (JMH) and the Jib dependency tool).
199+
LIB_TESTS_SETUP_JTREG
200+
LIB_TESTS_SETUP_JMH
201+
LIB_TESTS_SETUP_JIB
202+
206203
# Now we can test some aspects on the target using configure macros.
207204
PLATFORM_SETUP_OPENJDK_TARGET_BITS
208205
PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS
@@ -243,7 +240,8 @@ HOTSPOT_SETUP_MISC
243240
#
244241
###############################################################################
245242

246-
JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER
243+
LIB_TESTS_ENABLE_DISABLE_FAILURE_HANDLER
244+
247245
JDKOPT_ENABLE_DISABLE_GENERATE_CLASSLIST
248246
JDKOPT_EXCLUDE_TRANSLATIONS
249247
JDKOPT_ENABLE_DISABLE_MANPAGES

make/autoconf/flags-cflags.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
113113
)
114114
fi
115115
116-
CFLAGS_DEBUG_SYMBOLS="-g"
116+
CFLAGS_DEBUG_SYMBOLS="-g -gdwarf-4"
117117
ASFLAGS_DEBUG_SYMBOLS="-g"
118118
elif test "x$TOOLCHAIN_TYPE" = xclang; then
119119
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then

make/autoconf/jdk-options.m4

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -486,29 +486,6 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JLINK_OPTIONS],
486486
AC_SUBST(JLINK_KEEP_PACKAGED_MODULES)
487487
])
488488

489-
################################################################################
490-
#
491-
# Check if building of the jtreg failure handler should be enabled.
492-
#
493-
AC_DEFUN_ONCE([JDKOPT_ENABLE_DISABLE_FAILURE_HANDLER],
494-
[
495-
UTIL_ARG_ENABLE(NAME: jtreg-failure-handler, DEFAULT: auto,
496-
RESULT: BUILD_FAILURE_HANDLER,
497-
DESC: [enable building of the jtreg failure handler],
498-
DEFAULT_DESC: [enabled if jtreg is present],
499-
CHECKING_MSG: [if the jtreg failure handler should be built],
500-
CHECK_AVAILABLE: [
501-
AC_MSG_CHECKING([if the jtreg failure handler is available])
502-
if test "x$JT_HOME" != "x"; then
503-
AC_MSG_RESULT([yes])
504-
else
505-
AVAILABLE=false
506-
AC_MSG_RESULT([no (jtreg not present)])
507-
fi
508-
])
509-
AC_SUBST(BUILD_FAILURE_HANDLER)
510-
])
511-
512489
################################################################################
513490
#
514491
# Enable or disable generation of the classlist at build time

make/autoconf/jvm-features.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ AC_DEFUN([JVM_FEATURES_PREPARE_VARIANT],
426426
elif test "x$variant" = "xcore"; then
427427
JVM_FEATURES_VARIANT_UNAVAILABLE="cds minimal zero"
428428
elif test "x$variant" = "xzero"; then
429-
JVM_FEATURES_VARIANT_UNAVAILABLE="cds compiler1 compiler2 \
429+
JVM_FEATURES_VARIANT_UNAVAILABLE="compiler1 compiler2 \
430430
jvmci minimal zgc"
431431
else
432432
JVM_FEATURES_VARIANT_UNAVAILABLE="minimal zero"

0 commit comments

Comments
 (0)