mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-21 08:49:39 +01:00
Compare commits
107 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fe9f05023e | ||
|
|
6d9a50ea14 | ||
|
|
9cc260d3a1 | ||
|
|
d8dc7118fd | ||
|
|
9a4d4ab101 | ||
|
|
ac7a3c00bb | ||
|
|
bff5e90359 | ||
|
|
d2927cfa24 | ||
|
|
ee4d54c500 | ||
|
|
306e364ffd | ||
|
|
4338cb3d70 | ||
|
|
b7f38fc54f | ||
|
|
57bc96e5cd | ||
|
|
23301d5776 | ||
|
|
5a77c29032 | ||
|
|
79c3d47cfe | ||
|
|
73c77d9624 | ||
|
|
b178894423 | ||
|
|
9c7cab5404 | ||
|
|
b5ed8cca77 | ||
|
|
f9f7a27ffa | ||
|
|
60c68a1363 | ||
|
|
78150ca9df | ||
|
|
887a93b7c9 | ||
|
|
eb2c4b0b83 | ||
|
|
b2cc1890ff | ||
|
|
f1802d5300 | ||
|
|
b40b18823b | ||
|
|
c1ea6daa5b | ||
|
|
b9a535b8ac | ||
|
|
c7f1c97312 | ||
|
|
7fc13bb537 | ||
|
|
175184cb18 | ||
|
|
dfea48b7f5 | ||
|
|
83f0f841ee | ||
|
|
7586d8e43f | ||
|
|
e5cb83cd74 | ||
|
|
247a4360f6 | ||
|
|
4799c8d40c | ||
|
|
bb43aae61f | ||
|
|
4034787ccb | ||
|
|
a91569dd20 | ||
|
|
9257505059 | ||
|
|
628e31b8c1 | ||
|
|
3017281956 | ||
|
|
8db5d865c1 | ||
|
|
ba96094128 | ||
|
|
01f780fab2 | ||
|
|
b0920c24cd | ||
|
|
3909d74af5 | ||
|
|
d115295df8 | ||
|
|
71a05bf03f | ||
|
|
d3f18d0469 | ||
|
|
07a8911ce8 | ||
|
|
749f749f04 | ||
|
|
6022e73d73 | ||
|
|
46f1df38a0 | ||
|
|
3984a00ea9 | ||
|
|
4ea14b2720 | ||
|
|
3daa936f2d | ||
|
|
db3427582d | ||
|
|
5308410724 | ||
|
|
6951987b65 | ||
|
|
34222839e8 | ||
|
|
dfe52be4ef | ||
|
|
865cf888ef | ||
|
|
71cc879bd4 | ||
|
|
46b1b1ae8d | ||
|
|
da24559051 | ||
|
|
33f07b56ef | ||
|
|
28db238d52 | ||
|
|
6b79e792ac | ||
|
|
a8df559763 | ||
|
|
acc4829ec3 | ||
|
|
e5f3366efa | ||
|
|
29ed3878cc | ||
|
|
2110300246 | ||
|
|
f27efd6a29 | ||
|
|
0442d772b0 | ||
|
|
6aace1819c | ||
|
|
28279ee615 | ||
|
|
01cb043b29 | ||
|
|
bb0e203d13 | ||
|
|
b121931959 | ||
|
|
a6e35650f9 | ||
|
|
a72afb3845 | ||
|
|
b8c88a3e91 | ||
|
|
ea6d79ff94 | ||
|
|
c249229b3c | ||
|
|
fb3cc98da3 | ||
|
|
a05f3d10cc | ||
|
|
3ae97bc502 | ||
|
|
049be572ef | ||
|
|
57d97b52c9 | ||
|
|
6b46c776e4 | ||
|
|
d7b592ab21 | ||
|
|
d62249a3ab | ||
|
|
41b7296f49 | ||
|
|
a55e18baf0 | ||
|
|
ae77bd009f | ||
|
|
9f0469b94a | ||
|
|
379a8bbb5d | ||
|
|
e88a022072 | ||
|
|
cbec97c945 | ||
|
|
e5684da6e5 | ||
|
|
508d04f71f | ||
|
|
7de0fb3613 |
@@ -1,7 +1,7 @@
|
||||
[general]
|
||||
project=jdk
|
||||
jbs=JDK
|
||||
version=23
|
||||
version=22
|
||||
|
||||
[checks]
|
||||
error=author,committer,reviewers,merge,issues,executable,symlink,message,hg-tag,whitespace,problemlists
|
||||
|
||||
@@ -58,7 +58,7 @@ DEMO_MANIFEST := $(SUPPORT_OUTPUTDIR)/demos/java-main-manifest.mf
|
||||
# This rule will be depended on due to the MANIFEST line in SetupBuildDemo
|
||||
# and SetupBuildJvmtiDemo.
|
||||
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
|
||||
SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf.template, \
|
||||
SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
||||
OUTPUT_FILE := $(DEMO_MANIFEST), \
|
||||
REPLACEMENTS := \
|
||||
@@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION) ; \
|
||||
|
||||
@@ -33,7 +33,7 @@ include TextFileProcessing.gmk
|
||||
|
||||
# This rule will be depended on due to the MANIFEST line
|
||||
$(eval $(call SetupTextFileProcessing, BUILD_JAVA_MANIFEST, \
|
||||
SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf.template, \
|
||||
SOURCE_FILES := $(TOPDIR)/make/data/mainmanifest/manifest.mf, \
|
||||
OUTPUT_FILE := $(SUPPORT_OUTPUTDIR)/java-main-manifest.mf, \
|
||||
REPLACEMENTS := \
|
||||
@@VERSION_SPECIFICATION@@ => $(VERSION_SPECIFICATION) ; \
|
||||
|
||||
@@ -69,7 +69,7 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
))
|
||||
|
||||
$(eval $(call SetupTextFileProcessing, BUILD_JDK_PLIST, \
|
||||
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist.template, \
|
||||
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JDK-Info.plist, \
|
||||
OUTPUT_FILE := $(JDK_MACOSX_CONTENTS_DIR)/Info.plist, \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jdk ; \
|
||||
@@ -82,7 +82,7 @@ ifeq ($(call isTargetOs, macosx), true)
|
||||
))
|
||||
|
||||
$(eval $(call SetupTextFileProcessing, BUILD_JRE_PLIST, \
|
||||
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist.template, \
|
||||
SOURCE_FILES := $(MACOSX_PLIST_SRC)/JRE-Info.plist, \
|
||||
OUTPUT_FILE := $(JRE_MACOSX_CONTENTS_DIR)/Info.plist, \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).jre ; \
|
||||
|
||||
@@ -744,16 +744,9 @@ endif
|
||||
|
||||
$(eval $(call SetupTarget, build-test-lib, \
|
||||
MAKEFILE := test/BuildTestLib, \
|
||||
TARGET := build-test-lib, \
|
||||
DEPS := exploded-image, \
|
||||
))
|
||||
|
||||
$(eval $(call SetupTarget, test-image-lib, \
|
||||
MAKEFILE := test/BuildTestLib, \
|
||||
TARGET := test-image-lib, \
|
||||
DEPS := build-test-lib, \
|
||||
))
|
||||
|
||||
ifeq ($(BUILD_FAILURE_HANDLER), true)
|
||||
# Builds the failure handler jtreg extension
|
||||
$(eval $(call SetupTarget, build-test-failure-handler, \
|
||||
@@ -788,7 +781,7 @@ endif
|
||||
|
||||
$(eval $(call SetupTarget, build-microbenchmark, \
|
||||
MAKEFILE := test/BuildMicrobenchmark, \
|
||||
DEPS := interim-langtools exploded-image build-test-lib, \
|
||||
DEPS := interim-langtools exploded-image, \
|
||||
))
|
||||
|
||||
################################################################################
|
||||
@@ -1271,7 +1264,7 @@ all-docs-bundles: docs-jdk-bundles docs-javase-bundles docs-reference-bundles
|
||||
# This target builds the test image
|
||||
test-image: prepare-test-image test-image-jdk-jtreg-native \
|
||||
test-image-demos-jdk test-image-libtest-jtreg-native \
|
||||
test-image-lib test-image-lib-native
|
||||
test-image-lib-native
|
||||
|
||||
ifneq ($(JVM_TEST_IMAGE_TARGETS), )
|
||||
# If JVM_TEST_IMAGE_TARGETS is externally defined, use it instead of the
|
||||
|
||||
@@ -448,17 +448,17 @@ AC_DEFUN_ONCE([BASIC_SETUP_OUTPUT_DIR],
|
||||
AC_SUBST(CONFIGURESUPPORT_OUTPUTDIR)
|
||||
|
||||
# The spec.gmk file contains all variables for the make system.
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.template])
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/spec.gmk:$AUTOCONF_DIR/spec.gmk.in])
|
||||
# The bootcycle-spec.gmk file contains support for boot cycle builds.
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.template])
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/bootcycle-spec.gmk:$AUTOCONF_DIR/bootcycle-spec.gmk.in])
|
||||
# The buildjdk-spec.gmk file contains support for building a buildjdk when cross compiling.
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.template])
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/buildjdk-spec.gmk:$AUTOCONF_DIR/buildjdk-spec.gmk.in])
|
||||
# The compare.sh is used to compare the build output to other builds.
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.template])
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/compare.sh:$AUTOCONF_DIR/compare.sh.in])
|
||||
# The generated Makefile knows where the spec.gmk is and where the source is.
|
||||
# You can run make from the OUTPUTDIR, or from the top-level Makefile
|
||||
# which will look for generated configurations
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.template])
|
||||
AC_CONFIG_FILES([$OUTPUTDIR/Makefile:$AUTOCONF_DIR/Makefile.in])
|
||||
])
|
||||
|
||||
###############################################################################
|
||||
|
||||
@@ -110,15 +110,6 @@ AC_DEFUN_ONCE([JDKVER_SETUP_JDK_VERSION_NUMBERS],
|
||||
CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
|
||||
AC_SUBST(COMPANY_NAME)
|
||||
|
||||
# Set the JDK RC Company name
|
||||
# Otherwise uses the value set for "vendor-name".
|
||||
UTIL_ARG_WITH(NAME: jdk-rc-company-name, TYPE: string,
|
||||
DEFAULT: $COMPANY_NAME,
|
||||
DESC: [Set JDK RC company name. This is used for CompanyName properties of MS Windows binaries.],
|
||||
DEFAULT_DESC: [from branding.conf],
|
||||
CHECK_VALUE: [UTIL_CHECK_STRING_NON_EMPTY_PRINTABLE])
|
||||
AC_SUBST(JDK_RC_COMPANY_NAME)
|
||||
|
||||
# The vendor URL, if any
|
||||
# Only set VENDOR_URL if '--with-vendor-url' was used and is not empty.
|
||||
# Otherwise we will use the value from "branding.conf" included above.
|
||||
|
||||
@@ -191,7 +191,6 @@ PRODUCT_NAME := @PRODUCT_NAME@
|
||||
PRODUCT_SUFFIX := @PRODUCT_SUFFIX@
|
||||
JDK_RC_PLATFORM_NAME := @JDK_RC_PLATFORM_NAME@
|
||||
JDK_RC_NAME := @JDK_RC_NAME@
|
||||
JDK_RC_COMPANY_NAME:=@JDK_RC_COMPANY_NAME@
|
||||
COMPANY_NAME := @COMPANY_NAME@
|
||||
HOTSPOT_VM_DISTRO := @HOTSPOT_VM_DISTRO@
|
||||
MACOSX_BUNDLE_NAME_BASE := @MACOSX_BUNDLE_NAME_BASE@
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -389,6 +389,10 @@ AC_DEFUN_ONCE([TOOLCHAIN_POST_DETECTION],
|
||||
# This is necessary since AC_PROG_CC defaults CFLAGS to "-g -O2"
|
||||
CFLAGS="$ORG_CFLAGS"
|
||||
CXXFLAGS="$ORG_CXXFLAGS"
|
||||
|
||||
# filter out some unwanted additions autoconf may add to CXX; we saw this on macOS with autoconf 2.72
|
||||
UTIL_GET_NON_MATCHING_VALUES(cxx_filtered, $CXX, -std=c++11 -std=gnu++11)
|
||||
CXX="$cxx_filtered"
|
||||
])
|
||||
|
||||
# Check if a compiler is of the toolchain type we expect, and save the version
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2024, 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
|
||||
@@ -199,7 +199,7 @@ AC_DEFUN([UTIL_GET_NON_MATCHING_VALUES],
|
||||
if test -z "$legal_values"; then
|
||||
$1="$2"
|
||||
else
|
||||
result=`$GREP -Fvx "$legal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
||||
result=`$GREP -Fvx -- "$legal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
||||
$1=${result//$'\n'/ }
|
||||
fi
|
||||
])
|
||||
@@ -226,7 +226,7 @@ AC_DEFUN([UTIL_GET_MATCHING_VALUES],
|
||||
if test -z "$illegal_values"; then
|
||||
$1=""
|
||||
else
|
||||
result=`$GREP -Fx "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
||||
result=`$GREP -Fx -- "$illegal_values" <<< "$values_to_check" | $GREP -v '^$'`
|
||||
$1=${result//$'\n'/ }
|
||||
fi
|
||||
])
|
||||
|
||||
@@ -98,7 +98,7 @@ GLOBAL_VERSION_INFO_RESOURCE := $(TOPDIR)/src/java.base/windows/native/common/ve
|
||||
|
||||
JDK_RCFLAGS=$(RCFLAGS) \
|
||||
-D"JDK_VERSION_STRING=$(VERSION_STRING)" \
|
||||
-D"JDK_COMPANY=$(JDK_RC_COMPANY_NAME)" \
|
||||
-D"JDK_COMPANY=$(COMPANY_NAME)" \
|
||||
-D"JDK_VER=$(VERSION_NUMBER_FOUR_POSITIONS)" \
|
||||
-D"JDK_COPYRIGHT=Copyright \xA9 $(COPYRIGHT_YEAR)" \
|
||||
-D"JDK_NAME=$(JDK_RC_NAME) $(VERSION_SHORT)" \
|
||||
|
||||
@@ -112,7 +112,7 @@ define SetupBuildLauncherBody
|
||||
$1_PLIST_FILE := $$(SUPPORT_OUTPUTDIR)/native/$$(MODULE)/$1/Info.plist
|
||||
|
||||
$$(eval $$(call SetupTextFileProcessing, BUILD_PLIST_$1, \
|
||||
SOURCE_FILES := $(TOPDIR)/make/data/bundle/cmdline-Info.plist.template, \
|
||||
SOURCE_FILES := $(TOPDIR)/make/data/bundle/cmdline-Info.plist, \
|
||||
OUTPUT_FILE := $$($1_PLIST_FILE), \
|
||||
REPLACEMENTS := \
|
||||
@@ID@@ => $(MACOSX_BUNDLE_ID_BASE).$1 ; \
|
||||
|
||||
@@ -1206,7 +1206,7 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
|
||||
jcov: {
|
||||
organization: common.organization,
|
||||
revision: "3.0-16-jdk-asm+1.0",
|
||||
revision: "3.0-15-jdk-asm+1.0",
|
||||
ext: "zip",
|
||||
environment_name: "JCOV_HOME",
|
||||
},
|
||||
|
||||
@@ -26,17 +26,17 @@
|
||||
# Default version, product, and vendor information to use,
|
||||
# unless overridden by configure
|
||||
|
||||
DEFAULT_VERSION_FEATURE=23
|
||||
DEFAULT_VERSION_FEATURE=22
|
||||
DEFAULT_VERSION_INTERIM=0
|
||||
DEFAULT_VERSION_UPDATE=0
|
||||
DEFAULT_VERSION_PATCH=0
|
||||
DEFAULT_VERSION_EXTRA1=0
|
||||
DEFAULT_VERSION_EXTRA2=0
|
||||
DEFAULT_VERSION_EXTRA3=0
|
||||
DEFAULT_VERSION_DATE=2024-09-17
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=67 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_DATE=2024-03-19
|
||||
DEFAULT_VERSION_CLASSFILE_MAJOR=66 # "`$EXPR $DEFAULT_VERSION_FEATURE + 44`"
|
||||
DEFAULT_VERSION_CLASSFILE_MINOR=0
|
||||
DEFAULT_VERSION_DOCS_API_SINCE=11
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="21 22 23"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=23
|
||||
DEFAULT_PROMOTED_VERSION_PRE=ea
|
||||
DEFAULT_ACCEPTABLE_BOOT_VERSIONS="21 22"
|
||||
DEFAULT_JDK_SOURCE_TARGET_VERSION=22
|
||||
DEFAULT_PROMOTED_VERSION_PRE=
|
||||
|
||||
@@ -223,6 +223,7 @@ JVM_VirtualThreadEnd
|
||||
JVM_VirtualThreadMount
|
||||
JVM_VirtualThreadUnmount
|
||||
JVM_VirtualThreadHideFrames
|
||||
JVM_VirtualThreadDisableSuspend
|
||||
|
||||
# Scoped values
|
||||
JVM_EnsureMaterializedForStackWalk_func
|
||||
|
||||
@@ -48,7 +48,7 @@ $(eval $(call IncludeCustomExtension, hotspot/gensrc/GenerateSources.gmk))
|
||||
|
||||
# Setup the hotspot launcher script for developer use
|
||||
$(eval $(call SetupTextFileProcessing, CREATE_HOTSPOT_LAUNCHER, \
|
||||
SOURCE_FILES := $(TOPDIR)/make/scripts/hotspot.sh.template, \
|
||||
SOURCE_FILES := $(TOPDIR)/make/scripts/hotspot.sh, \
|
||||
OUTPUT_FILE := $(JVM_OUTPUTDIR)/hotspot, \
|
||||
REPLACEMENTS := \
|
||||
@@LIBARCH@@ => $(OPENJDK_TARGET_CPU_LEGACY_LIB) ; \
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2024, 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
|
||||
@@ -1289,25 +1289,58 @@ public class CLDRConverter {
|
||||
*/
|
||||
private static void generateTZDBShortNamesMap() throws IOException {
|
||||
Files.walk(Path.of(tzDataDir), 1, FileVisitOption.FOLLOW_LINKS)
|
||||
.filter(p -> p.toFile().isFile())
|
||||
.filter(p -> p.toFile().isFile() && !p.endsWith("jdk11_backward"))
|
||||
.forEach(p -> {
|
||||
try {
|
||||
String zone = null;
|
||||
String rule = null;
|
||||
String format = null;
|
||||
boolean inVanguard = false;
|
||||
boolean inRearguard = false;
|
||||
for (var line : Files.readAllLines(p)) {
|
||||
if (line.contains("#STDOFF")) continue;
|
||||
// Interpret the line in rearguard mode so that STD/DST
|
||||
// correctly handles negative DST cases, such as "GMT/IST"
|
||||
// vs. "IST/GMT" case for Europe/Dublin
|
||||
if (inVanguard) {
|
||||
if (line.startsWith("# Rearguard")) {
|
||||
inVanguard = false;
|
||||
inRearguard = true;
|
||||
}
|
||||
continue;
|
||||
} else if (line.startsWith("# Vanguard")) {
|
||||
inVanguard = true;
|
||||
continue;
|
||||
}
|
||||
if (inRearguard) {
|
||||
if (line.startsWith("# End of rearguard")) {
|
||||
inRearguard = false;
|
||||
continue;
|
||||
} else {
|
||||
if (line.startsWith("#\t")) {
|
||||
line = line.substring(1); // omit #
|
||||
}
|
||||
}
|
||||
}
|
||||
if (line.isBlank() || line.matches("^[ \t]*#.*")) {
|
||||
// ignore blank/comment lines
|
||||
continue;
|
||||
}
|
||||
// remove comments in-line
|
||||
line = line.replaceAll("[ \t]*#.*", "");
|
||||
|
||||
// Zone line
|
||||
if (line.startsWith("Zone")) {
|
||||
if (zone != null) {
|
||||
tzdbShortNamesMap.put(zone, format + NBSP + rule);
|
||||
}
|
||||
var zl = line.split("[ \t]+", -1);
|
||||
zone = zl[1];
|
||||
rule = zl[3];
|
||||
format = zl[4];
|
||||
} else {
|
||||
if (zone != null) {
|
||||
if (line.isBlank()) {
|
||||
if (line.startsWith("Rule") ||
|
||||
line.startsWith("Link")) {
|
||||
tzdbShortNamesMap.put(zone, format + NBSP + rule);
|
||||
zone = null;
|
||||
rule = null;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2023, 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
|
||||
@@ -32,6 +32,7 @@ import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
@@ -339,9 +340,15 @@ public class GenerateCurrencyData {
|
||||
validCurrencyCodes.substring(i * 7 + 3, i * 7 + 6));
|
||||
checkCurrencyCode(currencyCode);
|
||||
int tableEntry = mainTable[(currencyCode.charAt(0) - 'A') * A_TO_Z + (currencyCode.charAt(1) - 'A')];
|
||||
if (tableEntry == INVALID_COUNTRY_ENTRY ||
|
||||
(tableEntry & SPECIAL_CASE_COUNTRY_MASK) != 0 ||
|
||||
(tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) != (currencyCode.charAt(2) - 'A')) {
|
||||
|
||||
// Do not allow a future currency to be classified as an otherCurrency,
|
||||
// otherwise it will leak out into Currency:getAvailableCurrencies
|
||||
boolean futureCurrency = Arrays.asList(specialCaseNewCurrencies).contains(currencyCode);
|
||||
boolean simpleCurrency = (tableEntry & SIMPLE_CASE_COUNTRY_FINAL_CHAR_MASK) == (currencyCode.charAt(2) - 'A');
|
||||
|
||||
// If neither a simple currency, or one defined in the future
|
||||
// then the current currency is applicable to be added to the otherTable
|
||||
if (!futureCurrency && !simpleCurrency) {
|
||||
if (otherCurrenciesCount == maxOtherCurrencies) {
|
||||
throw new RuntimeException("too many other currencies");
|
||||
}
|
||||
|
||||
@@ -245,7 +245,7 @@ ifeq ($(call isTargetOs, linux)+$(call isTargetCpu, x86_64)+$(INCLUDE_COMPILER2)
|
||||
TOOLCHAIN := TOOLCHAIN_LINK_CXX, \
|
||||
OPTIMIZATION := HIGH, \
|
||||
CFLAGS := $(CFLAGS_JDKLIB), \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB) -std=c++17, \
|
||||
CXXFLAGS := $(CXXFLAGS_JDKLIB), \
|
||||
LDFLAGS := $(LDFLAGS_JDKLIB) \
|
||||
$(call SET_SHARED_LIBRARY_ORIGIN), \
|
||||
LIBS := $(LIBCXX), \
|
||||
|
||||
@@ -53,10 +53,11 @@ JMH_UNPACKED_DIR := $(MICROBENCHMARK_OUTPUT)/jmh_jars
|
||||
JMH_UNPACKED_JARS_DONE := $(JMH_UNPACKED_DIR)/_unpacked.marker
|
||||
|
||||
# External dependencies
|
||||
WHITEBOX_JAR := $(SUPPORT_OUTPUTDIR)/test/lib/wb.jar
|
||||
JMH_COMPILE_JARS := $(JMH_CORE_JAR) $(JMH_GENERATOR_JAR) $(WHITEBOX_JAR)
|
||||
JMH_COMPILE_JARS := $(JMH_CORE_JAR) $(JMH_GENERATOR_JAR)
|
||||
JMH_RUNTIME_JARS := $(JMH_CORE_JAR) $(JMH_COMMONS_MATH_JAR) $(JMH_JOPT_SIMPLE_JAR)
|
||||
|
||||
MICROBENCHMARK_CLASSPATH := $(call PathList, $(JMH_COMPILE_JARS))
|
||||
|
||||
# Native dependencies
|
||||
MICROBENCHMARK_NATIVE_SRC_DIRS := $(MICROBENCHMARK_SRC)
|
||||
MICROBENCHMARK_NATIVE_OUTPUT := $(MICROBENCHMARK_OUTPUT)/native
|
||||
@@ -91,28 +92,24 @@ $(eval $(call SetupJavaCompilation, BUILD_INDIFY, \
|
||||
$(eval $(call SetupJavaCompilation, BUILD_JDK_MICROBENCHMARK, \
|
||||
TARGET_RELEASE := $(TARGET_RELEASE_NEWJDK_UPGRADED), \
|
||||
SMALL_JAVA := false, \
|
||||
CLASSPATH := $(JMH_COMPILE_JARS), \
|
||||
DISABLED_WARNINGS := restricted this-escape processing rawtypes cast \
|
||||
serial preview, \
|
||||
CLASSPATH := $(MICROBENCHMARK_CLASSPATH), \
|
||||
DISABLED_WARNINGS := restricted this-escape processing rawtypes cast serial preview, \
|
||||
SRC := $(MICROBENCHMARK_SRC), \
|
||||
BIN := $(MICROBENCHMARK_CLASSES), \
|
||||
JAVAC_FLAGS := \
|
||||
JAVAC_FLAGS := --add-exports java.base/sun.security.util=ALL-UNNAMED \
|
||||
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.classfile.impl=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.event=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.foreign=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.misc=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.org.objectweb.asm.tree=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED \
|
||||
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
|
||||
--add-exports java.base/sun.invoke.util=ALL-UNNAMED \
|
||||
--add-exports java.base/sun.security.util=ALL-UNNAMED \
|
||||
--enable-preview \
|
||||
-processor org.openjdk.jmh.generators.BenchmarkProcessor, \
|
||||
JAVA_FLAGS := \
|
||||
JAVA_FLAGS := --add-modules jdk.unsupported --limit-modules java.management \
|
||||
--add-exports java.base/jdk.internal.vm=ALL-UNNAMED \
|
||||
--add-modules jdk.unsupported \
|
||||
--enable-preview \
|
||||
--limit-modules java.management, \
|
||||
--enable-preview, \
|
||||
))
|
||||
|
||||
$(BUILD_JDK_MICROBENCHMARK): $(JMH_COMPILE_JARS)
|
||||
|
||||
@@ -23,22 +23,12 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
################################################################################
|
||||
# This file builds the Java components of testlib.
|
||||
# It also covers the test-image part, where the built files are copied to the
|
||||
# test image.
|
||||
################################################################################
|
||||
|
||||
default: all
|
||||
|
||||
include $(SPEC)
|
||||
include MakeBase.gmk
|
||||
include JavaCompilation.gmk
|
||||
|
||||
################################################################################
|
||||
# Targets for building the test lib jars
|
||||
################################################################################
|
||||
|
||||
TARGETS :=
|
||||
|
||||
TEST_LIB_SOURCE_DIR := $(TOPDIR)/test/lib
|
||||
@@ -73,21 +63,8 @@ $(eval $(call SetupJavaCompilation, BUILD_TEST_LIB_JAR, \
|
||||
|
||||
TARGETS += $(BUILD_TEST_LIB_JAR)
|
||||
|
||||
build-test-lib: $(TARGETS)
|
||||
##########################################################################################
|
||||
|
||||
################################################################################
|
||||
# Targets for building test-image.
|
||||
################################################################################
|
||||
all: $(TARGETS)
|
||||
|
||||
# Copy the jars to the test image.
|
||||
$(eval $(call SetupCopyFiles, COPY_LIBTEST_JARS, \
|
||||
DEST := $(TEST_IMAGE_DIR)/lib-test, \
|
||||
FILES := $(BUILD_WB_JAR_JAR) $(BUILD_TEST_LIB_JAR_JAR), \
|
||||
))
|
||||
#
|
||||
|
||||
test-image-lib: $(COPY_LIBTEST_JARS)
|
||||
|
||||
all: build-test-lib
|
||||
|
||||
.PHONY: default all build-test-lib test-image-lib
|
||||
.PHONY: default all
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@@ -282,7 +282,8 @@ void LIR_Assembler::osr_entry() {
|
||||
__ bind(L);
|
||||
}
|
||||
#endif
|
||||
__ ldp(r19, r20, Address(OSR_buf, slot_offset));
|
||||
__ ldr(r19, Address(OSR_buf, slot_offset));
|
||||
__ ldr(r20, Address(OSR_buf, slot_offset + BytesPerWord));
|
||||
__ str(r19, frame_map()->address_for_monitor_lock(i));
|
||||
__ str(r20, frame_map()->address_for_monitor_object(i));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 2023, Red Hat, Inc. All rights reserved.
|
||||
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2024, 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
|
||||
@@ -58,7 +58,7 @@ static char* reserve_at_eor_compatible_address(size_t size, bool aslr) {
|
||||
0x7ffc, 0x7ffe, 0x7fff
|
||||
};
|
||||
static constexpr int num_immediates = sizeof(immediates) / sizeof(immediates[0]);
|
||||
const int start_index = aslr ? os::random() : 0;
|
||||
const int start_index = aslr ? os::next_random((int)os::javaTimeNanos()) : 0;
|
||||
constexpr int max_tries = 64;
|
||||
for (int ntry = 0; result == nullptr && ntry < max_tries; ntry ++) {
|
||||
// As in os::attempt_reserve_memory_between, we alternate between higher and lower
|
||||
|
||||
@@ -193,9 +193,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Is SIMD sort supported for this CPU?
|
||||
static bool supports_simd_sort(BasicType bt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // CPU_AARCH64_MATCHER_AARCH64_HPP
|
||||
|
||||
@@ -310,7 +310,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
|
||||
uint int_args = 0;
|
||||
uint fp_args = 0;
|
||||
uint stk_args = 0; // inc by 2 each time
|
||||
uint stk_args = 0;
|
||||
|
||||
for (int i = 0; i < total_args_passed; i++) {
|
||||
switch (sig_bt[i]) {
|
||||
@@ -322,8 +322,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (int_args < Argument::n_int_register_parameters_j) {
|
||||
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set1(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
stk_args += 1;
|
||||
}
|
||||
break;
|
||||
case T_VOID:
|
||||
@@ -340,6 +341,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (int_args < Argument::n_int_register_parameters_j) {
|
||||
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set2(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
}
|
||||
@@ -348,8 +350,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (fp_args < Argument::n_float_register_parameters_j) {
|
||||
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set1(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
stk_args += 1;
|
||||
}
|
||||
break;
|
||||
case T_DOUBLE:
|
||||
@@ -357,6 +360,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (fp_args < Argument::n_float_register_parameters_j) {
|
||||
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set2(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
}
|
||||
@@ -367,7 +371,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
}
|
||||
}
|
||||
|
||||
return align_up(stk_args, 2);
|
||||
return stk_args;
|
||||
}
|
||||
|
||||
// Patch the callers callsite with entry to compiled code if it exists.
|
||||
|
||||
@@ -186,9 +186,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Is SIMD sort supported for this CPU?
|
||||
static bool supports_simd_sort(BasicType bt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // CPU_ARM_MATCHER_ARM_HPP
|
||||
|
||||
@@ -441,7 +441,6 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
}
|
||||
}
|
||||
|
||||
if (slot & 1) slot++;
|
||||
return slot;
|
||||
}
|
||||
|
||||
|
||||
@@ -195,9 +195,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Is SIMD sort supported for this CPU?
|
||||
static bool supports_simd_sort(BasicType bt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // CPU_PPC_MATCHER_PPC_HPP
|
||||
|
||||
@@ -734,7 +734,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
return align_up(stk, 2);
|
||||
return stk;
|
||||
}
|
||||
|
||||
#if defined(COMPILER1) || defined(COMPILER2)
|
||||
|
||||
@@ -1459,112 +1459,6 @@ void C2_MacroAssembler::string_equals(Register a1, Register a2,
|
||||
BLOCK_COMMENT("} string_equals");
|
||||
}
|
||||
|
||||
// jdk.internal.util.ArraysSupport.vectorizedHashCode
|
||||
void C2_MacroAssembler::arrays_hashcode(Register ary, Register cnt, Register result,
|
||||
Register tmp1, Register tmp2, Register tmp3,
|
||||
Register tmp4, Register tmp5, Register tmp6,
|
||||
BasicType eltype)
|
||||
{
|
||||
assert_different_registers(ary, cnt, result, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, t0, t1);
|
||||
|
||||
const int elsize = arrays_hashcode_elsize(eltype);
|
||||
const int chunks_end_shift = exact_log2(elsize);
|
||||
|
||||
switch (eltype) {
|
||||
case T_BOOLEAN: BLOCK_COMMENT("arrays_hashcode(unsigned byte) {"); break;
|
||||
case T_CHAR: BLOCK_COMMENT("arrays_hashcode(char) {"); break;
|
||||
case T_BYTE: BLOCK_COMMENT("arrays_hashcode(byte) {"); break;
|
||||
case T_SHORT: BLOCK_COMMENT("arrays_hashcode(short) {"); break;
|
||||
case T_INT: BLOCK_COMMENT("arrays_hashcode(int) {"); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
|
||||
const int stride = 4;
|
||||
const Register pow31_4 = tmp1;
|
||||
const Register pow31_3 = tmp2;
|
||||
const Register pow31_2 = tmp3;
|
||||
const Register chunks = tmp4;
|
||||
const Register chunks_end = chunks;
|
||||
|
||||
Label DONE, TAIL, TAIL_LOOP, WIDE_LOOP;
|
||||
|
||||
// result has a value initially
|
||||
|
||||
beqz(cnt, DONE);
|
||||
|
||||
andi(chunks, cnt, ~(stride-1));
|
||||
beqz(chunks, TAIL);
|
||||
|
||||
mv(pow31_4, 923521); // [31^^4]
|
||||
mv(pow31_3, 29791); // [31^^3]
|
||||
mv(pow31_2, 961); // [31^^2]
|
||||
|
||||
slli(chunks_end, chunks, chunks_end_shift);
|
||||
add(chunks_end, ary, chunks_end);
|
||||
andi(cnt, cnt, stride-1); // don't forget about tail!
|
||||
|
||||
bind(WIDE_LOOP);
|
||||
mulw(result, result, pow31_4); // 31^^4 * h
|
||||
arrays_hashcode_elload(t0, Address(ary, 0 * elsize), eltype);
|
||||
arrays_hashcode_elload(t1, Address(ary, 1 * elsize), eltype);
|
||||
arrays_hashcode_elload(tmp5, Address(ary, 2 * elsize), eltype);
|
||||
arrays_hashcode_elload(tmp6, Address(ary, 3 * elsize), eltype);
|
||||
mulw(t0, t0, pow31_3); // 31^^3 * ary[i+0]
|
||||
addw(result, result, t0);
|
||||
mulw(t1, t1, pow31_2); // 31^^2 * ary[i+1]
|
||||
addw(result, result, t1);
|
||||
slli(t0, tmp5, 5); // optimize 31^^1 * ary[i+2]
|
||||
subw(tmp5, t0, tmp5); // with ary[i+2]<<5 - ary[i+2]
|
||||
addw(result, result, tmp5);
|
||||
addw(result, result, tmp6); // 31^^4 * h + 31^^3 * ary[i+0] + 31^^2 * ary[i+1]
|
||||
// + 31^^1 * ary[i+2] + 31^^0 * ary[i+3]
|
||||
addi(ary, ary, elsize * stride);
|
||||
bne(ary, chunks_end, WIDE_LOOP);
|
||||
beqz(cnt, DONE);
|
||||
|
||||
bind(TAIL);
|
||||
slli(chunks_end, cnt, chunks_end_shift);
|
||||
add(chunks_end, ary, chunks_end);
|
||||
|
||||
bind(TAIL_LOOP);
|
||||
arrays_hashcode_elload(t0, Address(ary), eltype);
|
||||
slli(t1, result, 5); // optimize 31 * result
|
||||
subw(result, t1, result); // with result<<5 - result
|
||||
addw(result, result, t0);
|
||||
addi(ary, ary, elsize);
|
||||
bne(ary, chunks_end, TAIL_LOOP);
|
||||
|
||||
bind(DONE);
|
||||
BLOCK_COMMENT("} // arrays_hashcode");
|
||||
}
|
||||
|
||||
int C2_MacroAssembler::arrays_hashcode_elsize(BasicType eltype) {
|
||||
switch (eltype) {
|
||||
case T_BOOLEAN: return sizeof(jboolean);
|
||||
case T_BYTE: return sizeof(jbyte);
|
||||
case T_SHORT: return sizeof(jshort);
|
||||
case T_CHAR: return sizeof(jchar);
|
||||
case T_INT: return sizeof(jint);
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void C2_MacroAssembler::arrays_hashcode_elload(Register dst, Address src, BasicType eltype) {
|
||||
switch (eltype) {
|
||||
// T_BOOLEAN used as surrogate for unsigned byte
|
||||
case T_BOOLEAN: lbu(dst, src); break;
|
||||
case T_BYTE: lb(dst, src); break;
|
||||
case T_SHORT: lh(dst, src); break;
|
||||
case T_CHAR: lhu(dst, src); break;
|
||||
case T_INT: lw(dst, src); break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
typedef void (Assembler::*conditional_branch_insn)(Register op1, Register op2, Label& label, bool is_far);
|
||||
typedef void (MacroAssembler::*float_conditional_branch_insn)(FloatRegister op1, FloatRegister op2, Label& label,
|
||||
bool is_far, bool is_unordered);
|
||||
|
||||
@@ -82,15 +82,6 @@
|
||||
Register result, Register cnt1,
|
||||
int elem_size);
|
||||
|
||||
void arrays_hashcode(Register ary, Register cnt, Register result,
|
||||
Register tmp1, Register tmp2,
|
||||
Register tmp3, Register tmp4,
|
||||
Register tmp5, Register tmp6,
|
||||
BasicType eltype);
|
||||
// helper function for arrays_hashcode
|
||||
int arrays_hashcode_elsize(BasicType eltype);
|
||||
void arrays_hashcode_elload(Register dst, Address src, BasicType eltype);
|
||||
|
||||
void string_equals(Register r1, Register r2,
|
||||
Register result, Register cnt1,
|
||||
int elem_size);
|
||||
|
||||
@@ -2771,7 +2771,7 @@ void MacroAssembler::load_reserved(Register dst,
|
||||
break;
|
||||
case uint32:
|
||||
lr_w(dst, addr, acquire);
|
||||
zero_extend(t0, t0, 32);
|
||||
zero_extend(dst, dst, 32);
|
||||
break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
|
||||
@@ -192,9 +192,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Is SIMD sort supported for this CPU?
|
||||
static bool supports_simd_sort(BasicType bt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // CPU_RISCV_MATCHER_RISCV_HPP
|
||||
|
||||
@@ -10371,26 +10371,6 @@ instruct array_equalsC(iRegP_R11 ary1, iRegP_R12 ary2, iRegI_R10 result,
|
||||
ins_pipe(pipe_class_memory);
|
||||
%}
|
||||
|
||||
// fast ArraysSupport.vectorizedHashCode
|
||||
instruct arrays_hashcode(iRegP_R11 ary, iRegI_R12 cnt, iRegI_R10 result, immI basic_type,
|
||||
iRegLNoSp tmp1, iRegLNoSp tmp2,
|
||||
iRegLNoSp tmp3, iRegLNoSp tmp4,
|
||||
iRegLNoSp tmp5, iRegLNoSp tmp6, rFlagsReg cr)
|
||||
%{
|
||||
match(Set result (VectorizedHashCode (Binary ary cnt) (Binary result basic_type)));
|
||||
effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6,
|
||||
USE_KILL ary, USE_KILL cnt, USE basic_type, KILL cr);
|
||||
|
||||
format %{ "Array HashCode array[] $ary,$cnt,$result,$basic_type -> $result // KILL all" %}
|
||||
ins_encode %{
|
||||
__ arrays_hashcode($ary$$Register, $cnt$$Register, $result$$Register,
|
||||
$tmp1$$Register, $tmp2$$Register, $tmp3$$Register,
|
||||
$tmp4$$Register, $tmp5$$Register, $tmp6$$Register,
|
||||
(BasicType)$basic_type$$constant);
|
||||
%}
|
||||
ins_pipe(pipe_class_memory);
|
||||
%}
|
||||
|
||||
// ============================================================================
|
||||
// Safepoint Instructions
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
|
||||
uint int_args = 0;
|
||||
uint fp_args = 0;
|
||||
uint stk_args = 0; // inc by 2 each time
|
||||
uint stk_args = 0;
|
||||
|
||||
for (int i = 0; i < total_args_passed; i++) {
|
||||
switch (sig_bt[i]) {
|
||||
@@ -278,8 +278,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (int_args < Argument::n_int_register_parameters_j) {
|
||||
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set1(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
stk_args += 1;
|
||||
}
|
||||
break;
|
||||
case T_VOID:
|
||||
@@ -295,6 +296,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (int_args < Argument::n_int_register_parameters_j) {
|
||||
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set2(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
}
|
||||
@@ -303,8 +305,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (fp_args < Argument::n_float_register_parameters_j) {
|
||||
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set1(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
stk_args += 1;
|
||||
}
|
||||
break;
|
||||
case T_DOUBLE:
|
||||
@@ -312,6 +315,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (fp_args < Argument::n_float_register_parameters_j) {
|
||||
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set2(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
}
|
||||
@@ -321,7 +325,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
}
|
||||
}
|
||||
|
||||
return align_up(stk_args, 2);
|
||||
return stk_args;
|
||||
}
|
||||
|
||||
// Patch the callers callsite with entry to compiled code if it exists.
|
||||
|
||||
@@ -315,10 +315,6 @@ void VM_Version::c2_initialize() {
|
||||
}
|
||||
}
|
||||
|
||||
if (FLAG_IS_DEFAULT(UseVectorizedHashCodeIntrinsic)) {
|
||||
FLAG_SET_DEFAULT(UseVectorizedHashCodeIntrinsic, true);
|
||||
}
|
||||
|
||||
if (!UseZicbop) {
|
||||
if (!FLAG_IS_DEFAULT(AllocatePrefetchStyle)) {
|
||||
warning("Zicbop is not available on this CPU");
|
||||
|
||||
@@ -184,9 +184,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Is SIMD sort supported for this CPU?
|
||||
static bool supports_simd_sort(BasicType bt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#endif // CPU_S390_MATCHER_S390_HPP
|
||||
|
||||
@@ -755,7 +755,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
return align_up(stk, 2);
|
||||
return stk;
|
||||
}
|
||||
|
||||
int SharedRuntime::c_calling_convention(const BasicType *sig_bt,
|
||||
|
||||
@@ -1089,7 +1089,8 @@ void C2_MacroAssembler::vminmax_fp(int opcode, BasicType elem_bt,
|
||||
assert(opcode == Op_MinV || opcode == Op_MinReductionV ||
|
||||
opcode == Op_MaxV || opcode == Op_MaxReductionV, "sanity");
|
||||
assert(elem_bt == T_FLOAT || elem_bt == T_DOUBLE, "sanity");
|
||||
assert_different_registers(a, b, tmp, atmp, btmp);
|
||||
assert_different_registers(a, tmp, atmp, btmp);
|
||||
assert_different_registers(b, tmp, atmp, btmp);
|
||||
|
||||
bool is_min = (opcode == Op_MinV || opcode == Op_MinReductionV);
|
||||
bool is_double_word = is_double_word_type(elem_bt);
|
||||
@@ -1176,7 +1177,8 @@ void C2_MacroAssembler::evminmax_fp(int opcode, BasicType elem_bt,
|
||||
assert(opcode == Op_MinV || opcode == Op_MinReductionV ||
|
||||
opcode == Op_MaxV || opcode == Op_MaxReductionV, "sanity");
|
||||
assert(elem_bt == T_FLOAT || elem_bt == T_DOUBLE, "sanity");
|
||||
assert_different_registers(dst, a, b, atmp, btmp);
|
||||
assert_different_registers(dst, a, atmp, btmp);
|
||||
assert_different_registers(dst, b, atmp, btmp);
|
||||
|
||||
bool is_min = (opcode == Op_MinV || opcode == Op_MinReductionV);
|
||||
bool is_double_word = is_double_word_type(elem_bt);
|
||||
|
||||
@@ -1871,92 +1871,6 @@ void MacroAssembler::cmpoop(Register src1, jobject src2, Register rscratch) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void MacroAssembler::cvtss2sd(XMMRegister dst, XMMRegister src) {
|
||||
if ((UseAVX > 0) && (dst != src)) {
|
||||
xorpd(dst, dst);
|
||||
}
|
||||
Assembler::cvtss2sd(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtss2sd(XMMRegister dst, Address src) {
|
||||
if (UseAVX > 0) {
|
||||
xorpd(dst, dst);
|
||||
}
|
||||
Assembler::cvtss2sd(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsd2ss(XMMRegister dst, XMMRegister src) {
|
||||
if ((UseAVX > 0) && (dst != src)) {
|
||||
xorps(dst, dst);
|
||||
}
|
||||
Assembler::cvtsd2ss(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsd2ss(XMMRegister dst, Address src) {
|
||||
if (UseAVX > 0) {
|
||||
xorps(dst, dst);
|
||||
}
|
||||
Assembler::cvtsd2ss(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsi2sdl(XMMRegister dst, Register src) {
|
||||
if (UseAVX > 0) {
|
||||
xorpd(dst, dst);
|
||||
}
|
||||
Assembler::cvtsi2sdl(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsi2sdl(XMMRegister dst, Address src) {
|
||||
if (UseAVX > 0) {
|
||||
xorpd(dst, dst);
|
||||
}
|
||||
Assembler::cvtsi2sdl(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsi2ssl(XMMRegister dst, Register src) {
|
||||
if (UseAVX > 0) {
|
||||
xorps(dst, dst);
|
||||
}
|
||||
Assembler::cvtsi2ssl(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsi2ssl(XMMRegister dst, Address src) {
|
||||
if (UseAVX > 0) {
|
||||
xorps(dst, dst);
|
||||
}
|
||||
Assembler::cvtsi2ssl(dst, src);
|
||||
}
|
||||
|
||||
#ifdef _LP64
|
||||
void MacroAssembler::cvtsi2sdq(XMMRegister dst, Register src) {
|
||||
if (UseAVX > 0) {
|
||||
xorpd(dst, dst);
|
||||
}
|
||||
Assembler::cvtsi2sdq(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsi2sdq(XMMRegister dst, Address src) {
|
||||
if (UseAVX > 0) {
|
||||
xorpd(dst, dst);
|
||||
}
|
||||
Assembler::cvtsi2sdq(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsi2ssq(XMMRegister dst, Register src) {
|
||||
if (UseAVX > 0) {
|
||||
xorps(dst, dst);
|
||||
}
|
||||
Assembler::cvtsi2ssq(dst, src);
|
||||
}
|
||||
|
||||
void MacroAssembler::cvtsi2ssq(XMMRegister dst, Address src) {
|
||||
if (UseAVX > 0) {
|
||||
xorps(dst, dst);
|
||||
}
|
||||
Assembler::cvtsi2ssq(dst, src);
|
||||
}
|
||||
#endif // _LP64
|
||||
|
||||
void MacroAssembler::locked_cmpxchgptr(Register reg, AddressLiteral adr, Register rscratch) {
|
||||
assert(rscratch != noreg || always_reachable(adr), "missing");
|
||||
|
||||
|
||||
@@ -800,23 +800,6 @@ public:
|
||||
|
||||
void cmpxchgptr(Register reg, Address adr);
|
||||
|
||||
|
||||
// cvt instructions
|
||||
void cvtss2sd(XMMRegister dst, XMMRegister src);
|
||||
void cvtss2sd(XMMRegister dst, Address src);
|
||||
void cvtsd2ss(XMMRegister dst, XMMRegister src);
|
||||
void cvtsd2ss(XMMRegister dst, Address src);
|
||||
void cvtsi2sdl(XMMRegister dst, Register src);
|
||||
void cvtsi2sdl(XMMRegister dst, Address src);
|
||||
void cvtsi2ssl(XMMRegister dst, Register src);
|
||||
void cvtsi2ssl(XMMRegister dst, Address src);
|
||||
#ifdef _LP64
|
||||
void cvtsi2sdq(XMMRegister dst, Register src);
|
||||
void cvtsi2sdq(XMMRegister dst, Address src);
|
||||
void cvtsi2ssq(XMMRegister dst, Register src);
|
||||
void cvtsi2ssq(XMMRegister dst, Address src);
|
||||
#endif
|
||||
|
||||
void locked_cmpxchgptr(Register reg, AddressLiteral adr, Register rscratch = noreg);
|
||||
|
||||
void imulptr(Register dst, Register src) { LP64_ONLY(imulq(dst, src)) NOT_LP64(imull(dst, src)); }
|
||||
|
||||
@@ -248,17 +248,4 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Is SIMD sort supported for this CPU?
|
||||
static bool supports_simd_sort(BasicType bt) {
|
||||
if (VM_Version::supports_avx512dq()) {
|
||||
return true;
|
||||
}
|
||||
else if (VM_Version::supports_avx2() && !is_double_word_type(bt)) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // CPU_X86_MATCHER_X86_HPP
|
||||
|
||||
@@ -528,8 +528,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
}
|
||||
}
|
||||
|
||||
// return value can be odd number of VMRegImpl stack slots make multiple of 2
|
||||
return align_up(stack, 2);
|
||||
return stack;
|
||||
}
|
||||
|
||||
// Patch the callers callsite with entry to compiled code if it exists.
|
||||
|
||||
@@ -498,7 +498,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
|
||||
uint int_args = 0;
|
||||
uint fp_args = 0;
|
||||
uint stk_args = 0; // inc by 2 each time
|
||||
uint stk_args = 0;
|
||||
|
||||
for (int i = 0; i < total_args_passed; i++) {
|
||||
switch (sig_bt[i]) {
|
||||
@@ -510,8 +510,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (int_args < Argument::n_int_register_parameters_j) {
|
||||
regs[i].set1(INT_ArgReg[int_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set1(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
stk_args += 1;
|
||||
}
|
||||
break;
|
||||
case T_VOID:
|
||||
@@ -528,6 +529,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (int_args < Argument::n_int_register_parameters_j) {
|
||||
regs[i].set2(INT_ArgReg[int_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set2(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
}
|
||||
@@ -536,8 +538,9 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (fp_args < Argument::n_float_register_parameters_j) {
|
||||
regs[i].set1(FP_ArgReg[fp_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set1(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
stk_args += 1;
|
||||
}
|
||||
break;
|
||||
case T_DOUBLE:
|
||||
@@ -545,6 +548,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
if (fp_args < Argument::n_float_register_parameters_j) {
|
||||
regs[i].set2(FP_ArgReg[fp_args++]->as_VMReg());
|
||||
} else {
|
||||
stk_args = align_up(stk_args, 2);
|
||||
regs[i].set2(VMRegImpl::stack2reg(stk_args));
|
||||
stk_args += 2;
|
||||
}
|
||||
@@ -555,7 +559,7 @@ int SharedRuntime::java_calling_convention(const BasicType *sig_bt,
|
||||
}
|
||||
}
|
||||
|
||||
return align_up(stk_args, 2);
|
||||
return stk_args;
|
||||
}
|
||||
|
||||
// Patch the callers callsite with entry to compiled code if it exists.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2024, 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
|
||||
@@ -2318,7 +2318,7 @@ address StubGenerator::generate_base64_decodeBlock() {
|
||||
const Register isURL = c_rarg5;// Base64 or URL character set
|
||||
__ movl(isMIME, Address(rbp, 2 * wordSize));
|
||||
#else
|
||||
const Address dp_mem(rbp, 6 * wordSize); // length is on stack on Win64
|
||||
const Address dp_mem(rbp, 6 * wordSize); // length is on stack on Win64
|
||||
const Address isURL_mem(rbp, 7 * wordSize);
|
||||
const Register isURL = r10; // pick the volatile windows register
|
||||
const Register dp = r12;
|
||||
@@ -2540,10 +2540,12 @@ address StubGenerator::generate_base64_decodeBlock() {
|
||||
// output_size in r13
|
||||
|
||||
// Strip pad characters, if any, and adjust length and mask
|
||||
__ addq(length, start_offset);
|
||||
__ cmpb(Address(source, length, Address::times_1, -1), '=');
|
||||
__ jcc(Assembler::equal, L_padding);
|
||||
|
||||
__ BIND(L_donePadding);
|
||||
__ subq(length, start_offset);
|
||||
|
||||
// Output size is (64 - output_size), output mask is (all 1s >> output_size).
|
||||
__ kmovql(input_mask, rax);
|
||||
@@ -4193,23 +4195,22 @@ void StubGenerator::generate_compiler_stubs() {
|
||||
= CAST_FROM_FN_PTR(address, SharedRuntime::montgomery_square);
|
||||
}
|
||||
|
||||
// Load x86_64_sort library on supported hardware to enable SIMD sort and partition intrinsics
|
||||
|
||||
if (VM_Version::is_intel() && (VM_Version::supports_avx512dq() || VM_Version::supports_avx2())) {
|
||||
// Load x86_64_sort library on supported hardware to enable avx512 sort and partition intrinsics
|
||||
if (VM_Version::is_intel() && VM_Version::supports_avx512dq()) {
|
||||
void *libsimdsort = nullptr;
|
||||
char ebuf_[1024];
|
||||
char dll_name_simd_sort[JVM_MAXPATHLEN];
|
||||
if (os::dll_locate_lib(dll_name_simd_sort, sizeof(dll_name_simd_sort), Arguments::get_dll_dir(), "simdsort")) {
|
||||
libsimdsort = os::dll_load(dll_name_simd_sort, ebuf_, sizeof ebuf_);
|
||||
}
|
||||
// Get addresses for SIMD sort and partition routines
|
||||
// Get addresses for avx512 sort and partition routines
|
||||
if (libsimdsort != nullptr) {
|
||||
log_info(library)("Loaded library %s, handle " INTPTR_FORMAT, JNI_LIB_PREFIX "simdsort" JNI_LIB_SUFFIX, p2i(libsimdsort));
|
||||
|
||||
snprintf(ebuf_, sizeof(ebuf_), VM_Version::supports_avx512dq() ? "avx512_sort" : "avx2_sort");
|
||||
snprintf(ebuf_, sizeof(ebuf_), "avx512_sort");
|
||||
StubRoutines::_array_sort = (address)os::dll_lookup(libsimdsort, ebuf_);
|
||||
|
||||
snprintf(ebuf_, sizeof(ebuf_), VM_Version::supports_avx512dq() ? "avx512_partition" : "avx2_partition");
|
||||
snprintf(ebuf_, sizeof(ebuf_), "avx512_partition");
|
||||
StubRoutines::_array_partition = (address)os::dll_lookup(libsimdsort, ebuf_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -858,7 +858,7 @@ void VM_Version::get_processor_features() {
|
||||
|
||||
// Check if processor has Intel Ecore
|
||||
if (FLAG_IS_DEFAULT(EnableX86ECoreOpts) && is_intel() && cpu_family() == 6 &&
|
||||
(_model == 0x97 || _model == 0xAA || _model == 0xAC || _model == 0xAF)) {
|
||||
(_model == 0x97 || _model == 0xAC || _model == 0xAF)) {
|
||||
FLAG_SET_DEFAULT(EnableX86ECoreOpts, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -10095,7 +10095,7 @@ instruct cmpD_imm(rRegI dst, regD src, immD con, rFlagsReg cr) %{
|
||||
instruct convF2D_reg_reg(regD dst, regF src)
|
||||
%{
|
||||
match(Set dst (ConvF2D src));
|
||||
effect(TEMP dst);
|
||||
|
||||
format %{ "cvtss2sd $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ cvtss2sd ($dst$$XMMRegister, $src$$XMMRegister);
|
||||
@@ -10117,7 +10117,7 @@ instruct convF2D_reg_mem(regD dst, memory src)
|
||||
instruct convD2F_reg_reg(regF dst, regD src)
|
||||
%{
|
||||
match(Set dst (ConvD2F src));
|
||||
effect(TEMP dst);
|
||||
|
||||
format %{ "cvtsd2ss $dst, $src" %}
|
||||
ins_encode %{
|
||||
__ cvtsd2ss ($dst$$XMMRegister, $src$$XMMRegister);
|
||||
|
||||
@@ -72,7 +72,7 @@ CallingConvention* FrameMap::java_calling_convention(const BasicTypeArray* signa
|
||||
}
|
||||
}
|
||||
|
||||
intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
|
||||
intptr_t out_preserve = align_up(SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs), 2);
|
||||
LIR_OprList* args = new LIR_OprList(signature->length());
|
||||
for (i = 0; i < sizeargs;) {
|
||||
BasicType t = sig_bt[i];
|
||||
|
||||
@@ -421,8 +421,11 @@ void RangeCheckEliminator::add_access_indexed_info(InstructionList &indices, int
|
||||
aii->_max = idx;
|
||||
aii->_list = new AccessIndexedList();
|
||||
} else if (idx >= aii->_min && idx <= aii->_max) {
|
||||
remove_range_check(ai);
|
||||
return;
|
||||
// Guard against underflow/overflow (see 'range_cond' check in RangeCheckEliminator::in_block_motion)
|
||||
if (aii->_max < 0 || (aii->_max + min_jint) <= aii->_min) {
|
||||
remove_range_check(ai);
|
||||
return;
|
||||
}
|
||||
}
|
||||
aii->_min = MIN2(aii->_min, idx);
|
||||
aii->_max = MAX2(aii->_max, idx);
|
||||
@@ -465,9 +468,9 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int last_integer = 0;
|
||||
jint last_integer = 0;
|
||||
Instruction *last_instruction = index;
|
||||
int base = 0;
|
||||
jint base = 0;
|
||||
ArithmeticOp *ao = index->as_ArithmeticOp();
|
||||
|
||||
while (ao != nullptr && (ao->x()->as_Constant() || ao->y()->as_Constant()) && (ao->op() == Bytecodes::_iadd || ao->op() == Bytecodes::_isub)) {
|
||||
@@ -479,12 +482,12 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList
|
||||
}
|
||||
|
||||
if (c) {
|
||||
int value = c->type()->as_IntConstant()->value();
|
||||
jint value = c->type()->as_IntConstant()->value();
|
||||
if (value != min_jint) {
|
||||
if (ao->op() == Bytecodes::_isub) {
|
||||
value = -value;
|
||||
}
|
||||
base += value;
|
||||
base = java_add(base, value);
|
||||
last_integer = base;
|
||||
last_instruction = other;
|
||||
}
|
||||
@@ -506,12 +509,12 @@ void RangeCheckEliminator::in_block_motion(BlockBegin *block, AccessIndexedList
|
||||
assert(info != nullptr, "Info must not be null");
|
||||
|
||||
// if idx < 0, max > 0, max + idx may fall between 0 and
|
||||
// length-1 and if min < 0, min + idx may overflow and be >=
|
||||
// length-1 and if min < 0, min + idx may underflow/overflow and be >=
|
||||
// 0. The predicate wouldn't trigger but some accesses could
|
||||
// be with a negative index. This test guarantees that for the
|
||||
// min and max value that are kept the predicate can't let
|
||||
// some incorrect accesses happen.
|
||||
bool range_cond = (info->_max < 0 || info->_max + min_jint <= info->_min);
|
||||
bool range_cond = (info->_max < 0 || (info->_max + min_jint) <= info->_min);
|
||||
|
||||
// Generate code only if more than 2 range checks can be eliminated because of that.
|
||||
// 2 because at least 2 comparisons are done
|
||||
@@ -859,7 +862,7 @@ void RangeCheckEliminator::process_access_indexed(BlockBegin *loop_header, Block
|
||||
);
|
||||
|
||||
remove_range_check(ai);
|
||||
} else if (_optimistic && loop_header) {
|
||||
} else if (false && _optimistic && loop_header) {
|
||||
assert(ai->array(), "Array must not be null!");
|
||||
assert(ai->index(), "Index must not be null!");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2023, 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
|
||||
@@ -275,9 +275,11 @@
|
||||
develop(bool, InstallMethods, true, \
|
||||
"Install methods at the end of successful compilations") \
|
||||
\
|
||||
/* The compiler assumes, in many places, that methods are at most 1MB. */ \
|
||||
/* Therefore, we restrict this flag to at most 1MB. */ \
|
||||
develop(intx, NMethodSizeLimit, (64*K)*wordSize, \
|
||||
"Maximum size of a compiled method.") \
|
||||
range(0, max_jint) \
|
||||
range(0, 1*M) \
|
||||
\
|
||||
develop(bool, TraceFPUStack, false, \
|
||||
"Trace emulation of the FPU stack (intel only)") \
|
||||
|
||||
@@ -129,23 +129,7 @@ CDSHeapVerifier::CDSHeapVerifier() : _archived_objs(0), _problems(0)
|
||||
// This just points to an empty Map
|
||||
ADD_EXCL("jdk/internal/reflect/Reflection", "methodFilterMap"); // E
|
||||
ADD_EXCL("jdk/internal/util/StaticProperty", "FILE_ENCODING", // C
|
||||
"JAVA_LOCALE_USE_OLD_ISO_CODES", // C
|
||||
"USER_LANGUAGE", // C
|
||||
"USER_LANGUAGE_DISPLAY", // C
|
||||
"USER_LANGUAGE_FORMAT", // C
|
||||
"USER_SCRIPT", // C
|
||||
"USER_SCRIPT_DISPLAY", // C
|
||||
"USER_SCRIPT_FORMAT", // C
|
||||
"USER_COUNTRY", // C
|
||||
"USER_COUNTRY_DISPLAY", // C
|
||||
"USER_COUNTRY_FORMAT", // C
|
||||
"USER_VARIANT", // C
|
||||
"USER_VARIANT_DISPLAY", // C
|
||||
"USER_VARIANT_FORMAT", // C
|
||||
"USER_EXTENSIONS", // C
|
||||
"USER_EXTENSIONS_DISPLAY", // C
|
||||
"USER_EXTENSIONS_FORMAT", // C
|
||||
"USER_REGION"); // C
|
||||
"JAVA_LOCALE_USE_OLD_ISO_CODES"); // C
|
||||
|
||||
// Integer for 0 and 1 are in java/lang/Integer$IntegerCache and are archived
|
||||
ADD_EXCL("sun/invoke/util/ValueConversions", "ONE_INT", // E
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2024, 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
|
||||
@@ -576,12 +576,14 @@ int FileMapInfo::get_module_shared_path_index(Symbol* location) {
|
||||
const char* file = ClassLoader::skip_uri_protocol(location->as_C_string());
|
||||
for (int i = ClassLoaderExt::app_module_paths_start_index(); i < get_number_of_shared_paths(); i++) {
|
||||
SharedClassPathEntry* ent = shared_path(i);
|
||||
assert(ent->in_named_module(), "must be");
|
||||
bool cond = strcmp(file, ent->name()) == 0;
|
||||
log_debug(class, path)("get_module_shared_path_index (%d) %s : %s = %s", i,
|
||||
location->as_C_string(), ent->name(), cond ? "same" : "different");
|
||||
if (cond) {
|
||||
return i;
|
||||
if (!ent->is_non_existent()) {
|
||||
assert(ent->in_named_module(), "must be");
|
||||
bool cond = strcmp(file, ent->name()) == 0;
|
||||
log_debug(class, path)("get_module_shared_path_index (%d) %s : %s = %s", i,
|
||||
location->as_C_string(), ent->name(), cond ? "same" : "different");
|
||||
if (cond) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1465,7 +1467,7 @@ BitMapView FileMapRegion::ptrmap_view() {
|
||||
return bitmap_view(false);
|
||||
}
|
||||
|
||||
bool FileMapRegion::check_region_crc(char* base) const {
|
||||
bool FileMapRegion::check_region_crc() const {
|
||||
// This function should be called after the region has been properly
|
||||
// loaded into memory via FileMapInfo::map_region() or FileMapInfo::read_region().
|
||||
// I.e., this->mapped_base() must be valid.
|
||||
@@ -1474,8 +1476,8 @@ bool FileMapRegion::check_region_crc(char* base) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
assert(base != nullptr, "must be initialized");
|
||||
int crc = ClassLoader::crc32(0, base, (jint)sz);
|
||||
assert(mapped_base() != nullptr, "must be initialized");
|
||||
int crc = ClassLoader::crc32(0, mapped_base(), (jint)sz);
|
||||
if (crc != this->crc()) {
|
||||
log_warning(cds)("Checksum verification failed.");
|
||||
return false;
|
||||
@@ -1760,13 +1762,13 @@ bool FileMapInfo::read_region(int i, char* base, size_t size, bool do_commit) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (VerifySharedSpaces && !r->check_region_crc(base)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
r->set_mapped_from_file(false);
|
||||
r->set_mapped_base(base);
|
||||
|
||||
if (VerifySharedSpaces && !r->check_region_crc()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1803,7 +1805,6 @@ MapArchiveResult FileMapInfo::map_region(int i, intx addr_delta, char* mapped_ba
|
||||
return MAP_ARCHIVE_OTHER_FAILURE; // oom or I/O error.
|
||||
} else {
|
||||
assert(r->mapped_base() != nullptr, "must be initialized");
|
||||
return MAP_ARCHIVE_SUCCESS;
|
||||
}
|
||||
} else {
|
||||
// Note that this may either be a "fresh" mapping into unreserved address
|
||||
@@ -1818,16 +1819,15 @@ MapArchiveResult FileMapInfo::map_region(int i, intx addr_delta, char* mapped_ba
|
||||
_memory_mapping_failed = true;
|
||||
return MAP_ARCHIVE_MMAP_FAILURE;
|
||||
}
|
||||
|
||||
if (VerifySharedSpaces && !r->check_region_crc(requested_addr)) {
|
||||
return MAP_ARCHIVE_OTHER_FAILURE;
|
||||
}
|
||||
|
||||
r->set_mapped_from_file(true);
|
||||
r->set_mapped_base(requested_addr);
|
||||
|
||||
return MAP_ARCHIVE_SUCCESS;
|
||||
}
|
||||
|
||||
if (VerifySharedSpaces && !r->check_region_crc()) {
|
||||
return MAP_ARCHIVE_OTHER_FAILURE;
|
||||
}
|
||||
|
||||
return MAP_ARCHIVE_SUCCESS;
|
||||
}
|
||||
|
||||
// The return value is the location of the archive relocation bitmap.
|
||||
@@ -1845,7 +1845,8 @@ char* FileMapInfo::map_bitmap_region() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (VerifySharedSpaces && !r->check_region_crc(bitmap_base)) {
|
||||
r->set_mapped_base(bitmap_base);
|
||||
if (VerifySharedSpaces && !r->check_region_crc()) {
|
||||
log_error(cds)("relocation bitmap CRC error");
|
||||
if (!os::unmap_memory(bitmap_base, r->used_aligned())) {
|
||||
fatal("os::unmap_memory of relocation bitmap failed");
|
||||
@@ -1854,7 +1855,6 @@ char* FileMapInfo::map_bitmap_region() {
|
||||
}
|
||||
|
||||
r->set_mapped_from_file(true);
|
||||
r->set_mapped_base(bitmap_base);
|
||||
log_info(cds)("Mapped %s region #%d at base " INTPTR_FORMAT " top " INTPTR_FORMAT " (%s)",
|
||||
is_static() ? "static " : "dynamic",
|
||||
MetaspaceShared::bm, p2i(r->mapped_base()), p2i(r->mapped_end()),
|
||||
@@ -2130,14 +2130,13 @@ bool FileMapInfo::map_heap_region_impl() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (VerifySharedSpaces && !r->check_region_crc(base)) {
|
||||
r->set_mapped_base(base);
|
||||
if (VerifySharedSpaces && !r->check_region_crc()) {
|
||||
dealloc_heap_region();
|
||||
log_info(cds)("UseSharedSpaces: mapped heap region is corrupt");
|
||||
return false;
|
||||
}
|
||||
|
||||
r->set_mapped_base(base);
|
||||
|
||||
// If the requested range is different from the range allocated by GC, then
|
||||
// the pointers need to be patched.
|
||||
address mapped_start = (address) _mapped_heap_memregion.start();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2024, 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
|
||||
@@ -89,6 +89,7 @@ public:
|
||||
bool is_dir() const { return _type == dir_entry; }
|
||||
bool is_modules_image() const { return _type == modules_image_entry; }
|
||||
bool is_jar() const { return _type == jar_entry; }
|
||||
bool is_non_existent() const { return _type == non_existent_entry; }
|
||||
bool from_class_path_attr() { return _from_class_path_attr; }
|
||||
time_t timestamp() const { return _timestamp; }
|
||||
const char* name() const;
|
||||
@@ -170,7 +171,7 @@ public:
|
||||
BitMapView ptrmap_view();
|
||||
bool has_ptrmap() { return _ptrmap_size_in_bits != 0; }
|
||||
|
||||
bool check_region_crc(char* base) const;
|
||||
bool check_region_crc() const;
|
||||
void print(outputStream* st, int region_index);
|
||||
};
|
||||
|
||||
|
||||
@@ -149,8 +149,6 @@
|
||||
|
||||
#define JAVA_22_VERSION 66
|
||||
|
||||
#define JAVA_23_VERSION 67
|
||||
|
||||
void ClassFileParser::set_class_bad_constant_seen(short bad_constant) {
|
||||
assert((bad_constant == JVM_CONSTANT_Module ||
|
||||
bad_constant == JVM_CONSTANT_Package) && _major_version >= JAVA_9_VERSION,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2024, 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
|
||||
@@ -387,7 +387,7 @@ bool LoaderConstraintTable::add_entry(Symbol* class_name,
|
||||
} else if (pp1 == nullptr) {
|
||||
pp2->extend_loader_constraint(class_name, loader1, klass);
|
||||
} else if (pp2 == nullptr) {
|
||||
pp1->extend_loader_constraint(class_name, loader1, klass);
|
||||
pp1->extend_loader_constraint(class_name, loader2, klass);
|
||||
} else {
|
||||
merge_loader_constraints(class_name, pp1, pp2, klass);
|
||||
}
|
||||
|
||||
@@ -1111,14 +1111,13 @@ InstanceKlass* SystemDictionary::load_shared_lambda_proxy_class(InstanceKlass* i
|
||||
if (loaded_ik != nullptr) {
|
||||
assert(shared_nest_host->is_same_class_package(ik),
|
||||
"lambda proxy class and its nest host must be in the same package");
|
||||
// The lambda proxy class and its nest host have the same class loader and class loader data,
|
||||
// as verified in SystemDictionaryShared::add_lambda_proxy_class()
|
||||
assert(shared_nest_host->class_loader() == class_loader(), "mismatched class loader");
|
||||
assert(shared_nest_host->class_loader_data() == class_loader_data(class_loader), "mismatched class loader data");
|
||||
ik->set_nest_host(shared_nest_host);
|
||||
}
|
||||
|
||||
// The lambda proxy class and its nest host have the same class loader and class loader data,
|
||||
// as verified in SystemDictionaryShared::add_lambda_proxy_class()
|
||||
assert(shared_nest_host->class_loader() == class_loader(), "mismatched class loader");
|
||||
assert(shared_nest_host->class_loader_data() == class_loader_data(class_loader), "mismatched class loader data");
|
||||
ik->set_nest_host(shared_nest_host);
|
||||
|
||||
return loaded_ik;
|
||||
}
|
||||
|
||||
|
||||
@@ -2257,11 +2257,12 @@ void ClassVerifier::verify_switch(
|
||||
"low must be less than or equal to high in tableswitch");
|
||||
return;
|
||||
}
|
||||
keys = high - low + 1;
|
||||
if (keys < 0) {
|
||||
int64_t keys64 = ((int64_t)high - low) + 1;
|
||||
if (keys64 > 65535) { // Max code length
|
||||
verify_error(ErrorContext::bad_code(bci), "too many keys in tableswitch");
|
||||
return;
|
||||
}
|
||||
keys = (int)keys64;
|
||||
delta = 1;
|
||||
} else {
|
||||
keys = (int)Bytes::get_Java_u4(aligned_bcp + jintSize);
|
||||
|
||||
@@ -597,6 +597,7 @@ class methodHandle;
|
||||
do_intrinsic(_notifyJvmtiVThreadMount, java_lang_VirtualThread, notifyJvmtiMount_name, bool_void_signature, F_RN) \
|
||||
do_intrinsic(_notifyJvmtiVThreadUnmount, java_lang_VirtualThread, notifyJvmtiUnmount_name, bool_void_signature, F_RN) \
|
||||
do_intrinsic(_notifyJvmtiVThreadHideFrames, java_lang_VirtualThread, notifyJvmtiHideFrames_name, bool_void_signature, F_RN) \
|
||||
do_intrinsic(_notifyJvmtiVThreadDisableSuspend, java_lang_VirtualThread, notifyJvmtiDisableSuspend_name, bool_void_signature, F_RN) \
|
||||
\
|
||||
/* support for UnsafeConstants */ \
|
||||
do_class(jdk_internal_misc_UnsafeConstants, "jdk/internal/misc/UnsafeConstants") \
|
||||
|
||||
@@ -421,6 +421,7 @@ class SerializeClosure;
|
||||
template(notifyJvmtiMount_name, "notifyJvmtiMount") \
|
||||
template(notifyJvmtiUnmount_name, "notifyJvmtiUnmount") \
|
||||
template(notifyJvmtiHideFrames_name, "notifyJvmtiHideFrames") \
|
||||
template(notifyJvmtiDisableSuspend_name, "notifyJvmtiDisableSuspend") \
|
||||
template(doYield_name, "doYield") \
|
||||
template(enter_name, "enter") \
|
||||
template(enterSpecial_name, "enterSpecial") \
|
||||
|
||||
@@ -3017,7 +3017,7 @@ void nmethod::print_nmethod_labels(outputStream* stream, address block_begin, bo
|
||||
assert(sig_index == sizeargs, "");
|
||||
}
|
||||
const char* spname = "sp"; // make arch-specific?
|
||||
intptr_t out_preserve = SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
|
||||
SharedRuntime::java_calling_convention(sig_bt, regs, sizeargs);
|
||||
int stack_slot_offset = this->frame_size() * wordSize;
|
||||
int tab1 = 14, tab2 = 24;
|
||||
int sig_index = 0;
|
||||
|
||||
@@ -841,8 +841,15 @@ void DeoptimizeObjectsALotThread::deoptimize_objects_alot_loop_all() {
|
||||
|
||||
|
||||
JavaThread* CompileBroker::make_thread(ThreadType type, jobject thread_handle, CompileQueue* queue, AbstractCompiler* comp, JavaThread* THREAD) {
|
||||
JavaThread* new_thread = nullptr;
|
||||
Handle thread_oop(THREAD, JNIHandles::resolve_non_null(thread_handle));
|
||||
|
||||
if (java_lang_Thread::thread(thread_oop()) != nullptr) {
|
||||
assert(type == compiler_t, "should only happen with reused compiler threads");
|
||||
// The compiler thread hasn't actually exited yet so don't try to reuse it
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JavaThread* new_thread = nullptr;
|
||||
switch (type) {
|
||||
case compiler_t:
|
||||
assert(comp != nullptr, "Compiler instance missing.");
|
||||
@@ -871,7 +878,6 @@ JavaThread* CompileBroker::make_thread(ThreadType type, jobject thread_handle, C
|
||||
// JavaThread due to lack of resources. We will handle that failure below.
|
||||
// Also check new_thread so that static analysis is happy.
|
||||
if (new_thread != nullptr && new_thread->osthread() != nullptr) {
|
||||
Handle thread_oop(THREAD, JNIHandles::resolve_non_null(thread_handle));
|
||||
|
||||
if (type == compiler_t) {
|
||||
CompilerThread::cast(new_thread)->set_compiler(comp);
|
||||
|
||||
@@ -175,7 +175,7 @@ G1ConcurrentRefine::G1ConcurrentRefine(G1Policy* policy) :
|
||||
{}
|
||||
|
||||
jint G1ConcurrentRefine::initialize() {
|
||||
return _thread_control.initialize(this, G1ConcRefinementThreads);
|
||||
return _thread_control.initialize(this, max_num_threads());
|
||||
}
|
||||
|
||||
G1ConcurrentRefine* G1ConcurrentRefine::create(G1Policy* policy, jint* ecode) {
|
||||
@@ -199,6 +199,10 @@ void G1ConcurrentRefine::threads_do(ThreadClosure *tc) {
|
||||
_thread_control.worker_threads_do(tc);
|
||||
}
|
||||
|
||||
uint G1ConcurrentRefine::max_num_threads() {
|
||||
return G1ConcRefinementThreads;
|
||||
}
|
||||
|
||||
void G1ConcurrentRefine::update_pending_cards_target(double logged_cards_time_ms,
|
||||
size_t processed_logged_cards,
|
||||
size_t predicted_thread_buffer_cards,
|
||||
|
||||
@@ -215,6 +215,9 @@ public:
|
||||
|
||||
// Iterate over all concurrent refinement threads applying the given closure.
|
||||
void threads_do(ThreadClosure *tc);
|
||||
|
||||
// Maximum number of refinement threads.
|
||||
static uint max_num_threads();
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_G1_G1CONCURRENTREFINE_HPP
|
||||
|
||||
@@ -81,7 +81,7 @@ void G1FromCardCache::print(outputStream* out) {
|
||||
#endif
|
||||
|
||||
uint G1FromCardCache::num_par_rem_sets() {
|
||||
return G1DirtyCardQueueSet::num_par_ids() + G1ConcRefinementThreads + MAX2(ConcGCThreads, ParallelGCThreads);
|
||||
return G1DirtyCardQueueSet::num_par_ids() + G1ConcurrentRefine::max_num_threads() + MAX2(ConcGCThreads, ParallelGCThreads);
|
||||
}
|
||||
|
||||
void G1FromCardCache::clear(uint region_idx) {
|
||||
|
||||
@@ -91,6 +91,11 @@ class G1RemSetScanState : public CHeapObj<mtGC> {
|
||||
|
||||
size_t _max_reserved_regions;
|
||||
|
||||
// Has this region that is part of the regions in the collection set been processed yet.
|
||||
typedef bool G1RemsetIterState;
|
||||
|
||||
G1RemsetIterState volatile* _collection_set_iter_state;
|
||||
|
||||
// Card table iteration claim for each heap region, from 0 (completely unscanned)
|
||||
// to (>=) HeapRegion::CardsPerRegion (completely scanned).
|
||||
uint volatile* _card_table_scan_state;
|
||||
|
||||
@@ -67,7 +67,7 @@ double G1RemSetSummary::rs_thread_vtime(uint thread) const {
|
||||
}
|
||||
|
||||
G1RemSetSummary::G1RemSetSummary(bool should_update) :
|
||||
_num_vtimes(G1ConcRefinementThreads),
|
||||
_num_vtimes(G1ConcurrentRefine::max_num_threads()),
|
||||
_rs_threads_vtimes(NEW_C_HEAP_ARRAY(double, _num_vtimes, mtGC)) {
|
||||
|
||||
memset(_rs_threads_vtimes, 0, sizeof(double) * _num_vtimes);
|
||||
|
||||
@@ -38,16 +38,18 @@ bool G1RemSetTrackingPolicy::needs_scan_for_rebuild(HeapRegion* r) const {
|
||||
}
|
||||
|
||||
void G1RemSetTrackingPolicy::update_at_allocate(HeapRegion* r) {
|
||||
assert(r->is_young() || r->is_humongous() || r->is_old(),
|
||||
"Region %u with unexpected heap region type %s", r->hrm_index(), r->get_type_str());
|
||||
if (r->is_old()) {
|
||||
if (r->is_young()) {
|
||||
// Always collect remembered set for young regions.
|
||||
r->rem_set()->set_state_complete();
|
||||
} else if (r->is_humongous()) {
|
||||
// Collect remembered sets for humongous regions by default to allow eager reclaim.
|
||||
r->rem_set()->set_state_complete();
|
||||
} else if (r->is_old()) {
|
||||
// By default, do not create remembered set for new old regions.
|
||||
r->rem_set()->set_state_untracked();
|
||||
return;
|
||||
} else {
|
||||
guarantee(false, "Unhandled region %u with heap region type %s", r->hrm_index(), r->get_type_str());
|
||||
}
|
||||
// Always collect remembered set for young regions and for humongous regions.
|
||||
// Humongous regions need that for eager reclaim.
|
||||
r->rem_set()->set_state_complete();
|
||||
}
|
||||
|
||||
void G1RemSetTrackingPolicy::update_at_free(HeapRegion* r) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2021, 2024, 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
|
||||
@@ -403,7 +403,7 @@ class G1PrepareEvacuationTask : public WorkerTask {
|
||||
_g1h->register_region_with_region_attr(hr);
|
||||
}
|
||||
log_debug(gc, humongous)("Humongous region %u (object size %zu @ " PTR_FORMAT ") remset %zu code roots %zu "
|
||||
"marked %d pinned count %u reclaim candidate %d type array %d",
|
||||
"marked %d pinned count %zu reclaim candidate %d type array %d",
|
||||
index,
|
||||
cast_to_oop(hr->bottom())->size() * HeapWordSize,
|
||||
p2i(hr->bottom()),
|
||||
|
||||
@@ -113,11 +113,11 @@
|
||||
"of the optimal occupancy to start marking.") \
|
||||
range(1, max_intx) \
|
||||
\
|
||||
product(uint, G1ConfidencePercent, 50, \
|
||||
product(uint, G1ConfidencePercent, 50, \
|
||||
"Confidence level for MMU/pause predictions") \
|
||||
range(0, 100) \
|
||||
\
|
||||
product(uintx, G1SummarizeRSetStatsPeriod, 0, DIAGNOSTIC, \
|
||||
product(intx, G1SummarizeRSetStatsPeriod, 0, DIAGNOSTIC, \
|
||||
"The period (in number of GCs) at which we will generate " \
|
||||
"update buffer processing info " \
|
||||
"(0 means do not periodically generate this info); " \
|
||||
@@ -148,7 +148,7 @@
|
||||
"Number of entries in an SATB log buffer.") \
|
||||
constraint(G1SATBBufferSizeConstraintFunc, AtParse) \
|
||||
\
|
||||
develop(uintx, G1SATBProcessCompletedThreshold, 20, \
|
||||
develop(intx, G1SATBProcessCompletedThreshold, 20, \
|
||||
"Number of completed buffers that triggers log processing.") \
|
||||
range(0, max_jint) \
|
||||
\
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2024, 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
|
||||
@@ -424,7 +424,7 @@ void HeapRegion::print_on(outputStream* st) const {
|
||||
st->print("|-");
|
||||
}
|
||||
}
|
||||
st->print("|%3u", Atomic::load(&_pinned_object_count));
|
||||
st->print("|%3zu", Atomic::load(&_pinned_object_count));
|
||||
st->print_cr("");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2024, 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
|
||||
@@ -257,7 +257,7 @@ private:
|
||||
uint _node_index;
|
||||
|
||||
// Number of objects in this region that are currently pinned.
|
||||
volatile uint _pinned_object_count;
|
||||
volatile size_t _pinned_object_count;
|
||||
|
||||
void report_region_type_change(G1HeapRegionTraceType::Type to);
|
||||
|
||||
@@ -408,7 +408,7 @@ public:
|
||||
|
||||
bool is_old_or_humongous() const { return _type.is_old_or_humongous(); }
|
||||
|
||||
uint pinned_count() const { return Atomic::load(&_pinned_object_count); }
|
||||
size_t pinned_count() const { return Atomic::load(&_pinned_object_count); }
|
||||
bool has_pinned_objects() const { return pinned_count() > 0; }
|
||||
|
||||
void set_free();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2001, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2001, 2024, 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
|
||||
@@ -554,11 +554,11 @@ inline void HeapRegion::record_surv_words_in_group(size_t words_survived) {
|
||||
}
|
||||
|
||||
inline void HeapRegion::increment_pinned_object_count() {
|
||||
Atomic::add(&_pinned_object_count, 1u, memory_order_relaxed);
|
||||
Atomic::add(&_pinned_object_count, (size_t)1, memory_order_relaxed);
|
||||
}
|
||||
|
||||
inline void HeapRegion::decrement_pinned_object_count() {
|
||||
Atomic::sub(&_pinned_object_count, 1u, memory_order_relaxed);
|
||||
Atomic::sub(&_pinned_object_count, (size_t)1, memory_order_relaxed);
|
||||
}
|
||||
|
||||
#endif // SHARE_GC_G1_HEAPREGION_INLINE_HPP
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2011, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2011, 2024, 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
|
||||
@@ -41,7 +41,7 @@
|
||||
nonstatic_field(HeapRegion, _bottom, HeapWord* const) \
|
||||
nonstatic_field(HeapRegion, _top, HeapWord* volatile) \
|
||||
nonstatic_field(HeapRegion, _end, HeapWord* const) \
|
||||
nonstatic_field(HeapRegion, _pinned_object_count, volatile uint) \
|
||||
volatile_nonstatic_field(HeapRegion, _pinned_object_count, size_t) \
|
||||
\
|
||||
nonstatic_field(HeapRegionType, _tag, HeapRegionType::Tag volatile) \
|
||||
\
|
||||
|
||||
@@ -344,11 +344,17 @@ class AdaptiveSizePolicy : public CHeapObj<mtGC> {
|
||||
AdaptiveWeightedAverage* avg_eden_live() const { return _avg_eden_live; }
|
||||
AdaptiveWeightedAverage* avg_old_live() const { return _avg_old_live; }
|
||||
|
||||
AdaptivePaddedAverage* avg_survived() const { return _avg_survived; }
|
||||
AdaptivePaddedNoZeroDevAverage* avg_pretenured() { return _avg_pretenured; }
|
||||
|
||||
// Methods indicating events of interest to the adaptive size policy,
|
||||
// called by GC algorithms. It is the responsibility of users of this
|
||||
// policy to call these methods at the correct times!
|
||||
virtual void minor_collection_begin();
|
||||
virtual void minor_collection_end(GCCause::Cause gc_cause);
|
||||
virtual LinearLeastSquareFit* minor_pause_old_estimator() const {
|
||||
return _minor_pause_old_estimator;
|
||||
}
|
||||
|
||||
LinearLeastSquareFit* minor_pause_young_estimator() {
|
||||
return _minor_pause_young_estimator;
|
||||
@@ -398,6 +404,10 @@ class AdaptiveSizePolicy : public CHeapObj<mtGC> {
|
||||
_overhead_checker.set_gc_overhead_limit_exceeded(v);
|
||||
}
|
||||
|
||||
bool gc_overhead_limit_near() {
|
||||
return _overhead_checker.gc_overhead_limit_near();
|
||||
}
|
||||
|
||||
void reset_gc_overhead_limit_count() {
|
||||
_overhead_checker.reset_gc_overhead_limit_count();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "runtime/init.hpp"
|
||||
#include "runtime/java.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
|
||||
WorkerTaskDispatcher::WorkerTaskDispatcher() :
|
||||
_task(nullptr),
|
||||
@@ -141,40 +142,44 @@ void WorkerThreads::threads_do(ThreadClosure* tc) const {
|
||||
}
|
||||
}
|
||||
|
||||
void WorkerThreads::set_indirectly_suspendible_threads() {
|
||||
template <typename Function>
|
||||
void WorkerThreads::threads_do_f(Function function) const {
|
||||
for (uint i = 0; i < _created_workers; i++) {
|
||||
function(_workers[i]);
|
||||
}
|
||||
}
|
||||
|
||||
void WorkerThreads::set_indirect_states() {
|
||||
#ifdef ASSERT
|
||||
class SetIndirectlySuspendibleThreadClosure : public ThreadClosure {
|
||||
virtual void do_thread(Thread* thread) {
|
||||
const bool is_suspendible = Thread::current()->is_suspendible_thread();
|
||||
const bool is_safepointed = Thread::current()->is_VM_thread() && SafepointSynchronize::is_at_safepoint();
|
||||
|
||||
threads_do_f([&](Thread* thread) {
|
||||
assert(!thread->is_indirectly_suspendible_thread(), "Unexpected");
|
||||
assert(!thread->is_indirectly_safepoint_thread(), "Unexpected");
|
||||
if (is_suspendible) {
|
||||
thread->set_indirectly_suspendible_thread();
|
||||
}
|
||||
};
|
||||
|
||||
if (Thread::current()->is_suspendible_thread()) {
|
||||
SetIndirectlySuspendibleThreadClosure cl;
|
||||
threads_do(&cl);
|
||||
}
|
||||
if (is_safepointed) {
|
||||
thread->set_indirectly_safepoint_thread();
|
||||
}
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void WorkerThreads::clear_indirectly_suspendible_threads() {
|
||||
void WorkerThreads::clear_indirect_states() {
|
||||
#ifdef ASSERT
|
||||
class ClearIndirectlySuspendibleThreadClosure : public ThreadClosure {
|
||||
virtual void do_thread(Thread* thread) {
|
||||
thread->clear_indirectly_suspendible_thread();
|
||||
}
|
||||
};
|
||||
|
||||
if (Thread::current()->is_suspendible_thread()) {
|
||||
ClearIndirectlySuspendibleThreadClosure cl;
|
||||
threads_do(&cl);
|
||||
}
|
||||
threads_do_f([&](Thread* thread) {
|
||||
thread->clear_indirectly_suspendible_thread();
|
||||
thread->clear_indirectly_safepoint_thread();
|
||||
});
|
||||
#endif
|
||||
}
|
||||
|
||||
void WorkerThreads::run_task(WorkerTask* task) {
|
||||
set_indirectly_suspendible_threads();
|
||||
set_indirect_states();
|
||||
_dispatcher.coordinator_distribute_task(task, _active_workers);
|
||||
clear_indirectly_suspendible_threads();
|
||||
clear_indirect_states();
|
||||
}
|
||||
|
||||
void WorkerThreads::run_task(WorkerTask* task, uint num_workers) {
|
||||
|
||||
@@ -93,8 +93,8 @@ private:
|
||||
|
||||
WorkerThread* create_worker(uint name_suffix);
|
||||
|
||||
void set_indirectly_suspendible_threads();
|
||||
void clear_indirectly_suspendible_threads();
|
||||
void set_indirect_states();
|
||||
void clear_indirect_states();
|
||||
|
||||
protected:
|
||||
virtual void on_create_worker(WorkerThread* worker) {}
|
||||
@@ -111,6 +111,8 @@ public:
|
||||
uint set_active_workers(uint num_workers);
|
||||
|
||||
void threads_do(ThreadClosure* tc) const;
|
||||
template <typename Function>
|
||||
void threads_do_f(Function function) const;
|
||||
|
||||
const char* name() const { return _name; }
|
||||
|
||||
|
||||
@@ -26,14 +26,13 @@
|
||||
|
||||
#include "gc/z/zBarrier.hpp"
|
||||
|
||||
#include "code/codeCache.hpp"
|
||||
#include "gc/z/zAddress.inline.hpp"
|
||||
#include "gc/z/zGeneration.inline.hpp"
|
||||
#include "gc/z/zHeap.inline.hpp"
|
||||
#include "gc/z/zResurrection.inline.hpp"
|
||||
#include "gc/z/zVerify.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
#include "runtime/atomic.hpp"
|
||||
#include "runtime/continuation.hpp"
|
||||
|
||||
// A self heal must always "upgrade" the address metadata bits in
|
||||
// accordance with the metadata bits state machine. The following
|
||||
@@ -320,17 +319,9 @@ inline zaddress ZBarrier::make_load_good_no_relocate(zpointer o) {
|
||||
return remap(ZPointer::uncolor_unsafe(o), remap_generation(o));
|
||||
}
|
||||
|
||||
inline void z_assert_is_barrier_safe() {
|
||||
assert(!Thread::current()->is_ConcurrentGC_thread() || /* Need extra checks for ConcurrentGCThreads */
|
||||
Thread::current()->is_suspendible_thread() || /* Thread prevents safepoints */
|
||||
Thread::current()->is_indirectly_suspendible_thread() || /* Coordinator thread prevents safepoints */
|
||||
SafepointSynchronize::is_at_safepoint(), /* Is at safepoint */
|
||||
"Shouldn't perform load barrier");
|
||||
}
|
||||
|
||||
template <typename ZBarrierSlowPath>
|
||||
inline zaddress ZBarrier::barrier(ZBarrierFastPath fast_path, ZBarrierSlowPath slow_path, ZBarrierColor color, volatile zpointer* p, zpointer o, bool allow_null) {
|
||||
z_assert_is_barrier_safe();
|
||||
z_verify_safepoints_are_blocked();
|
||||
|
||||
// Fast path
|
||||
if (fast_path(o)) {
|
||||
|
||||
@@ -152,6 +152,19 @@ void ZBarrierSet::on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) {
|
||||
deoptimize_allocation(thread);
|
||||
}
|
||||
|
||||
void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj, size_t size) {
|
||||
volatile zpointer* src = (volatile zpointer*)src_obj->base();
|
||||
volatile zpointer* dst = (volatile zpointer*)dst_obj->base();
|
||||
|
||||
for (const zpointer* const end = cast_from_oop<const zpointer*>(src_obj) + size; src < end; src++, dst++) {
|
||||
zaddress elem = ZBarrier::load_barrier_on_oop_field(src);
|
||||
// We avoid healing here because the store below colors the pointer store good,
|
||||
// hence avoiding the cost of a CAS.
|
||||
ZBarrier::store_barrier_on_heap_oop_field(dst, false /* heal */);
|
||||
Atomic::store(dst, ZAddress::store_good(elem));
|
||||
}
|
||||
}
|
||||
|
||||
void ZBarrierSet::print_on(outputStream* st) const {
|
||||
st->print_cr("ZBarrierSet");
|
||||
}
|
||||
|
||||
@@ -39,6 +39,8 @@ public:
|
||||
static ZBarrierSetAssembler* assembler();
|
||||
static bool barrier_needed(DecoratorSet decorators, BasicType type);
|
||||
|
||||
static void clone_obj_array(objArrayOop src, objArrayOop dst, size_t size);
|
||||
|
||||
virtual void on_thread_create(Thread* thread);
|
||||
virtual void on_thread_destroy(Thread* thread);
|
||||
virtual void on_thread_attach(Thread* thread);
|
||||
|
||||
@@ -403,14 +403,13 @@ inline bool ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::oop_arraycopy_i
|
||||
return oop_arraycopy_in_heap_no_check_cast(dst, src, length);
|
||||
}
|
||||
|
||||
class ZStoreBarrierOopClosure : public BasicOopIterateClosure {
|
||||
class ZColorStoreGoodOopClosure : public BasicOopIterateClosure {
|
||||
public:
|
||||
virtual void do_oop(oop* p_) {
|
||||
volatile zpointer* const p = (volatile zpointer*)p_;
|
||||
const zpointer ptr = ZBarrier::load_atomic(p);
|
||||
const zaddress addr = ZPointer::uncolor(ptr);
|
||||
ZBarrier::store_barrier_on_heap_oop_field(p, false /* heal */);
|
||||
*p = ZAddress::store_good(addr);
|
||||
Atomic::store(p, ZAddress::store_good(addr));
|
||||
}
|
||||
|
||||
virtual void do_oop(narrowOop* p) {
|
||||
@@ -433,6 +432,17 @@ template <DecoratorSet decorators, typename BarrierSetT>
|
||||
inline void ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::clone_in_heap(oop src, oop dst, size_t size) {
|
||||
assert_is_valid(to_zaddress(src));
|
||||
|
||||
if (dst->is_objArray()) {
|
||||
// Cloning an object array is similar to performing array copy.
|
||||
// If an array is large enough to have its allocation segmented,
|
||||
// this operation might require GC barriers. However, the intrinsics
|
||||
// for cloning arrays transform the clone to an optimized allocation
|
||||
// and arraycopy sequence, so the performance of this runtime call
|
||||
// does not matter for object arrays.
|
||||
clone_obj_array(objArrayOop(src), objArrayOop(dst), size);
|
||||
return;
|
||||
}
|
||||
|
||||
// Fix the oops
|
||||
ZLoadBarrierOopClosure cl;
|
||||
ZIterator::oop_iterate(src, &cl);
|
||||
@@ -440,10 +450,10 @@ inline void ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::clone_in_heap(o
|
||||
// Clone the object
|
||||
Raw::clone_in_heap(src, dst, size);
|
||||
|
||||
assert(ZHeap::heap()->is_young(to_zaddress(dst)), "ZColorStoreGoodOopClosure is only valid for young objects");
|
||||
assert(dst->is_typeArray() || ZHeap::heap()->is_young(to_zaddress(dst)), "ZColorStoreGoodOopClosure is only valid for young objects");
|
||||
|
||||
// Color store good before handing out
|
||||
ZStoreBarrierOopClosure cl_sg;
|
||||
ZColorStoreGoodOopClosure cl_sg;
|
||||
ZIterator::oop_iterate(dst, &cl_sg);
|
||||
}
|
||||
|
||||
|
||||
@@ -286,6 +286,10 @@ void ZGeneration::desynchronize_relocation() {
|
||||
_relocate.desynchronize();
|
||||
}
|
||||
|
||||
bool ZGeneration::is_relocate_queue_active() const {
|
||||
return _relocate.is_queue_active();
|
||||
}
|
||||
|
||||
void ZGeneration::reset_statistics() {
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint");
|
||||
_freed = 0;
|
||||
@@ -1496,7 +1500,7 @@ void ZGenerationOld::remap_young_roots() {
|
||||
uint remap_nworkers = clamp(ZGeneration::young()->workers()->active_workers() + prev_nworkers, 1u, ZOldGCThreads);
|
||||
_workers.set_active_workers(remap_nworkers);
|
||||
|
||||
// TODO: The STS joiner is only needed to satisfy z_assert_is_barrier_safe that doesn't
|
||||
// TODO: The STS joiner is only needed to satisfy ZBarrier::assert_is_state_barrier_safe that doesn't
|
||||
// understand the driver locker. Consider making the assert aware of the driver locker.
|
||||
SuspendibleThreadSetJoiner sts_joiner;
|
||||
|
||||
|
||||
@@ -166,6 +166,7 @@ public:
|
||||
// Relocation
|
||||
void synchronize_relocation();
|
||||
void desynchronize_relocation();
|
||||
bool is_relocate_queue_active() const;
|
||||
zaddress relocate_or_remap_object(zaddress_unsafe addr);
|
||||
zaddress remap_object(zaddress_unsafe addr);
|
||||
|
||||
|
||||
@@ -26,11 +26,21 @@
|
||||
|
||||
#include "gc/z/zIterator.hpp"
|
||||
|
||||
#include "gc/z/zVerify.hpp"
|
||||
#include "memory/iterator.inline.hpp"
|
||||
#include "oops/objArrayOop.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
|
||||
inline bool ZIterator::is_invisible_object(oop obj) {
|
||||
// This is a good place to make sure that we can't concurrently iterate over
|
||||
// objects while VMThread operations think they have exclusive access to the
|
||||
// object graph.
|
||||
//
|
||||
// One example that have caused problems is the JFR Leak Profiler, which
|
||||
// sets the mark word to a value that makes the object arrays look like
|
||||
// invisible objects.
|
||||
z_verify_safepoints_are_blocked();
|
||||
|
||||
return obj->mark_acquire().is_marked();
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,7 @@ ZRelocateQueue::ZRelocateQueue()
|
||||
_nworkers(0),
|
||||
_nsynchronized(0),
|
||||
_synchronize(false),
|
||||
_is_active(false),
|
||||
_needs_attention(0) {}
|
||||
|
||||
bool ZRelocateQueue::needs_attention() const {
|
||||
@@ -103,6 +104,20 @@ void ZRelocateQueue::dec_needs_attention() {
|
||||
assert(needs_attention == 0 || needs_attention == 1, "Invalid state");
|
||||
}
|
||||
|
||||
void ZRelocateQueue::activate(uint nworkers) {
|
||||
_is_active = true;
|
||||
join(nworkers);
|
||||
}
|
||||
|
||||
void ZRelocateQueue::deactivate() {
|
||||
Atomic::store(&_is_active, false);
|
||||
clear();
|
||||
}
|
||||
|
||||
bool ZRelocateQueue::is_active() const {
|
||||
return Atomic::load(&_is_active);
|
||||
}
|
||||
|
||||
void ZRelocateQueue::join(uint nworkers) {
|
||||
assert(nworkers != 0, "Must request at least one worker");
|
||||
assert(_nworkers == 0, "Invalid state");
|
||||
@@ -327,7 +342,7 @@ ZWorkers* ZRelocate::workers() const {
|
||||
}
|
||||
|
||||
void ZRelocate::start() {
|
||||
_queue.join(workers()->active_workers());
|
||||
_queue.activate(workers()->active_workers());
|
||||
}
|
||||
|
||||
void ZRelocate::add_remset(volatile zpointer* p) {
|
||||
@@ -1088,6 +1103,9 @@ public:
|
||||
|
||||
~ZRelocateTask() {
|
||||
_generation->stat_relocation()->at_relocate_end(_small_allocator.in_place_count(), _medium_allocator.in_place_count());
|
||||
|
||||
// Signal that we're not using the queue anymore. Used mostly for asserts.
|
||||
_queue->deactivate();
|
||||
}
|
||||
|
||||
virtual void work() {
|
||||
@@ -1232,8 +1250,6 @@ void ZRelocate::relocate(ZRelocationSet* relocation_set) {
|
||||
ZRelocateAddRemsetForFlipPromoted task(relocation_set->flip_promoted_pages());
|
||||
workers()->run(&task);
|
||||
}
|
||||
|
||||
_queue.clear();
|
||||
}
|
||||
|
||||
ZPageAge ZRelocate::compute_to_age(ZPageAge from_age) {
|
||||
@@ -1316,3 +1332,7 @@ void ZRelocate::desynchronize() {
|
||||
ZRelocateQueue* ZRelocate::queue() {
|
||||
return &_queue;
|
||||
}
|
||||
|
||||
bool ZRelocate::is_queue_active() const {
|
||||
return _queue.is_active();
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ private:
|
||||
uint _nworkers;
|
||||
uint _nsynchronized;
|
||||
bool _synchronize;
|
||||
volatile bool _is_active;
|
||||
volatile int _needs_attention;
|
||||
|
||||
bool needs_attention() const;
|
||||
@@ -53,6 +54,10 @@ private:
|
||||
public:
|
||||
ZRelocateQueue();
|
||||
|
||||
void activate(uint nworkers);
|
||||
void deactivate();
|
||||
bool is_active() const;
|
||||
|
||||
void join(uint nworkers);
|
||||
void resize_workers(uint nworkers);
|
||||
void leave();
|
||||
@@ -99,6 +104,8 @@ public:
|
||||
void desynchronize();
|
||||
|
||||
ZRelocateQueue* queue();
|
||||
|
||||
bool is_queue_active() const;
|
||||
};
|
||||
|
||||
#endif // SHARE_GC_Z_ZRELOCATE_HPP
|
||||
|
||||
@@ -106,11 +106,16 @@ public:
|
||||
}
|
||||
|
||||
virtual void work() {
|
||||
// Join the STS to block out VMThreads while running promote_barrier_on_young_oop_field
|
||||
SuspendibleThreadSetJoiner sts_joiner;
|
||||
|
||||
// Allocate and install forwardings for small pages
|
||||
for (size_t page_index; _small_iter.next_index(&page_index);) {
|
||||
ZPage* page = _small->at(int(page_index));
|
||||
ZForwarding* const forwarding = ZForwarding::alloc(_allocator, page, to_age(page));
|
||||
install_small(forwarding, _medium->length() + page_index);
|
||||
|
||||
SuspendibleThreadSet::yield();
|
||||
}
|
||||
|
||||
// Allocate and install forwardings for medium pages
|
||||
@@ -118,6 +123,8 @@ public:
|
||||
ZPage* page = _medium->at(int(page_index));
|
||||
ZForwarding* const forwarding = ZForwarding::alloc(_allocator, page, to_age(page));
|
||||
install_medium(forwarding, page_index);
|
||||
|
||||
SuspendibleThreadSet::yield();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,11 +29,12 @@
|
||||
#include "gc/z/zAddress.inline.hpp"
|
||||
#include "gc/z/zBarrier.inline.hpp"
|
||||
#include "gc/z/zHeap.inline.hpp"
|
||||
#include "gc/z/zBarrier.hpp"
|
||||
#include "oops/oop.hpp"
|
||||
|
||||
template <typename ObjectFunctionT>
|
||||
inline void ZUncoloredRoot::barrier(ObjectFunctionT function, zaddress_unsafe* p, uintptr_t color) {
|
||||
z_assert_is_barrier_safe();
|
||||
z_verify_safepoints_are_blocked();
|
||||
|
||||
const zaddress_unsafe addr = Atomic::load(p);
|
||||
assert_is_valid(addr);
|
||||
|
||||
@@ -43,16 +43,67 @@
|
||||
#include "runtime/frame.inline.hpp"
|
||||
#include "runtime/globals.hpp"
|
||||
#include "runtime/handles.hpp"
|
||||
#include "runtime/javaThread.hpp"
|
||||
#include "runtime/javaThread.inline.hpp"
|
||||
#include "runtime/mutexLocker.hpp"
|
||||
#include "runtime/safepoint.hpp"
|
||||
#include "runtime/stackFrameStream.inline.hpp"
|
||||
#include "runtime/stackWatermark.inline.hpp"
|
||||
#include "runtime/stackWatermarkSet.inline.hpp"
|
||||
#include "runtime/thread.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
#include "utilities/preserveException.hpp"
|
||||
#include "utilities/resourceHash.hpp"
|
||||
|
||||
#ifdef ASSERT
|
||||
|
||||
// Used to verify that safepoints operations can't be scheduled concurrently
|
||||
// with callers to this function. Typically used to verify that object oops
|
||||
// and headers are safe to access.
|
||||
void z_verify_safepoints_are_blocked() {
|
||||
Thread* current = Thread::current();
|
||||
|
||||
if (current->is_ConcurrentGC_thread()) {
|
||||
assert(current->is_suspendible_thread(), // Thread prevents safepoints
|
||||
"Safepoints are not blocked by current thread");
|
||||
|
||||
} else if (current->is_Worker_thread()) {
|
||||
assert(// Check if ...
|
||||
// the thread prevents safepoints
|
||||
current->is_suspendible_thread() ||
|
||||
// the coordinator thread is the safepointing VMThread
|
||||
current->is_indirectly_safepoint_thread() ||
|
||||
// the coordinator thread prevents safepoints
|
||||
current->is_indirectly_suspendible_thread() ||
|
||||
// the RelocateQueue prevents safepoints
|
||||
//
|
||||
// RelocateQueue acts as a pseudo STS leaver/joiner and blocks
|
||||
// safepoints. There's currently no infrastructure to check if the
|
||||
// current thread is active or not, so check the global states instead.
|
||||
ZGeneration::young()->is_relocate_queue_active() ||
|
||||
ZGeneration::old()->is_relocate_queue_active(),
|
||||
"Safepoints are not blocked by current thread");
|
||||
|
||||
} else if (current->is_Java_thread()) {
|
||||
JavaThreadState state = JavaThread::cast(current)->thread_state();
|
||||
assert(state == _thread_in_Java || state == _thread_in_vm || state == _thread_new,
|
||||
"Safepoints are not blocked by current thread from state: %d", state);
|
||||
|
||||
} else if (current->is_JfrSampler_thread()) {
|
||||
// The JFR sampler thread blocks out safepoints with this lock.
|
||||
assert_lock_strong(Threads_lock);
|
||||
|
||||
} else if (current->is_VM_thread()) {
|
||||
// The VM Thread doesn't schedule new safepoints while executing
|
||||
// other safepoint or handshake operations.
|
||||
|
||||
} else {
|
||||
fatal("Unexpected thread type");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define BAD_OOP_ARG(o, p) "Bad oop " PTR_FORMAT " found at " PTR_FORMAT, untype(o), p2i(p)
|
||||
|
||||
static bool z_is_null_relaxed(zpointer o) {
|
||||
|
||||
@@ -30,6 +30,8 @@ class frame;
|
||||
class ZForwarding;
|
||||
class ZPageAllocator;
|
||||
|
||||
NOT_DEBUG(inline) void z_verify_safepoints_are_blocked() NOT_DEBUG_RETURN;
|
||||
|
||||
class ZVerify : public AllStatic {
|
||||
private:
|
||||
static void roots_strong(bool verify_after_old_mark);
|
||||
|
||||
@@ -1154,6 +1154,9 @@ JVM_VirtualThreadUnmount(JNIEnv* env, jobject vthread, jboolean hide);
|
||||
JNIEXPORT void JNICALL
|
||||
JVM_VirtualThreadHideFrames(JNIEnv* env, jobject vthread, jboolean hide);
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
JVM_VirtualThreadDisableSuspend(JNIEnv* env, jobject vthread, jboolean enter);
|
||||
|
||||
/*
|
||||
* Core reflection support.
|
||||
*/
|
||||
|
||||
@@ -385,13 +385,18 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end)
|
||||
if (end != nullptr && aligned_bcp + 3*jintSize >= end) {
|
||||
return -1; // don't read past end of code buffer
|
||||
}
|
||||
// Promote calculation to 64 bits to do range checks, used by the verifier.
|
||||
// Promote calculation to signed 64 bits to do range checks, used by the verifier.
|
||||
int64_t lo = (int)Bytes::get_Java_u4(aligned_bcp + 1*jintSize);
|
||||
int64_t hi = (int)Bytes::get_Java_u4(aligned_bcp + 2*jintSize);
|
||||
int64_t len = (aligned_bcp - bcp) + (3 + hi - lo + 1)*jintSize;
|
||||
// only return len if it can be represented as a positive int;
|
||||
// return -1 otherwise
|
||||
return (len > 0 && len == (int)len) ? (int)len : -1;
|
||||
// Only return len if it can be represented as a positive int and lo <= hi.
|
||||
// The caller checks for bytecode stream overflow.
|
||||
if (lo <= hi && len == (int)len) {
|
||||
assert(len > 0, "must be");
|
||||
return (int)len;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
case _lookupswitch: // fall through
|
||||
@@ -404,9 +409,13 @@ int Bytecodes::special_length_at(Bytecodes::Code code, address bcp, address end)
|
||||
// Promote calculation to 64 bits to do range checks, used by the verifier.
|
||||
int64_t npairs = (int)Bytes::get_Java_u4(aligned_bcp + jintSize);
|
||||
int64_t len = (aligned_bcp - bcp) + (2 + 2*npairs)*jintSize;
|
||||
// only return len if it can be represented as a positive int;
|
||||
// return -1 otherwise
|
||||
return (len > 0 && len == (int)len) ? (int)len : -1;
|
||||
// Only return len if it can be represented as a positive int and npairs >= 0.
|
||||
if (npairs >= 0 && len == (int)len) {
|
||||
assert(len > 0, "must be");
|
||||
return (int)len;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
default:
|
||||
// Note: Length functions must return <=0 for invalid bytecodes.
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user