Compare commits

..

65 Commits

Author SHA1 Message Date
Albert Mingkun Yang
cb3f9680d3 8314651: G1: Fix -Wconversion warnings in static fields of HeapRegion
Reviewed-by: tschatzl, iwalulya
2023-08-30 09:36:34 +00:00
Robbin Ehn
876a725af9 8315206: RISC-V: hwprobe query is_set return wrong value
Reviewed-by: luhenry, fyang
2023-08-30 08:56:50 +00:00
Roland Westrelin
ed1ea5fe7c 8314024: SIGSEGV in PhaseIdealLoop::build_loop_late_post_work due to bad immediate dominator info
Reviewed-by: kvn, chagedorn
2023-08-30 07:52:05 +00:00
Matthias Baesken
f3aeb024d9 8315213: java/lang/ProcessHandle/TreeTest.java test enhance output of children
Reviewed-by: stuefe, rriggs
2023-08-30 06:46:51 +00:00
Matthias Baesken
1e7e2bcf35 8315214: Do not run sun/tools/jhsdb tests concurrently
Reviewed-by: alanb, cjplummer
2023-08-30 06:41:43 +00:00
Scott Gibbons
ce2a7ea40a 8314056: Remove runtime platform check from frem/drem
Reviewed-by: sviswanathan, jbhateja
2023-08-30 01:28:27 +00:00
Valerie Peng
1c598c2245 8312428: PKCS11 tests fail with NSS 3.91
Reviewed-by: ssahoo, rhalade
2023-08-29 22:08:34 +00:00
Chris Plummer
b2728cb139 8189685: need PerfMemory class update and a volatile_static_field support in VMStructs
Reviewed-by: ysuenaga, dholmes, sspitsyn
2023-08-29 20:55:11 +00:00
Albert Mingkun Yang
e22762c010 8314932: G1: Fix -Wconversion warnings for simple cases inside g1 folder
Reviewed-by: tschatzl, iwalulya
2023-08-29 16:04:50 +00:00
Thomas Schatzl
762b652912 8314573: G1: Heap resizing at Remark does not take existing eden regions into account
Reviewed-by: kbarrett, ayang
2023-08-29 14:20:11 +00:00
Pavel Rappo
a4e97aa4eb 8314753: Remove support for @beaninfo, @ToDo, @since.unbundled, and @Note
Reviewed-by: rriggs, azvegint, kevinw
2023-08-29 12:00:19 +00:00
Emmy
5cc64cc27a 8309463: IGV: Dynamic graph layout algorithm
Reviewed-by: tholenstein, rcastanedalo, chagedorn
2023-08-29 09:52:41 +00:00
Kevin Walls
1d0250709a 8314476: TestJstatdPortAndServer.java failed with "java.rmi.NoSuchObjectException: no such object in table"
Reviewed-by: msheppar, sspitsyn
2023-08-29 08:54:00 +00:00
Sergey Tsypanov
93188bd80c 8314569: (fs) Improve normalization of UnixPath for input with trailing slashes
Reviewed-by: alanb, bpb, rriggs
2023-08-29 08:39:42 +00:00
Albert Mingkun Yang
8b8182db59 8315087: G1: Use uint for G1 flags indicating percentage
Reviewed-by: tschatzl, kbarrett
2023-08-29 08:01:35 +00:00
Feilong Jiang
3dc266c58b 8315070: RISC-V: Clean up platform dependent inline headers
Reviewed-by: fyang, rehn
2023-08-29 02:43:44 +00:00
Hao Sun
25f5df2af2 8315073: Zero build on macOS fails after JDK-8303852
Reviewed-by: jiefu, fyang
2023-08-29 02:12:37 +00:00
Pengfei Li
a03954e6c5 8309697: [TESTBUG] Remove "@requires vm.flagless" from jtreg vectorization tests
Reviewed-by: kvn, thartmann, epeter, chagedorn
2023-08-29 01:39:54 +00:00
Pengfei Li
e5ea9aa9aa 8312570: [TESTBUG] Jtreg compiler/loopopts/superword/TestDependencyOffsets.java fails on 512-bit SVE
Reviewed-by: epeter, kvn
2023-08-29 01:34:33 +00:00
Calvin Cheung
1cb2cc6587 8308464: Shared array class should not always be loaded in boot loader
Reviewed-by: dholmes, iklam
2023-08-28 22:05:15 +00:00
Erik Joelsson
69d1feb83f 8315060: Out of tree incremental build fails with ccache
Reviewed-by: kbarrett, dholmes
2023-08-28 20:56:31 +00:00
Joe Darcy
8e2a533df6 8315137: Add explicit override RecordComponentElement.asType()
Reviewed-by: jjg
2023-08-28 20:43:54 +00:00
Justin Lu
b4b2fecb42 8311081: KeytoolReaderP12Test.java fail on localized Windows platform
Reviewed-by: lancea, jpai, weijun
2023-08-28 20:36:32 +00:00
lawrence.andrews
31e26814db 8315071: Modify TrayIconScalingTest.java, PrintLatinCJKTest.java to use new PassFailJFrame's builder pattern usage
Reviewed-by: honkar, aivanov
2023-08-28 20:31:02 +00:00
Alisen Chung
21916f32c0 8139208: [macosx] Issue with setExtendedState of JFrame
Reviewed-by: honkar, dnguyen, azvegint
2023-08-28 20:17:40 +00:00
Xin Liu
99ea8bf2b9 8315062: [GHA] get-bootjdk action should return the abolute path
Reviewed-by: clanger, erikj
2023-08-28 15:59:24 +00:00
Vicente Romero
acb24bf354 8315116: fix minor issue in copyright header introduced by JDK-8269957 that is breaking the build
Reviewed-by: jjg, dcubed
2023-08-28 15:43:41 +00:00
Archie Cobbs
11da15d142 8269957: facilitate alternate impls of NameTable and Name
Reviewed-by: jjg, vromero
2023-08-28 14:48:45 +00:00
Ao Qi
725ec0ce1b 8315020: The macro definition for LoongArch64 zero build is not accurate.
Reviewed-by: erikj, fyang
2023-08-28 11:10:53 +00:00
Roberto Castañeda Lozano
1c3177eea7 8315029: [BACKOUT] Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index))
Reviewed-by: chagedorn, mdoerr
2023-08-28 11:08:44 +00:00
Albert Mingkun Yang
dd23f7d5cd 8315039: Parallel: Remove unimplemented PSYoungGen::oop_iterate
Reviewed-by: kbarrett, tschatzl
2023-08-28 10:51:00 +00:00
Christian Hagedorn
5c4f1dc43e 8314513: [IR Framework] Some internal IR Framework tests are failing after JDK-8310308 on PPC and Cascade Lake
Reviewed-by: kvn, mdoerr
2023-08-28 10:30:48 +00:00
Martin Doerr
cf2d33ca2e 8299658: C1 compilation crashes in LinearScan::resolve_exception_edge
Reviewed-by: thartmann, lucy
2023-08-28 10:14:19 +00:00
Darragh Clarke
1664e793eb 8311792: java/net/httpclient/ResponsePublisher.java fails intermittently with AssertionError: Found some outstanding operations
Reviewed-by: dfuchs, jpai
2023-08-28 10:03:42 +00:00
Pavel Rappo
0901d75e07 8314762: Make {@Incubating} conventional
Reviewed-by: jjg, iris, chegar
2023-08-28 09:38:02 +00:00
Daniel Jeliński
12de9b0225 8314148: Fix variable scope in SunMSCAPI
Reviewed-by: valeriep
2023-08-28 05:27:25 +00:00
Amit Kumar
7fbad4cd5e 8310596: Utilize existing method frame::interpreter_frame_monitor_size_in_bytes()
Reviewed-by: dholmes, stefank
2023-08-28 03:34:20 +00:00
Ioi Lam
752a438f99 8314684: Add overview docs to loaderConstraints.cpp
Reviewed-by: ccheung, dholmes
2023-08-27 03:44:38 +00:00
Doug Simon
acd9310234 8313430: [JVMCI] fatal error: Never compilable: in JVMCI shutdown
Reviewed-by: never, kvn, shade
2023-08-26 10:13:23 +00:00
Chris Plummer
8a5db6bab3 8237542: JMapHeapConfigTest.java doesn't work with negative jlong values
Reviewed-by: sspitsyn, shade
2023-08-25 23:16:02 +00:00
Chris Plummer
d0cc0439c0 8314550: [macosx-aarch64] serviceability/sa/TestJmapCore.java fails with "sun.jvm.hotspot.debugger.UnmappedAddressException: 801000800"
Reviewed-by: dholmes, iklam, stuefe
2023-08-25 21:14:33 +00:00
Erik Joelsson
837d2e1cac 8314483: Optionally override copyright header in generated source
Reviewed-by: dholmes, iris
2023-08-25 20:42:14 +00:00
Erik Joelsson
320162395d 8310454: Introduce static-libs-graal bundle
Reviewed-by: jiangli
2023-08-25 20:35:40 +00:00
Rajan Halade
e9ba8d5a0e 8314960: Add Certigna Root CA - 2
Reviewed-by: mullan
2023-08-25 18:17:27 +00:00
Quan Anh Mai
837cf85f7d 8312547: Max/Min nodes Value implementation could be improved
Reviewed-by: thartmann, kvn
2023-08-25 17:48:27 +00:00
Leonid Mesnik
7342f5a033 8314333: Update com/sun/jdi/ProcessAttachTest.java to use ProcessTools.createTestJvm(..)
Reviewed-by: cjplummer
2023-08-25 16:18:45 +00:00
Roberto Castañeda Lozano
f139f30695 8315033: Problemlist java/lang/template/StringTemplateTest.java
Reviewed-by: chagedorn
2023-08-25 15:27:24 +00:00
Weibing Xiao
f2383b3cbd 8314063: The socket is not closed in Connection::createSocket when the handshake failed for LDAP connection
Reviewed-by: aefimov, msheppar
2023-08-25 12:20:18 +00:00
Jonas Norlinder
dcd6e75671 8314990: Generational ZGC: Strong OopStorage stats reported as weak roots
Reviewed-by: stefank, eosterlund
2023-08-25 08:10:09 +00:00
Roberto Castañeda Lozano
002b594870 8312749: Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index))
Co-authored-by: Stefan Karlsson <stefank@openjdk.org>
Co-authored-by: Erik Österlund <eosterlund@openjdk.org>
Reviewed-by: thartmann, ayang, kvn
2023-08-25 07:18:34 +00:00
Jie Fu
d024059174 8314951: VM build without C2 still fails after JDK-8313530
Reviewed-by: dnsimon, kvn
2023-08-25 04:59:19 +00:00
Brian Burkhalter
2624324ac2 8219567: Name of first parameter of RandomAccessFile(String,String) is inconsistent
Reviewed-by: jlu, vtewari, rriggs, jpai
2023-08-24 18:18:16 +00:00
Patricio Chilano Mateo
8e4240c316 8314850: SharedRuntime::handle_wrong_method() gets called too often when resolving Continuation.enter
Reviewed-by: rpressler, aph
2023-08-24 18:08:16 +00:00
Alan Bateman
d9fc6b6933 8314759: VirtualThread.parkNanos timeout adjustment when pinned should be replaced
Reviewed-by: aturbanov, shade, dfuchs
2023-08-24 16:51:20 +00:00
Vyom Tewari
acaab6fd74 8306040: HttpResponseInputStream.available() returns 1 on empty stream
Reviewed-by: dfuchs
2023-08-24 15:46:44 +00:00
Aleksey Shipilev
76b9011c9e 8314656: GHA: No need for Debian ports keyring installation after JDK-8313701
Reviewed-by: fyang
2023-08-24 13:49:22 +00:00
Vladimir Petko
e36620d80e 8314554: Debian/Ubuntu should not link OpenJDK with --as-needed link option
Reviewed-by: erikj
2023-08-24 12:27:52 +00:00
Matthias Baesken
97b94cb1cd 8314883: Java_java_util_prefs_FileSystemPreferences_lockFile0 write result errno in missing case
Reviewed-by: jpai, shade, vtewari
2023-08-24 10:44:09 +00:00
Doug Simon
75e19e0d5e 8314819: [JVMCI] HotSpotJVMCIRuntime.lookupType throws unexpected ClassNotFoundException
Reviewed-by: never, thartmann
2023-08-24 10:12:16 +00:00
Gergö Barany
c418933d32 8313530: VM build without C2 fails after JDK-8312579
Reviewed-by: dnsimon, haosun, jiefu, kvn
2023-08-24 08:05:33 +00:00
Thomas Stuefe
de0e46c2f6 8303815: Improve Metaspace test speed
Reviewed-by: stefank, dholmes
2023-08-24 05:38:43 +00:00
Thomas Stuefe
3699666c93 8313319: [linux] mmap should use MAP_FIXED_NOREPLACE if available
Reviewed-by: jsjolen, dholmes
2023-08-24 05:16:58 +00:00
Koichi Sakata
3285a1efc8 8314555: Build with mawk fails on Windows
Reviewed-by: erikj
2023-08-24 00:32:31 +00:00
David Holmes
4a50e87592 8303852: current_stack_region() gets called twice unnecessarily
Reviewed-by: stuefe, pchilanomate
2023-08-23 22:51:31 +00:00
Kim Barrett
c077be4768 8314694: Separate checked_cast from globalDefinitions.hpp
Reviewed-by: stuefe, coleenp, sspitsyn
2023-08-23 22:32:37 +00:00
278 changed files with 6945 additions and 2257 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2022, 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
@@ -104,6 +104,6 @@ runs:
- name: 'Export path to where BootJDK is installed'
id: path-name
run: |
# Export the path
echo 'path=bootjdk/jdk' >> $GITHUB_OUTPUT
# Export the absolute path
echo "path=`pwd`/bootjdk/jdk" >> $GITHUB_OUTPUT
shell: bash

View File

@@ -111,8 +111,7 @@ jobs:
g++-${{ inputs.gcc-major-version }} \
gcc-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
g++-${{ inputs.gcc-major-version }}-${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}} \
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev \
debian-ports-archive-keyring
libxrandr-dev libxtst-dev libcups2-dev libasound2-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-${{ inputs.gcc-major-version }} 100 --slave /usr/bin/g++ g++ /usr/bin/g++-${{ inputs.gcc-major-version }}
- name: 'Check cache for sysroot'
@@ -134,7 +133,6 @@ jobs:
--include=fakeroot,symlinks,build-essential,libx11-dev,libxext-dev,libxrender-dev,libxrandr-dev,libxtst-dev,libxt-dev,libcups2-dev,libfontconfig1-dev,libasound2-dev,libfreetype-dev,libpng-dev
--resolve-deps
--variant=minbase
$(test -n "${{ matrix.debian-keyring }}" && echo "--keyring=${{ matrix.debian-keyring }}")
${{ matrix.debian-version }}
sysroot
${{ matrix.debian-repository }}

View File

@@ -478,6 +478,27 @@ endif
################################################################################
ifneq ($(filter static-libs-graal-bundles, $(MAKECMDGOALS)), )
STATIC_LIBS_GRAAL_BUNDLE_FILES := $(call FindFiles, $(STATIC_LIBS_GRAAL_IMAGE_DIR))
ifeq ($(OPENJDK_TARGET_OS)-$(DEBUG_LEVEL), macosx-release)
STATIC_LIBS_GRAAL_BUNDLE_SUBDIR := $(JDK_MACOSX_CONTENTS_SUBDIR)/Home
else
STATIC_LIBS_GRAAL_BUNDLE_SUBDIR := $(JDK_BUNDLE_SUBDIR)
endif
$(eval $(call SetupBundleFile, BUILD_STATIC_LIBS_GRAAL_BUNDLE, \
BUNDLE_NAME := $(STATIC_LIBS_GRAAL_BUNDLE_NAME), \
FILES := $(STATIC_LIBS_GRAAL_BUNDLE_FILES), \
BASE_DIRS := $(STATIC_LIBS_GRAAL_IMAGE_DIR), \
SUBDIR := $(STATIC_LIBS_GRAAL_BUNDLE_SUBDIR), \
))
STATIC_LIBS_GRAAL_TARGETS += $(BUILD_STATIC_LIBS_GRAAL_BUNDLE)
endif
################################################################################
# Hook to include the corresponding custom file, if present.
$(eval $(call IncludeCustomExtension, Bundles.gmk))
@@ -490,8 +511,9 @@ docs-jdk-bundles: $(DOCS_JDK_TARGETS)
docs-javase-bundles: $(DOCS_JAVASE_TARGETS)
docs-reference-bundles: $(DOCS_REFERENCE_TARGETS)
static-libs-bundles: $(STATIC_LIBS_TARGETS)
static-libs-graal-bundles: $(STATIC_LIBS_GRAAL_TARGETS)
jcov-bundles: $(JCOV_TARGETS)
.PHONY: all default product-bundles test-bundles \
docs-jdk-bundles docs-javase-bundles docs-reference-bundles \
static-libs-bundles jcov-bundles
static-libs-bundles static-libs-graal-bundles jcov-bundles

View File

@@ -66,10 +66,6 @@ MODULES_SOURCE_PATH := $(call PathList, $(call GetModuleSrcPath) )
# In order to get a specific ordering it's necessary to specify the total
# ordering of tags as the tags are otherwise ordered in order of definition.
JAVADOC_TAGS := \
-tag beaninfo:X \
-tag since.unbundled:X \
-tag Note:X \
-tag ToDo:X \
-tag 'apiNote:a:API Note:' \
-tag 'implSpec:a:Implementation Requirements:' \
-tag 'implNote:a:Implementation Note:' \

View File

@@ -851,6 +851,12 @@ $(eval $(call SetupTarget, static-libs-bundles, \
DEPS := static-libs-image, \
))
$(eval $(call SetupTarget, static-libs-graal-bundles, \
MAKEFILE := Bundles, \
TARGET := static-libs-graal-bundles, \
DEPS := static-libs-graal-image, \
))
ifeq ($(JCOV_ENABLED), true)
$(eval $(call SetupTarget, jcov-bundles, \
MAKEFILE := Bundles, \

View File

@@ -137,4 +137,7 @@ PANDOC_HTML_MANPAGE_FILTER := $(BUILDTOOLS_OUTPUTDIR)/manpages/pandoc-html-manpa
##########################################################################################
# Hook to include the corresponding custom post file, if present.
$(eval $(call IncludeCustomExtension, ToolsJdk-post.gmk))
endif # _TOOLS_GMK

View File

@@ -243,8 +243,11 @@ AC_DEFUN([BPERF_SETUP_CCACHE_USAGE],
fi
fi
# The CCACHE_BASEDIR needs to end with '/' as ccache will otherwise think
# directories next to it, that have the base dir name as a prefix, are sub
# directories of CCACHE_BASEDIR.
CCACHE="CCACHE_COMPRESS=1 $SET_CCACHE_DIR \
CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$TOPDIR $CCACHE"
CCACHE_SLOPPINESS=$CCACHE_SLOPPINESS CCACHE_BASEDIR=$WORKSPACE_ROOT/ $CCACHE"
if test "x$SET_CCACHE_DIR" != x; then
mkdir -p $CCACHE_DIR > /dev/null 2>&1

View File

@@ -60,7 +60,8 @@ AC_DEFUN([FLAGS_SETUP_LDFLAGS_HELPER],
# Add -z,defs, to forbid undefined symbols in object files.
# add -z,relro (mark relocations read only) for all libs
# add -z,now ("full relro" - more of the Global Offset Table GOT is marked read only)
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now"
# add --no-as-needed to disable default --as-needed link flag on some GCC toolchains
BASIC_LDFLAGS="-Wl,-z,defs -Wl,-z,relro -Wl,-z,now -Wl,--no-as-needed"
# Linux : remove unused code+data in link step
if test "x$ENABLE_LINKTIME_GC" = xtrue; then
if test "x$OPENJDK_TARGET_CPU" = xs390x; then

View File

@@ -567,8 +567,6 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
HOTSPOT_$1_CPU_DEFINE=PPC64
elif test "x$OPENJDK_$1_CPU" = xppc64le; then
HOTSPOT_$1_CPU_DEFINE=PPC64
elif test "x$OPENJDK_$1_CPU" = xriscv32; then
HOTSPOT_$1_CPU_DEFINE=RISCV32
elif test "x$OPENJDK_$1_CPU" = xriscv64; then
HOTSPOT_$1_CPU_DEFINE=RISCV64
@@ -577,10 +575,14 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS_HELPER],
HOTSPOT_$1_CPU_DEFINE=SPARC
elif test "x$OPENJDK_$1_CPU" = xppc; then
HOTSPOT_$1_CPU_DEFINE=PPC32
elif test "x$OPENJDK_$1_CPU" = xriscv32; then
HOTSPOT_$1_CPU_DEFINE=RISCV32
elif test "x$OPENJDK_$1_CPU" = xs390; then
HOTSPOT_$1_CPU_DEFINE=S390
elif test "x$OPENJDK_$1_CPU" = xs390x; then
HOTSPOT_$1_CPU_DEFINE=S390
elif test "x$OPENJDK_$1_CPU" = xloongarch64; then
HOTSPOT_$1_CPU_DEFINE=LOONGARCH64
elif test "x$OPENJDK_$1_CPU" != x; then
HOTSPOT_$1_CPU_DEFINE=$(echo $OPENJDK_$1_CPU | tr a-z A-Z)
fi

View File

@@ -984,6 +984,7 @@ DOCS_JDK_BUNDLE_NAME := jdk-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
DOCS_JAVASE_BUNDLE_NAME := javase-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
DOCS_REFERENCE_BUNDLE_NAME := jdk-reference-$(BASE_NAME)_doc-api-spec$(DEBUG_PART).tar.gz
STATIC_LIBS_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-static-libs$(DEBUG_PART).tar.gz
STATIC_LIBS_GRAAL_BUNDLE_NAME := jdk-$(BASE_NAME)_bin-static-libs-graal$(DEBUG_PART).tar.gz
JCOV_BUNDLE_NAME := jdk-jcov-$(BASE_NAME)_bin$(DEBUG_PART).$(JDK_BUNDLE_EXTENSION)
JDK_BUNDLE := $(BUNDLES_OUTPUTDIR)/$(JDK_BUNDLE_NAME)

View File

@@ -224,9 +224,12 @@ endif
# object files while CCACHE_BASEDIR will make ccache relativize all paths for
# its compiler. The compiler then produces relative dependency files.
# make does not know a relative and absolute filename is the same so it will
# ignore such dependencies.
# ignore such dependencies. This only applies when the OUTPUTDIR is inside
# the WORKSPACE_ROOT.
ifneq ($(CCACHE), )
REWRITE_PATHS_RELATIVE = true
ifneq ($(filter $(WORKSPACE_ROOT)/%, $(OUTPUTDIR)), )
REWRITE_PATHS_RELATIVE = true
endif
endif
ifeq ($(REWRITE_PATHS_RELATIVE), true)

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2013, 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
@@ -118,7 +118,7 @@ else ifeq ($(call isTargetOs, windows), true)
FILTER_SYMBOLS_AWK_SCRIPT := \
'{ \
if ($$7 ~ /??_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
if ($$7 ~ /\?\?_7.*@@6B@/ && $$7 !~ /type_info/ && $$7 !~ /lambda/) print $$7; \
}'
else

View File

@@ -114,6 +114,7 @@ public class CLDRConverter {
private static Set<String> AVAILABLE_TZIDS;
static int copyrightYear;
static String jdkHeaderTemplate;
private static String zoneNameTempFile;
private static String tzDataDir;
private static final Map<String, String> canonicalTZMap = new HashMap<>();
@@ -229,6 +230,10 @@ public class CLDRConverter {
tzDataDir = args[++i];
break;
case "-jdk-header-template":
jdkHeaderTemplate = Files.readString(Paths.get(args[++i]));
break;
case "-help":
usage();
System.exit(0);
@@ -304,7 +309,9 @@ public class CLDRConverter {
+ "\t-year year copyright year in output%n"
+ "\t-zntempfile template file for java.time.format.ZoneName.java%n"
+ "\t-tzdatadir tzdata directory for java.time.format.ZoneName.java%n"
+ "\t-utf8 use UTF-8 rather than \\uxxxx (for debug)%n");
+ "\t-utf8 use UTF-8 rather than \\uxxxx (for debug)%n"
+ "\t-jdk-header-template <file>%n"
+ "\t\t override default GPL header with contents of file%n");
}
static void info(String fmt, Object... args) {

View File

@@ -174,7 +174,7 @@ class ResourceBundleGenerator implements BundleGenerator {
try (PrintWriter out = new PrintWriter(file, encoding)) {
// Output copyright headers
out.println(CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear));
out.println(getOpenJDKCopyright());
out.println(CopyrightHeaders.getUnicodeCopyright());
if (useJava) {
@@ -294,7 +294,7 @@ class ResourceBundleGenerator implements BundleGenerator {
CLDRConverter.info("Generating file " + file);
try (PrintWriter out = new PrintWriter(file, "us-ascii")) {
out.printf(CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear));
out.printf(getOpenJDKCopyright());
out.printf("""
package sun.util.%s;
@@ -448,4 +448,12 @@ class ResourceBundleGenerator implements BundleGenerator {
});
return tags;
}
private static String getOpenJDKCopyright() {
if (CLDRConverter.jdkHeaderTemplate != null) {
return String.format(CLDRConverter.jdkHeaderTemplate, CLDRConverter.copyrightYear);
} else {
return CopyrightHeaders.getOpenJDKCopyright(CLDRConverter.copyrightYear);
}
}
}

View File

@@ -53,21 +53,38 @@ import java.util.regex.Pattern;
public class EquivMapsGenerator {
public static void main(String[] args) throws Exception {
if (args.length != 3) {
int i = 0;
boolean valid = true;
if (args.length != 5 && args.length !=3) {
valid = false;
} else if (args.length == 5) {
if ("-jdk-header-template".equals(args[i])) {
jdkHeaderTemplate = Files.readString(Paths.get(args[++i]));
i++;
} else {
valid = false;
}
}
if (!valid) {
System.err.println("Usage: java EquivMapsGenerator"
+ " [-jdk-header-template <file>]"
+ " language-subtag-registry.txt LocaleEquivalentMaps.java copyrightYear");
System.exit(1);
}
copyrightYear = Integer.parseInt(args[2]);
readLSRfile(args[0]);
String lsrFile = args[i++];
String outputFile = args[i++];
copyrightYear = Integer.parseInt(args[i++]);
readLSRfile(lsrFile);
// Builds the maps from the IANA data
generateEquivalentMap();
// Writes the maps out to LocaleEquivalentMaps.java
generateSourceCode(args[1]);
generateSourceCode(outputFile);
}
private static String LSRrevisionDate;
private static int copyrightYear;
private static String jdkHeaderTemplate;
private static Map<String, StringBuilder> initialLanguageMap =
new TreeMap<>();
private static Map<String, StringBuilder> initialRegionVariantMap =
@@ -225,6 +242,7 @@ public class EquivMapsGenerator {
try (BufferedWriter writer = Files.newBufferedWriter(
Paths.get(fileName))) {
writer.write(getOpenJDKCopyright());
writer.write("\n");
writer.write(HEADER_TEXT);
writer.write(getMapsText());
writer.write(getLSRText());
@@ -241,7 +259,8 @@ public class EquivMapsGenerator {
}
private static String getOpenJDKCopyright() {
return String.format(Locale.US, COPYRIGHT, copyrightYear);
return String.format(Locale.US,
(jdkHeaderTemplate != null ? jdkHeaderTemplate : COPYRIGHT), copyrightYear);
}
private static final String COPYRIGHT =
@@ -270,7 +289,6 @@ public class EquivMapsGenerator {
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
""";
private static final String HEADER_TEXT =

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 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
@@ -52,7 +52,7 @@ public class Incubating implements Taglet {
@Override
public String getName() {
return "Incubating";
return "incubating";
}
private static final String MESSAGE =

View File

@@ -28,6 +28,7 @@
#include "asm/register.hpp"
#include "metaprogramming/enableIf.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/debug.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"

View File

@@ -626,7 +626,7 @@ void InterpreterMacroAssembler::remove_activation(
// Check that all monitors are unlocked
{
Label loop, exception, entry, restart;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
const Address monitor_block_top(
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(

View File

@@ -27,6 +27,7 @@
#define CPU_AARCH64_REGISTER_AARCH64_HPP
#include "asm/register.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/powerOfTwo.hpp"
class VMRegImpl;

View File

@@ -51,6 +51,7 @@
#include "runtime/stubCodeGenerator.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/align.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/powerOfTwo.hpp"
#ifdef COMPILER2

View File

@@ -53,6 +53,7 @@
#include "runtime/synchronizer.hpp"
#include "runtime/timer.hpp"
#include "runtime/vframeArray.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/debug.hpp"
#include "utilities/powerOfTwo.hpp"
#include <sys/types.h>
@@ -691,7 +692,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
// monitor entry size: see picture of stack set
// (generate_method_entry) and frame_amd64.hpp
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
// total overhead size: entry_size + (saved rbp through expr stack
// bottom). be sure to change this if you add/subtract anything
@@ -772,7 +773,7 @@ void TemplateInterpreterGenerator::lock_method() {
const Address monitor_block_top(
rfp,
frame::interpreter_frame_monitor_block_top_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
#ifdef ASSERT
{

View File

@@ -3864,7 +3864,7 @@ void TemplateTable::monitorenter()
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
rfp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
Label allocated;
@@ -3967,7 +3967,7 @@ void TemplateTable::monitorexit()
rfp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
rfp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
Label found;

View File

@@ -815,7 +815,7 @@ void InterpreterMacroAssembler::remove_activation(TosState state, Register ret_a
{
Label loop;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
const Register Rbottom = R3;
const Register Rcur_obj = Rtemp;

View File

@@ -531,7 +531,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
const Register RmaxStack = R2;
// monitor entry size
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
// total overhead size: entry_size + (saved registers, thru expr stack bottom).
// be sure to change this if you add/subtract anything to/from the overhead area
@@ -570,7 +570,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
void TemplateInterpreterGenerator::lock_method() {
// synchronize method
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
assert ((entry_size % StackAlignmentInBytes) == 0, "should keep stack alignment");
#ifdef ASSERT

View File

@@ -4281,7 +4281,7 @@ void TemplateTable::monitorenter() {
// check for null object
__ null_check(Robj, Rtemp);
const int entry_size = (frame::interpreter_frame_monitor_size() * wordSize);
const int entry_size = (frame::interpreter_frame_monitor_size_in_bytes());
assert (entry_size % StackAlignmentInBytes == 0, "keep stack alignment");
Label allocate_monitor, allocated;
@@ -4392,7 +4392,7 @@ void TemplateTable::monitorexit() {
// check for null object
__ null_check(Robj, Rtemp);
const int entry_size = (frame::interpreter_frame_monitor_size() * wordSize);
const int entry_size = (frame::interpreter_frame_monitor_size_in_bytes());
Label found, throw_exception;
// find matching slot

View File

@@ -424,9 +424,6 @@
template <typename RegisterMapT>
static void update_map_with_saved_link(RegisterMapT* map, intptr_t** link_addr);
// Size of a monitor in bytes.
static int interpreter_frame_monitor_size_in_bytes();
// The size of a cInterpreter object.
static inline int interpreter_frame_cinterpreterstate_size_in_bytes();

View File

@@ -254,10 +254,6 @@ inline int frame::interpreter_frame_monitor_size() {
return BasicObjectLock::size();
}
inline int frame::interpreter_frame_monitor_size_in_bytes() {
return frame::interpreter_frame_monitor_size() * wordSize;
}
// entry frames
inline intptr_t* frame::entry_frame_argument_at(int offset) const {

View File

@@ -4198,7 +4198,7 @@ void TemplateTable::monitorenter() {
// Pre-load topmost slot.
__ ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size_in_bytes());
// The search loop.
__ bind(Lloop);
// Found free slot?
@@ -4212,7 +4212,7 @@ void TemplateTable::monitorenter() {
__ bgt(reached_limit, Lallocate_new);
// Check if last allocated BasicLockObj reached.
__ ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size_in_bytes());
// Next iteration if unchecked BasicObjectLocks exist on the stack.
__ b(Lloop);
}
@@ -4221,8 +4221,8 @@ void TemplateTable::monitorenter() {
// Check if we found a free slot.
__ bind(Lexit);
__ addi(Rcurrent_monitor, Rcurrent_obj_addr, -(frame::interpreter_frame_monitor_size() * wordSize) - in_bytes(BasicObjectLock::obj_offset()));
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, - frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_monitor, Rcurrent_obj_addr, -(frame::interpreter_frame_monitor_size_in_bytes()) - in_bytes(BasicObjectLock::obj_offset()));
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, - frame::interpreter_frame_monitor_size_in_bytes());
__ b(Lfound);
// We didn't find a free BasicObjLock => allocate one.
@@ -4280,7 +4280,7 @@ void TemplateTable::monitorexit() {
__ addi(Rcurrent_obj_addr, R26_monitor, in_bytes(BasicObjectLock::obj_offset()));
__ addi(Rlimit, Rlimit, in_bytes(BasicObjectLock::obj_offset()));
__ ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size_in_bytes());
__ bind(Lloop);
// Is this entry for same obj?
@@ -4291,7 +4291,7 @@ void TemplateTable::monitorexit() {
__ ld(Rcurrent_obj, 0, Rcurrent_obj_addr);
__ cmpld(CCR0, Rcurrent_obj_addr, Rlimit);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size() * wordSize);
__ addi(Rcurrent_obj_addr, Rcurrent_obj_addr, frame::interpreter_frame_monitor_size_in_bytes());
// Next iteration if unchecked BasicObjectLocks exist on the stack.
__ ble(CCR0, Lloop);
@@ -4305,7 +4305,7 @@ void TemplateTable::monitorexit() {
__ align(32, 12);
__ bind(Lfound);
__ addi(Rcurrent_monitor, Rcurrent_obj_addr,
-(frame::interpreter_frame_monitor_size() * wordSize) - in_bytes(BasicObjectLock::obj_offset()));
-(frame::interpreter_frame_monitor_size_in_bytes()) - in_bytes(BasicObjectLock::obj_offset()));
__ unlock_object(Rcurrent_monitor);
}

View File

@@ -28,6 +28,7 @@
#include <cstdint>
#include "asm/register.hpp"
#include "utilities/checkedCast.hpp"
// keep in sync with jdk/internal/foreign/abi/ppc64/PPC64Architecture
enum class StorageType : int8_t {

View File

@@ -694,7 +694,7 @@ void InterpreterMacroAssembler::remove_activation(
// Check that all monitors are unlocked
{
Label loop, exception, entry, restart;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
const Address monitor_block_top(
fp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(

View File

@@ -27,6 +27,7 @@
#define CPU_RISCV_REGISTER_RISCV_HPP
#include "asm/register.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/powerOfTwo.hpp"
#define CSR_FFLAGS 0x001 // Floating-Point Accrued Exceptions.

View File

@@ -53,6 +53,7 @@
#include "runtime/synchronizer.hpp"
#include "runtime/timer.hpp"
#include "runtime/vframeArray.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/debug.hpp"
#include "utilities/powerOfTwo.hpp"
#include <sys/types.h>
@@ -603,7 +604,7 @@ void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
// monitor entry size: see picture of stack set
// (generate_method_entry) and frame_amd64.hpp
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
// total overhead size: entry_size + (saved fp through expr stack
// bottom). be sure to change this if you add/subtract anything
@@ -676,7 +677,7 @@ void TemplateInterpreterGenerator::lock_method() {
// synchronize method
const Address access_flags(xmethod, Method::access_flags_offset());
const Address monitor_block_top(fp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
#ifdef ASSERT
__ lwu(x10, access_flags);

View File

@@ -3799,7 +3799,7 @@ void TemplateTable::monitorenter() {
fp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
fp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
Label allocated;
@@ -3897,7 +3897,7 @@ void TemplateTable::monitorexit() {
fp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
fp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
Label found;

View File

@@ -1,7 +1,7 @@
/*
* Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
* Copyright (c) 2020, 2022, Huawei Technologies Co., Ltd. All rights reserved.
* Copyright (c) 2020, 2023, Huawei Technologies Co., Ltd. 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
@@ -25,8 +25,8 @@
*/
#include "precompiled.hpp"
#include "asm/assembler.inline.hpp"
#include "asm/macroAssembler.inline.hpp"
#include "assembler_riscv.inline.hpp"
#include "code/vtableStubs.hpp"
#include "interp_masm_riscv.hpp"
#include "memory/resourceArea.hpp"

View File

@@ -488,11 +488,6 @@
template <typename RegisterMapT>
static void update_map_with_saved_link(RegisterMapT* map, intptr_t** link_addr);
// Additional interface for interpreter frames:
static int interpreter_frame_interpreterstate_size_in_bytes();
static int interpreter_frame_monitor_size_in_bytes();
// template interpreter state
inline z_ijava_state* ijava_state_unchecked() const;

View File

@@ -252,15 +252,6 @@ inline int frame::interpreter_frame_monitor_size() {
return BasicObjectLock::size();
}
inline int frame::interpreter_frame_monitor_size_in_bytes() {
// Number of bytes for a monitor.
return frame::interpreter_frame_monitor_size() * wordSize;
}
inline int frame::interpreter_frame_interpreterstate_size_in_bytes() {
return z_ijava_state_size;
}
inline Method** frame::interpreter_frame_method_addr() const {
return (Method**)&(ijava_state()->method);
}

View File

@@ -839,7 +839,7 @@ void InterpreterMacroAssembler::unlock_if_synchronized_method(TosState state,
// Check that all monitors are unlocked.
{
NearLabel loop, exception, entry, restart;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
// We use Z_ARG2 so that if we go slow path it will be the correct
// register for unlock_object to pass to VM directly.
Register R_current_monitor = Z_ARG2;
@@ -2039,7 +2039,7 @@ void InterpreterMacroAssembler::add_monitor_to_stack(bool stack_is_empty,
const Register Rcurr_slot = Rtemp1;
const Register Rlimit = Rtemp2;
const jint delta = -frame::interpreter_frame_monitor_size() * wordSize;
const jint delta = -frame::interpreter_frame_monitor_size_in_bytes();
assert((delta & LongAlignmentMask) == 0,
"sizeof BasicObjectLock must be even number of doublewords");

View File

@@ -4144,7 +4144,7 @@ void TemplateTable::monitorenter() {
// Check for null object.
__ null_check(Z_tos);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
NearLabel allocated;
// Initialize entry pointer.
const Register Rfree_slot = Z_tmp_1;
@@ -4239,7 +4239,7 @@ void TemplateTable::monitorexit() {
// Find matching slot.
{
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
NearLabel entry, loop;
const Register Rbot = Z_ARG3; // Points to word under bottom of monitor block.

View File

@@ -27,6 +27,7 @@
#include <cstdint>
#include "asm/register.hpp"
#include "utilities/checkedCast.hpp"
enum class StorageType : int8_t {
INTEGER = 0,

View File

@@ -35,6 +35,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/macros.hpp"
#ifdef PRODUCT
@@ -6231,11 +6232,17 @@ void Assembler::subss(XMMRegister dst, Address src) {
emit_operand(dst, src, 0);
}
void Assembler::testb(Register dst, int imm8) {
void Assembler::testb(Register dst, int imm8, bool use_ral) {
NOT_LP64(assert(dst->has_byte_register(), "must have byte register"));
if (dst == rax) {
emit_int8((unsigned char)0xA8);
emit_int8(imm8);
if (use_ral) {
emit_int8((unsigned char)0xA8);
emit_int8(imm8);
} else {
emit_int8((unsigned char)0xF6);
emit_int8((unsigned char)0xC4);
emit_int8(imm8);
}
} else {
(void) prefix_and_encode(dst->encoding(), true);
emit_arith_b(0xF6, 0xC0, dst, imm8);
@@ -10966,6 +10973,36 @@ void Assembler::emit_operand32(Register reg, Address adr, int post_addr_length)
emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, adr._rspec, post_addr_length);
}
void Assembler::fld_d(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDD);
emit_operand32(rax, adr, 0);
}
void Assembler::fprem() {
emit_int16((unsigned char)0xD9, (unsigned char)0xF8);
}
void Assembler::fnstsw_ax() {
emit_int16((unsigned char)0xDF, (unsigned char)0xE0);
}
void Assembler::fstp_d(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDD);
emit_operand32(rbx, adr, 0);
}
void Assembler::fstp_d(int index) {
emit_farith(0xDD, 0xD8, index);
}
void Assembler::emit_farith(int b1, int b2, int i) {
assert(isByte(b1) && isByte(b2), "wrong opcode");
assert(0 <= i && i < 8, "illegal stack offset");
emit_int16(b1, b2 + i);
}
#ifndef _LP64
// 32bit only pieces of the assembler
@@ -11009,12 +11046,6 @@ void Assembler::decl(Register dst) {
// 64bit doesn't use the x87
void Assembler::emit_farith(int b1, int b2, int i) {
assert(isByte(b1) && isByte(b2), "wrong opcode");
assert(0 <= i && i < 8, "illegal stack offset");
emit_int16(b1, b2 + i);
}
void Assembler::fabs() {
emit_int16((unsigned char)0xD9, (unsigned char)0xE1);
}
@@ -11176,12 +11207,6 @@ void Assembler::fld1() {
emit_int16((unsigned char)0xD9, (unsigned char)0xE8);
}
void Assembler::fld_d(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDD);
emit_operand32(rax, adr, 0);
}
void Assembler::fld_s(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xD9);
@@ -11265,14 +11290,6 @@ void Assembler::fnstcw(Address src) {
emit_operand32(rdi, src, 0);
}
void Assembler::fnstsw_ax() {
emit_int16((unsigned char)0xDF, (unsigned char)0xE0);
}
void Assembler::fprem() {
emit_int16((unsigned char)0xD9, (unsigned char)0xF8);
}
void Assembler::fprem1() {
emit_int16((unsigned char)0xD9, (unsigned char)0xF5);
}
@@ -11303,16 +11320,6 @@ void Assembler::fst_s(Address adr) {
emit_operand32(rdx, adr, 0);
}
void Assembler::fstp_d(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xDD);
emit_operand32(rbx, adr, 0);
}
void Assembler::fstp_d(int index) {
emit_farith(0xDD, 0xD8, index);
}
void Assembler::fstp_s(Address adr) {
InstructionMark im(this);
emit_int8((unsigned char)0xD9);

View File

@@ -26,6 +26,7 @@
#define CPU_X86_ASSEMBLER_X86_HPP
#include "asm/register.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/powerOfTwo.hpp"
// Contains all the definitions needed for x86 assembly code generation.
@@ -1244,12 +1245,18 @@ private:
void divss(XMMRegister dst, XMMRegister src);
#ifndef _LP64
void fnstsw_ax();
void fprem();
void fld_d(Address adr);
void fstp_d(Address adr);
void fstp_d(int index);
private:
void emit_farith(int b1, int b2, int i);
public:
#ifndef _LP64
void emms();
void fabs();
@@ -1308,7 +1315,6 @@ private:
void fld1();
void fld_d(Address adr);
void fld_s(Address adr);
void fld_s(int index);
@@ -1337,10 +1343,6 @@ private:
void fnsave(Address dst);
void fnstcw(Address src);
void fnstsw_ax();
void fprem();
void fprem1();
void frstor(Address src);
@@ -1352,8 +1354,6 @@ private:
void fst_d(Address adr);
void fst_s(Address adr);
void fstp_d(Address adr);
void fstp_d(int index);
void fstp_s(Address adr);
void fsub(int i);
@@ -2183,7 +2183,7 @@ private:
void subss(XMMRegister dst, XMMRegister src);
void testb(Address dst, int imm8);
void testb(Register dst, int imm8);
void testb(Register dst, int imm8, bool use_ral = true);
void testl(Address dst, int32_t imm32);
void testl(Register dst, int32_t imm32);

View File

@@ -37,6 +37,7 @@
#include "runtime/os.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/checkedCast.hpp"
int C1_MacroAssembler::lock_object(Register hdr, Register obj, Register disp_hdr, Register tmp, Label& slow_case) {
const int aligned_mask = BytesPerWord -1;

View File

@@ -35,6 +35,7 @@
#include "opto/subnode.hpp"
#include "runtime/objectMonitor.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/checkedCast.hpp"
#ifdef PRODUCT
#define BLOCK_COMMENT(str) /* nothing */

View File

@@ -1079,7 +1079,7 @@ void InterpreterMacroAssembler::remove_activation(
// Check that all monitors are unlocked
{
Label loop, exception, entry, restart;
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
const Address monitor_block_top(
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(

View File

@@ -52,6 +52,7 @@
#include "runtime/safepointMechanism.hpp"
#include "runtime/sharedRuntime.hpp"
#include "runtime/stubRoutines.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/macros.hpp"
#ifdef PRODUCT

View File

@@ -32,6 +32,7 @@
#include "utilities/macros.hpp"
#include "runtime/rtmLocking.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/checkedCast.hpp"
// MacroAssembler extends Assembler by frequently used macros.
//

View File

@@ -27,6 +27,7 @@
#include "asm/register.hpp"
#include "runtime/globals.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/count_leading_zeros.hpp"
#include "utilities/powerOfTwo.hpp"

View File

@@ -33,6 +33,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/safepoint.hpp"
#include "runtime/safepointMechanism.hpp"
#include "utilities/checkedCast.hpp"
void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {

View File

@@ -84,52 +84,18 @@ void SharedRuntime::inline_check_hashcode_from_object_header(MacroAssembler* mas
}
#endif //COMPILER1
#if defined(TARGET_COMPILER_gcc) && !defined(_WIN64)
JRT_LEAF(jfloat, SharedRuntime::frem(jfloat x, jfloat y))
jfloat retval;
const bool is_LP64 = LP64_ONLY(true) NOT_LP64(false);
if (!is_LP64 || UseAVX < 1 || !UseFMA) {
asm ("\
1: \n\
fprem \n\
fnstsw %%ax \n\
test $0x4,%%ah \n\
jne 1b \n\
"
:"=t"(retval)
:"0"(x), "u"(y)
:"cc", "ax");
} else {
assert(StubRoutines::fmod() != nullptr, "");
jdouble (*addr)(jdouble, jdouble) = (double (*)(double, double))StubRoutines::fmod();
jdouble dx = (jdouble) x;
jdouble dy = (jdouble) y;
assert(StubRoutines::fmod() != nullptr, "");
jdouble (*addr)(jdouble, jdouble) = (double (*)(double, double))StubRoutines::fmod();
jdouble dx = (jdouble) x;
jdouble dy = (jdouble) y;
retval = (jfloat) (*addr)(dx, dy);
}
return retval;
return (jfloat) (*addr)(dx, dy);
JRT_END
JRT_LEAF(jdouble, SharedRuntime::drem(jdouble x, jdouble y))
jdouble retval;
const bool is_LP64 = LP64_ONLY(true) NOT_LP64(false);
if (!is_LP64 || UseAVX < 1 || !UseFMA) {
asm ("\
1: \n\
fprem \n\
fnstsw %%ax \n\
test $0x4,%%ah \n\
jne 1b \n\
"
:"=t"(retval)
:"0"(x), "u"(y)
:"cc", "ax");
} else {
assert(StubRoutines::fmod() != nullptr, "");
jdouble (*addr)(jdouble, jdouble) = (double (*)(double, double))StubRoutines::fmod();
assert(StubRoutines::fmod() != nullptr, "");
jdouble (*addr)(jdouble, jdouble) = (double (*)(double, double))StubRoutines::fmod();
retval = (*addr)(x, y);
}
return retval;
return (*addr)(x, y);
JRT_END
#endif // TARGET_COMPILER_gcc && !_WIN64

View File

@@ -57,6 +57,7 @@
#include "runtime/vframeArray.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/align.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/formatBuffer.hpp"
#include "vmreg_x86.inline.hpp"
#ifdef COMPILER1

View File

@@ -3897,6 +3897,8 @@ address StubGenerator::generate_throw_exception(const char* name,
void StubGenerator::create_control_words() {
// Round to nearest, 64-bit mode, exceptions masked
StubRoutines::x86::_mxcsr_std = 0x1F80;
// Round to zero, 64-bit mode, exceptions masked
StubRoutines::x86::_mxcsr_rz = 0x7F80;
}
// Initialization
@@ -3979,9 +3981,7 @@ void StubGenerator::generate_initial_stubs() {
generate_libm_stubs();
if ((UseAVX >= 1) && (VM_Version::supports_avx512vlbwdq() || VM_Version::supports_fma())) {
StubRoutines::_fmod = generate_libmFmod(); // from stubGenerator_x86_64_fmod.cpp
}
StubRoutines::_fmod = generate_libmFmod(); // from stubGenerator_x86_64_fmod.cpp
}
void StubGenerator::generate_continuation_stubs() {

View File

@@ -27,6 +27,7 @@
#include "precompiled.hpp"
#include "macroAssembler_x86.hpp"
#include "stubGenerator_x86_64.hpp"
#include "runtime/stubRoutines.hpp"
/******************************************************************************/
// ALGORITHM DESCRIPTION - FMOD()
@@ -72,6 +73,7 @@ ATTRIBUTE_ALIGNED(32) static const uint64_t CONST_e307[] = {
};
address StubGenerator::generate_libmFmod() {
__ align(CodeEntryAlignment);
StubCodeMark mark(this, "StubRoutines", "libmFmod");
address start = __ pc();
__ enter(); // required for proper stackwalking of RuntimeStub frame
@@ -287,21 +289,11 @@ address StubGenerator::generate_libmFmod() {
// {
// double a, b, sgn_a, q, bs, bs2, corr, res;
// unsigned eq;
// unsigned mxcsr, mxcsr_rz;
// __asm { stmxcsr DWORD PTR[mxcsr] }
// mxcsr_rz = 0x7f80 | mxcsr;
__ push(rax);
__ stmxcsr(Address(rsp, 0));
__ movl(rax, Address(rsp, 0));
__ movl(rcx, rax);
__ orl(rcx, 0x7f80);
__ movl(Address(rsp, 0x04), rcx);
// // |x|, |y|
// a = DP_AND(x, DP_CONST(7fffffffffffffff));
__ movq(xmm2, xmm0);
__ vmovdqu(xmm3, ExternalAddress((address)CONST_NaN), rcx);
__ movdqu(xmm3, ExternalAddress((address)CONST_NaN), rcx);
__ vpand(xmm4, xmm2, xmm3, Assembler::AVX_128bit);
// b = DP_AND(y, DP_CONST(7fffffffffffffff));
__ vpand(xmm3, xmm1, xmm3, Assembler::AVX_128bit);
@@ -313,18 +305,16 @@ address StubGenerator::generate_libmFmod() {
// if (a < b) return x + sgn_a;
__ ucomisd(xmm3, xmm4);
__ jcc(Assembler::belowEqual, L_104a);
__ jccb(Assembler::belowEqual, L_104a);
__ vaddsd(xmm0, xmm2, xmm0);
__ jmp(L_11bd);
// if (((mxcsr & 0x6000)!=0x2000) && (a < b * 0x1p+260))
// if (a < b * 0x1p+260)
__ bind(L_104a);
__ andl(rax, 0x6000);
__ cmpl(rax, 0x2000);
__ jcc(Assembler::equal, L_10c1);
__ vmulsd(xmm0, xmm3, ExternalAddress((address)CONST_1p260), rax);
__ ucomisd(xmm0, xmm4);
__ jcc(Assembler::belowEqual, L_10c1);
__ jccb(Assembler::belowEqual, L_10c1);
// {
// q = DP_DIV(a, b);
__ vdivpd(xmm0, xmm4, xmm3, Assembler::AVX_128bit);
@@ -340,7 +330,7 @@ address StubGenerator::generate_libmFmod() {
__ vroundsd(xmm0, xmm0, xmm0, 3);
// a = DP_FNMA(b, q, a);
__ vfnmadd213sd(xmm0, xmm3, xmm4);
__ align32();
__ align(16);
// while (b <= a)
__ bind(L_1090);
__ ucomisd(xmm0, xmm3);
@@ -359,14 +349,14 @@ address StubGenerator::generate_libmFmod() {
__ vroundsd(xmm4, xmm4, xmm4, 3);
// a = DP_FNMA(b, q, a);
__ vfnmadd231sd(xmm0, xmm3, xmm4);
__ jmp(L_1090);
__ jmpb(L_1090);
// }
// return DP_XOR(a, sgn_a);
// }
// __asm { ldmxcsr DWORD PTR [mxcsr_rz] }
__ bind(L_10c1);
__ ldmxcsr(Address(rsp, 0x04));
__ ldmxcsr(ExternalAddress(StubRoutines::x86::addr_mxcsr_rz()), rax /*rscratch*/);
// q = DP_DIV(a, b);
__ vdivpd(xmm0, xmm4, xmm3, Assembler::AVX_128bit);
@@ -378,7 +368,7 @@ address StubGenerator::generate_libmFmod() {
// if (__builtin_expect((eq >= 0x7fefffffu), (0==1))) goto SPECIAL_FMOD;
__ cmpl(rax, 0x7feffffe);
__ jcc(Assembler::above, L_10e7);
__ jccb(Assembler::above, L_10e7);
// a = DP_FNMA(b, q, a);
__ vfnmadd213sd(xmm0, xmm3, xmm4);
@@ -391,31 +381,31 @@ address StubGenerator::generate_libmFmod() {
__ bind(L_10e7);
__ vpxor(xmm5, xmm5, xmm5, Assembler::AVX_128bit);
__ ucomisd(xmm3, xmm5);
__ jcc(Assembler::notEqual, L_10f3);
__ jcc(Assembler::noParity, L_111c);
__ jccb(Assembler::notEqual, L_10f3);
__ jccb(Assembler::noParity, L_111c);
__ bind(L_10f3);
__ movsd(xmm5, ExternalAddress((address)CONST_MAX), rax);
__ ucomisd(xmm5, xmm4);
__ jcc(Assembler::below, L_111c);
__ jccb(Assembler::below, L_111c);
// return res;
// }
// // y is NaN?
// if (!(b <= DP_CONST(7ff0000000000000))) {
__ movsd(xmm0, ExternalAddress((address)CONST_INF), rax);
__ ucomisd(xmm0, xmm3);
__ jcc(Assembler::aboveEqual, L_112a);
__ jccb(Assembler::aboveEqual, L_112a);
// res = y + y;
__ vaddsd(xmm0, xmm1, xmm1);
// __asm { ldmxcsr DWORD PTR[mxcsr] }
__ ldmxcsr(Address(rsp, 0));
__ ldmxcsr(ExternalAddress(StubRoutines::x86::addr_mxcsr_std()), rax /*rscratch*/);
__ jmp(L_11bd);
// {
// res = DP_FNMA(b, q, a); // NaN
__ bind(L_111c);
__ vfnmadd213sd(xmm0, xmm3, xmm4);
// __asm { ldmxcsr DWORD PTR[mxcsr] }
__ ldmxcsr(Address(rsp, 0));
__ ldmxcsr(ExternalAddress(StubRoutines::x86::addr_mxcsr_std()), rax /*rscratch*/);
__ jmp(L_11bd);
// return res;
// }
@@ -435,14 +425,14 @@ address StubGenerator::generate_libmFmod() {
// if (eq >= 0x7fefffffu)
__ cmpl(rax, 0x7fefffff);
__ jcc(Assembler::below, L_116e);
__ jccb(Assembler::below, L_116e);
// {
// // b* 2*1023 * 2^1023
// bs2 = bs * DP_CONST(7fe0000000000000);
__ vmulsd(xmm0, xmm1, ExternalAddress((address)CONST_e307), rax);
// while (bs2 <= a)
__ ucomisd(xmm4, xmm0);
__ jcc(Assembler::below, L_1173);
__ jccb(Assembler::below, L_1173);
// {
// q = DP_DIV(a, bs2);
__ bind(L_1157);
@@ -453,8 +443,8 @@ address StubGenerator::generate_libmFmod() {
__ vfnmadd231sd(xmm4, xmm0, xmm5);
// while (bs2 <= a)
__ ucomisd(xmm4, xmm0);
__ jcc(Assembler::aboveEqual, L_1157);
__ jmp(L_1173);
__ jccb(Assembler::aboveEqual, L_1157);
__ jmpb(L_1173);
// }
// }
// else
@@ -465,9 +455,9 @@ address StubGenerator::generate_libmFmod() {
// while (bs <= a)
__ bind(L_1173);
__ ucomisd(xmm4, xmm1);
__ jcc(Assembler::aboveEqual, L_117f);
__ jccb(Assembler::aboveEqual, L_117f);
__ movapd(xmm0, xmm4);
__ jmp(L_11af);
__ jmpb(L_11af);
// {
// q = DP_DIV(a, bs);
__ bind(L_117f);
@@ -480,9 +470,9 @@ address StubGenerator::generate_libmFmod() {
// while (bs <= a)
__ ucomisd(xmm0, xmm1);
__ movapd(xmm4, xmm0);
__ jcc(Assembler::aboveEqual, L_117f);
__ jmp(L_11af);
__ align32();
__ jccb(Assembler::aboveEqual, L_117f);
__ jmpb(L_11af);
__ align(16);
// {
// q = DP_DIV(a, b);
__ bind(L_11a0);
@@ -496,11 +486,11 @@ address StubGenerator::generate_libmFmod() {
// while (b <= a)
__ bind(L_11af);
__ ucomisd(xmm0, xmm3);
__ jcc(Assembler::aboveEqual, L_11a0);
__ jccb(Assembler::aboveEqual, L_11a0);
// }
// __asm { ldmxcsr DWORD PTR[mxcsr] }
__ ldmxcsr(Address(rsp, 0));
__ ldmxcsr(ExternalAddress(StubRoutines::x86::addr_mxcsr_std()), rax /*rscratch*/);
__ bind(L_11b9);
__ vpxor(xmm0, xmm2, xmm0, Assembler::AVX_128bit);
// }
@@ -509,10 +499,23 @@ address StubGenerator::generate_libmFmod() {
// }
__ bind(L_11bd);
__ pop(rax);
} else { // SSE version
assert(false, "SSE not implemented");
Label x87_loop;
__ movsd(Address(rbp, -8), xmm1);
__ movsd(Address(rbp, -16), xmm0);
__ fld_d(Address(rbp, -8));
__ fld_d(Address(rbp, -16));
__ bind(x87_loop);
__ fprem();
__ fnstsw_ax();
__ testb(rax, 0x4, false);
__ jcc(Assembler::notZero, x87_loop);
__ fstp_d(1);
__ fstp_d(Address(rbp, -8));
__ movsd(xmm0, Address(rbp, -8));
}
__ leave(); // required for proper stackwalking of RuntimeStub frame

View File

@@ -126,6 +126,9 @@ class x86 {
private:
static jint _mxcsr_std;
#ifdef _LP64
static jint _mxcsr_rz;
#endif // _LP64
static address _verify_mxcsr_entry;
@@ -207,6 +210,9 @@ class x86 {
public:
static address addr_mxcsr_std() { return (address)&_mxcsr_std; }
#ifdef _LP64
static address addr_mxcsr_rz() { return (address)&_mxcsr_rz; }
#endif // _LP64
static address verify_mxcsr_entry() { return _verify_mxcsr_entry; }
static address crc_by128_masks_addr() { return (address)_crc_by128_masks; }
#ifdef _LP64

View File

@@ -32,6 +32,7 @@
// a description of how to extend it, see the stubRoutines.hpp file.
jint StubRoutines::x86::_mxcsr_std = 0;
jint StubRoutines::x86::_mxcsr_rz = 0;
address StubRoutines::x86::_get_previous_sp_entry = nullptr;

View File

@@ -51,6 +51,7 @@
#include "runtime/synchronizer.hpp"
#include "runtime/timer.hpp"
#include "runtime/vframeArray.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/debug.hpp"
#include "utilities/macros.hpp"
@@ -479,7 +480,7 @@ void TemplateInterpreterGenerator::generate_counter_overflow(Label& do_continue)
void TemplateInterpreterGenerator::generate_stack_overflow_check(void) {
// monitor entry size: see picture of stack in frame_x86.hpp
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
// total overhead size: entry_size + (saved rbp through expr stack
// bottom). be sure to change this if you add/subtract anything
@@ -568,7 +569,7 @@ void TemplateInterpreterGenerator::lock_method() {
const Address monitor_block_top(
rbp,
frame::interpreter_frame_monitor_block_top_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
#ifdef ASSERT
{

View File

@@ -4343,7 +4343,7 @@ void TemplateTable::monitorenter() {
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
Label allocated;
@@ -4440,7 +4440,7 @@ void TemplateTable::monitorexit() {
rbp, frame::interpreter_frame_monitor_block_top_offset * wordSize);
const Address monitor_block_bot(
rbp, frame::interpreter_frame_initial_sp_offset * wordSize);
const int entry_size = frame::interpreter_frame_monitor_size() * wordSize;
const int entry_size = frame::interpreter_frame_monitor_size_in_bytes();
Register rtop = LP64_ONLY(c_rarg1) NOT_LP64(rdx);
Register rbot = LP64_ONLY(c_rarg2) NOT_LP64(rbx);

View File

@@ -38,6 +38,7 @@
#include "runtime/os.inline.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/powerOfTwo.hpp"
#include "utilities/virtualizationSupport.hpp"

View File

@@ -29,6 +29,7 @@
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.inline.hpp"
#include "services/attachListener.hpp"
#include "utilities/checkedCast.hpp"
#include <signal.h>
#include <sys/socket.h>

View File

@@ -74,6 +74,7 @@
#include "services/runtimeService.hpp"
#include "signals_posix.hpp"
#include "utilities/align.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/decoder.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/events.hpp"
@@ -2947,29 +2948,22 @@ void os::Aix::initialize_libperfstat() {
/////////////////////////////////////////////////////////////////////////////
// thread stack
// Get the current stack base from the OS (actually, the pthread library).
// Note: usually not page aligned.
address os::current_stack_base() {
AixMisc::stackbounds_t bounds;
bool rc = AixMisc::query_stack_bounds_for_current_thread(&bounds);
guarantee(rc, "Unable to retrieve stack bounds.");
return bounds.base;
}
// Get the current stack size from the OS (actually, the pthread library).
// Get the current stack base and size from the OS (actually, the pthread library).
// Note: base usually not page aligned.
// Returned size is such that (base - size) is always aligned to page size.
size_t os::current_stack_size() {
void os::current_stack_base_and_size(address* stack_base, size_t* stack_size) {
AixMisc::stackbounds_t bounds;
bool rc = AixMisc::query_stack_bounds_for_current_thread(&bounds);
guarantee(rc, "Unable to retrieve stack bounds.");
// Align the returned stack size such that the stack low address
*stack_base = bounds.base;
// Align the reported stack size such that the stack low address
// is aligned to page size (Note: base is usually not and we do not care).
// We need to do this because caller code will assume stack low address is
// page aligned and will place guard pages without checking.
address low = bounds.base - bounds.size;
address low_aligned = (address)align_up(low, os::vm_page_size());
size_t s = bounds.base - low_aligned;
return s;
*stack_size = bounds.base - low_aligned;
}
// Get the default path to the core file

View File

@@ -28,6 +28,7 @@
#include "runtime/interfaceSupport.inline.hpp"
#include "runtime/os.inline.hpp"
#include "services/attachListener.hpp"
#include "utilities/checkedCast.hpp"
#include <unistd.h>
#include <signal.h>

View File

@@ -29,6 +29,7 @@
#include "runtime/os.inline.hpp"
#include "os_posix.hpp"
#include "services/attachListener.hpp"
#include "utilities/checkedCast.hpp"
#include <unistd.h>
#include <signal.h>

View File

@@ -69,6 +69,7 @@
#include "services/memTracker.hpp"
#include "services/runtimeService.hpp"
#include "utilities/align.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/decoder.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/events.hpp"
@@ -1727,11 +1728,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
static Elf32_Half running_arch_code=EM_SH;
#elif (defined RISCV)
static Elf32_Half running_arch_code=EM_RISCV;
#elif (defined LOONGARCH)
#elif (defined LOONGARCH64)
static Elf32_Half running_arch_code=EM_LOONGARCH;
#else
#error Method os::dll_load requires that one of following is defined:\
AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc
AARCH64, ALPHA, ARM, AMD64, IA32, IA64, LOONGARCH64, M68K, MIPS, MIPSEL, PARISC, __powerpc__, __powerpc64__, RISCV, S390, SH, __sparc
#endif
// Identify compatibility class for VM's architecture and library's architecture
@@ -2830,6 +2831,16 @@ void os::pd_commit_memory_or_exit(char* addr, size_t size, bool exec,
#define MADV_HUGEPAGE 14
#endif
// Note that the value for MAP_FIXED_NOREPLACE differs between architectures, but all architectures
// supported by OpenJDK share the same flag value.
#define MAP_FIXED_NOREPLACE_value 0x100000
#ifndef MAP_FIXED_NOREPLACE
#define MAP_FIXED_NOREPLACE MAP_FIXED_NOREPLACE_value
#else
// Sanity-check our assumed default value if we build with a new enough libc.
static_assert(MAP_FIXED_NOREPLACE == MAP_FIXED_NOREPLACE_value);
#endif
int os::Linux::commit_memory_impl(char* addr, size_t size,
size_t alignment_hint, bool exec) {
int err = os::Linux::commit_memory_impl(addr, size, exec);
@@ -3470,8 +3481,23 @@ bool os::remove_stack_guard_pages(char* addr, size_t size) {
// may not start from the requested address. Unlike Linux mmap(), this
// function returns null to indicate failure.
static char* anon_mmap(char* requested_addr, size_t bytes) {
// MAP_FIXED is intentionally left out, to leave existing mappings intact.
const int flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS;
// If a requested address was given:
//
// The POSIX-conforming way is to *omit* MAP_FIXED. This will leave existing mappings intact.
// If the requested mapping area is blocked by a pre-existing mapping, the kernel will map
// somewhere else. On Linux, that alternative address appears to have no relation to the
// requested address.
// Unfortunately, this is not what we need - if we requested a specific address, we'd want
// to map there and nowhere else. Therefore we will unmap the block again, which means we
// just executed a needless mmap->munmap cycle.
// Since Linux 4.17, the kernel offers MAP_FIXED_NOREPLACE. With this flag, if a pre-
// existing mapping exists, the kernel will not map at an alternative point but instead
// return an error. We can therefore save that unnecessary mmap-munmap cycle.
//
// Backward compatibility: Older kernels will ignore the unknown flag; so mmap will behave
// as in mode (a).
const int flags = MAP_PRIVATE | MAP_NORESERVE | MAP_ANONYMOUS |
((requested_addr != nullptr) ? MAP_FIXED_NOREPLACE : 0);
// Map reserved/uncommitted pages PROT_NONE so we fail early if we
// touch an uncommitted page. Otherwise, the read/write might
@@ -4211,6 +4237,7 @@ char* os::pd_attempt_reserve_memory_at(char* requested_addr, size_t bytes, bool
if (addr != nullptr) {
// mmap() is successful but it fails to reserve at the requested address
log_trace(os, map)("Kernel rejected " PTR_FORMAT ", offered " PTR_FORMAT ".", p2i(requested_addr), p2i(addr));
anon_munmap(addr, bytes);
}
@@ -5369,19 +5396,22 @@ bool os::start_debugging(char *buf, int buflen) {
// | |/
// P2 +------------------------+ Thread::stack_base()
//
// ** P1 (aka bottom) and size (P2 = P1 - size) are the address and stack size
// ** P1 (aka bottom) and size are the address and stack size
// returned from pthread_attr_getstack().
// ** P2 (aka stack top or base) = P1 + size
// ** If adjustStackSizeForGuardPages() is true the guard pages have been taken
// out of the stack size given in pthread_attr. We work around this for
// threads created by the VM. We adjust bottom to be P1 and size accordingly.
//
#ifndef ZERO
static void current_stack_region(address * bottom, size_t * size) {
void os::current_stack_base_and_size(address* base, size_t* size) {
address bottom;
if (os::is_primordial_thread()) {
// primordial thread needs special handling because pthread_getattr_np()
// may return bogus value.
*bottom = os::Linux::initial_thread_stack_bottom();
*size = os::Linux::initial_thread_stack_size();
bottom = os::Linux::initial_thread_stack_bottom();
*size = os::Linux::initial_thread_stack_size();
*base = bottom + *size;
} else {
pthread_attr_t attr;
@@ -5396,42 +5426,28 @@ static void current_stack_region(address * bottom, size_t * size) {
}
}
if (pthread_attr_getstack(&attr, (void **)bottom, size) != 0) {
if (pthread_attr_getstack(&attr, (void **)&bottom, size) != 0) {
fatal("Cannot locate current stack attributes!");
}
*base = bottom + *size;
if (os::Linux::adjustStackSizeForGuardPages()) {
size_t guard_size = 0;
rslt = pthread_attr_getguardsize(&attr, &guard_size);
if (rslt != 0) {
fatal("pthread_attr_getguardsize failed with error = %d", rslt);
}
*bottom += guard_size;
*size -= guard_size;
bottom += guard_size;
*size -= guard_size;
}
pthread_attr_destroy(&attr);
}
assert(os::current_stack_pointer() >= *bottom &&
os::current_stack_pointer() < *bottom + *size, "just checking");
assert(os::current_stack_pointer() >= bottom &&
os::current_stack_pointer() < *base, "just checking");
}
address os::current_stack_base() {
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return (bottom + size);
}
size_t os::current_stack_size() {
// This stack size includes the usable stack and HotSpot guard pages
// (for the threads that have Hotspot guard pages).
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return size;
}
#endif
static inline struct timespec get_mtime(const char* filename) {

View File

@@ -42,6 +42,7 @@
#include "runtime/park.hpp"
#include "runtime/perfMemory.hpp"
#include "utilities/align.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/debug.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/events.hpp"

View File

@@ -42,6 +42,7 @@
#include "runtime/threadCrashProtection.hpp"
#include "signals_posix.hpp"
#include "suspendResume_posix.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/events.hpp"
#include "utilities/ostream.hpp"
#include "utilities/parseInteger.hpp"

View File

@@ -425,40 +425,31 @@ int os::get_native_stack(address* stack, int frames, int toSkip) {
return captured;
}
// os::current_stack_base()
//
// Returns the base of the stack, which is the stack's
// starting address. This function must be called
// while running on the stack of the thread being queried.
address os::current_stack_base() {
void os::current_stack_base_and_size(address* stack_base, size_t* stack_size) {
MEMORY_BASIC_INFORMATION minfo;
address stack_bottom;
size_t stack_size;
size_t size;
VirtualQuery(&minfo, &minfo, sizeof(minfo));
stack_bottom = (address)minfo.AllocationBase;
stack_size = minfo.RegionSize;
stack_bottom = (address)minfo.AllocationBase;
size = minfo.RegionSize;
// Add up the sizes of all the regions with the same
// AllocationBase.
while (1) {
VirtualQuery(stack_bottom+stack_size, &minfo, sizeof(minfo));
VirtualQuery(stack_bottom + size, &minfo, sizeof(minfo));
if (stack_bottom == (address)minfo.AllocationBase) {
stack_size += minfo.RegionSize;
size += minfo.RegionSize;
} else {
break;
}
}
return stack_bottom + stack_size;
}
size_t os::current_stack_size() {
size_t sz;
MEMORY_BASIC_INFORMATION minfo;
VirtualQuery(&minfo, &minfo, sizeof(minfo));
sz = (size_t)os::current_stack_base() - (size_t)minfo.AllocationBase;
return sz;
*stack_base = stack_bottom + size;
*stack_size = size;
}
bool os::committed_in_range(address start, size_t size, address& committed_start, size_t& committed_size) {

View File

@@ -354,13 +354,13 @@ size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
size_t s = (thr_type == os::compiler_thread ? 4 * M : 1 * M);
return s;
}
static void current_stack_region(address * bottom, size_t * size) {
void os::current_stack_base_and_size(address* base, size_t* size) {
address bottom;
#ifdef __APPLE__
pthread_t self = pthread_self();
void *stacktop = pthread_get_stackaddr_np(self);
*base = (address) pthread_get_stackaddr_np(self);
*size = pthread_get_stacksize_np(self);
*bottom = (address) stacktop - *size;
bottom = *base - *size;
#elif defined(__OpenBSD__)
stack_t ss;
int rslt = pthread_stackseg_np(pthread_self(), &ss);
@@ -368,8 +368,9 @@ static void current_stack_region(address * bottom, size_t * size) {
if (rslt != 0)
fatal("pthread_stackseg_np failed with error = %d", rslt);
*bottom = (address)((char *)ss.ss_sp - ss.ss_size);
*size = ss.ss_size;
*base = (address) ss.ss_sp;
*size = ss.ss_size;
bottom = *base - *size;
#else
pthread_attr_t attr;
@@ -384,30 +385,17 @@ static void current_stack_region(address * bottom, size_t * size) {
if (rslt != 0)
fatal("pthread_attr_get_np failed with error = %d", rslt);
if (pthread_attr_getstackaddr(&attr, (void **)bottom) != 0 ||
pthread_attr_getstacksize(&attr, size) != 0) {
if (pthread_attr_getstackaddr(&attr, (void **)&bottom) != 0 ||
pthread_attr_getstacksize(&attr, size) != 0) {
fatal("Can not locate current stack attributes!");
}
*base = bottom + *size;
pthread_attr_destroy(&attr);
#endif
assert(os::current_stack_pointer() >= *bottom &&
os::current_stack_pointer() < *bottom + *size, "just checking");
}
address os::current_stack_base() {
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return (bottom + size);
}
size_t os::current_stack_size() {
// stack size includes normal stack and HotSpot guard pages
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return size;
assert(os::current_stack_pointer() >= bottom &&
os::current_stack_pointer() < *base, "just checking");
}
/////////////////////////////////////////////////////////////////////////////

View File

@@ -79,7 +79,7 @@
# include <pthread_np.h>
#endif
// needed by current_stack_region() workaround for Mavericks
// needed by current_stack_base_and_size() workaround for Mavericks
#if defined(__APPLE__)
# include <errno.h>
# include <sys/types.h>
@@ -709,13 +709,15 @@ size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
// | |/
// P2 +------------------------+ Thread::stack_base()
//
// ** P1 (aka bottom) and size ( P2 = P1 - size) are the address and stack size returned from
// pthread_attr_getstack()
// ** P1 (aka bottom) and size are the address and stack size
// returned from pthread_attr_getstack().
// ** P2 (aka stack top or base) = P1 + size
static void current_stack_region(address * bottom, size_t * size) {
void os::current_stack_base_and_size(address* base, size_t* size) {
address bottom;
#ifdef __APPLE__
pthread_t self = pthread_self();
void *stacktop = pthread_get_stackaddr_np(self);
*base = (address) pthread_get_stackaddr_np(self);
*size = pthread_get_stacksize_np(self);
// workaround for OS X 10.9.0 (Mavericks)
// pthread_get_stacksize_np returns 128 pages even though the actual size is 2048 pages
@@ -738,7 +740,7 @@ static void current_stack_region(address * bottom, size_t * size) {
}
}
}
*bottom = (address) stacktop - *size;
bottom = *base - *size;
#elif defined(__OpenBSD__)
stack_t ss;
int rslt = pthread_stackseg_np(pthread_self(), &ss);
@@ -746,8 +748,9 @@ static void current_stack_region(address * bottom, size_t * size) {
if (rslt != 0)
fatal("pthread_stackseg_np failed with error = %d", rslt);
*bottom = (address)((char *)ss.ss_sp - ss.ss_size);
*size = ss.ss_size;
*base = (address) ss.ss_sp;
*size = ss.ss_size;
bottom = *base - *size;
#else
pthread_attr_t attr;
@@ -762,30 +765,17 @@ static void current_stack_region(address * bottom, size_t * size) {
if (rslt != 0)
fatal("pthread_attr_get_np failed with error = %d", rslt);
if (pthread_attr_getstackaddr(&attr, (void **)bottom) != 0 ||
pthread_attr_getstacksize(&attr, size) != 0) {
if (pthread_attr_getstackaddr(&attr, (void **)&bottom) != 0 ||
pthread_attr_getstacksize(&attr, size) != 0) {
fatal("Can not locate current stack attributes!");
}
*base = bottom + *size;
pthread_attr_destroy(&attr);
#endif
assert(os::current_stack_pointer() >= *bottom &&
os::current_stack_pointer() < *bottom + *size, "just checking");
}
address os::current_stack_base() {
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return (bottom + size);
}
size_t os::current_stack_size() {
// stack size includes normal stack and HotSpot guard pages
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return size;
assert(os::current_stack_pointer() >= bottom &&
os::current_stack_pointer() < *base, "just checking");
}
/////////////////////////////////////////////////////////////////////////////

View File

@@ -176,26 +176,24 @@ size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
return s;
}
static void current_stack_region(address *bottom, size_t *size) {
address stack_bottom;
address stack_top;
size_t stack_bytes;
void os::current_stack_base_and_size(address* base, size_t* size) {
address bottom;
#ifdef __APPLE__
pthread_t self = pthread_self();
stack_top = (address) pthread_get_stackaddr_np(self);
stack_bytes = pthread_get_stacksize_np(self);
stack_bottom = stack_top - stack_bytes;
*base = (address) pthread_get_stackaddr_np(self);
*size = pthread_get_stacksize_np(self);
bottom = *base - *size;
#elif defined(__OpenBSD__)
stack_t ss;
int rslt = pthread_stackseg_np(pthread_self(), &ss);
if (rslt != 0)
fatal("pthread_stackseg_np failed with error = " INT32_FORMAT, rslt);
fatal("pthread_stackseg_np failed with error = %d", rslt);
stack_top = (address) ss.ss_sp;
stack_bytes = ss.ss_size;
stack_bottom = stack_top - stack_bytes;
*base = (address) ss.ss_sp;
*size = ss.ss_size;
bottom = *base - *size;
#else
pthread_attr_t attr;
@@ -203,43 +201,25 @@ static void current_stack_region(address *bottom, size_t *size) {
// JVM needs to know exact stack location, abort if it fails
if (rslt != 0)
fatal("pthread_attr_init failed with error = " INT32_FORMAT, rslt);
fatal("pthread_attr_init failed with error = %d", rslt);
rslt = pthread_attr_get_np(pthread_self(), &attr);
if (rslt != 0)
fatal("pthread_attr_get_np failed with error = " INT32_FORMAT, rslt);
fatal("pthread_attr_get_np failed with error = %d", rslt);
if (pthread_attr_getstackaddr(&attr, (void **) &stack_bottom) != 0 ||
pthread_attr_getstacksize(&attr, &stack_bytes) != 0) {
if (pthread_attr_getstackaddr(&attr, (void **) &bottom) != 0 ||
pthread_attr_getstacksize(&attr, size) != 0) {
fatal("Can not locate current stack attributes!");
}
*base = bottom + *size;
pthread_attr_destroy(&attr);
stack_top = stack_bottom + stack_bytes;
#endif
assert(os::current_stack_pointer() >= stack_bottom, "should do");
assert(os::current_stack_pointer() < stack_top, "should do");
*bottom = stack_bottom;
*size = stack_top - stack_bottom;
}
address os::current_stack_base() {
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return bottom + size;
}
size_t os::current_stack_size() {
// stack size includes normal stack and HotSpot guard pages
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return size;
assert(os::current_stack_pointer() >= bottom &&
os::current_stack_pointer() < *base, "just checking");
}
/////////////////////////////////////////////////////////////////////////////

View File

@@ -100,7 +100,7 @@ static bool is_valid(int64_t key) {
static bool is_set(int64_t key, uint64_t value_mask) {
if (is_valid(key)) {
return query[key].value & value_mask != 0;
return (query[key].value & value_mask) != 0;
}
return false;
}

View File

@@ -306,89 +306,68 @@ size_t os::Posix::default_stack_size(os::ThreadType thr_type) {
return s;
}
static void current_stack_region(address *bottom, size_t *size) {
void os::current_stack_base_and_size(address* base, size_t* size) {
address bottom;
if (os::is_primordial_thread()) {
// primordial thread needs special handling because pthread_getattr_np()
// may return bogus value.
address stack_bottom = os::Linux::initial_thread_stack_bottom();
size_t stack_bytes = os::Linux::initial_thread_stack_size();
bottom = os::Linux::initial_thread_stack_bottom();
*size = os::Linux::initial_thread_stack_size();
*base = bottom + *size;
} else {
assert(os::current_stack_pointer() >= stack_bottom, "should do");
assert(os::current_stack_pointer() < stack_bottom + stack_bytes, "should do");
pthread_attr_t attr;
*bottom = stack_bottom;
*size = stack_bytes;
return;
}
int rslt = pthread_getattr_np(pthread_self(), &attr);
pthread_attr_t attr;
int res = pthread_getattr_np(pthread_self(), &attr);
if (res != 0) {
if (res == ENOMEM) {
vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
// JVM needs to know exact stack location, abort if it fails
if (rslt != 0) {
if (rslt == ENOMEM) {
vm_exit_out_of_memory(0, OOM_MMAP_ERROR, "pthread_getattr_np");
} else {
fatal("pthread_getattr_np failed with error = %d", rslt);
}
}
else {
fatal("pthread_getattr_np failed with error = %d", res);
if (pthread_attr_getstack(&attr, (void **)&bottom, size) != 0) {
fatal("Cannot locate current stack attributes!");
}
}
address stack_bottom;
size_t stack_bytes;
res = pthread_attr_getstack(&attr, (void **) &stack_bottom, &stack_bytes);
if (res != 0) {
fatal("pthread_attr_getstack failed with error = %d", res);
}
address stack_top = stack_bottom + stack_bytes;
*base = bottom + *size;
// The block of memory returned by pthread_attr_getstack() includes
// guard pages where present. We need to trim these off.
size_t page_bytes = os::vm_page_size();
assert(((intptr_t) stack_bottom & (page_bytes - 1)) == 0, "unaligned stack");
// The block of memory returned by pthread_attr_getstack() includes
// guard pages where present. We need to trim these off.
size_t page_bytes = os::vm_page_size();
assert(((intptr_t) bottom & (page_bytes - 1)) == 0, "unaligned stack");
size_t guard_bytes;
res = pthread_attr_getguardsize(&attr, &guard_bytes);
if (res != 0) {
fatal("pthread_attr_getguardsize failed with errno = %d", res);
}
int guard_pages = align_up(guard_bytes, page_bytes) / page_bytes;
assert(guard_bytes == guard_pages * page_bytes, "unaligned guard");
size_t guard_bytes;
rslt = pthread_attr_getguardsize(&attr, &guard_bytes);
if (rslt != 0) {
fatal("pthread_attr_getguardsize failed with errno = %d", rslt);
}
int guard_pages = align_up(guard_bytes, page_bytes) / page_bytes;
assert(guard_bytes == guard_pages * page_bytes, "unaligned guard");
#ifdef IA64
// IA64 has two stacks sharing the same area of memory, a normal
// stack growing downwards and a register stack growing upwards.
// Guard pages, if present, are in the centre. This code splits
// the stack in two even without guard pages, though in theory
// there's nothing to stop us allocating more to the normal stack
// or more to the register stack if one or the other were found
// to grow faster.
int total_pages = align_down(stack_bytes, page_bytes) / page_bytes;
stack_bottom += (total_pages - guard_pages) / 2 * page_bytes;
// IA64 has two stacks sharing the same area of memory, a normal
// stack growing downwards and a register stack growing upwards.
// Guard pages, if present, are in the centre. This code splits
// the stack in two even without guard pages, though in theory
// there's nothing to stop us allocating more to the normal stack
// or more to the register stack if one or the other were found
// to grow faster.
int total_pages = align_down(stack_bytes, page_bytes) / page_bytes;
bottom += (total_pages - guard_pages) / 2 * page_bytes;
#endif // IA64
stack_bottom += guard_bytes;
bottom += guard_bytes;
*size = *base - bottom;
pthread_attr_destroy(&attr);
pthread_attr_destroy(&attr);
}
assert(os::current_stack_pointer() >= stack_bottom, "should do");
assert(os::current_stack_pointer() < stack_top, "should do");
*bottom = stack_bottom;
*size = stack_top - stack_bottom;
}
address os::current_stack_base() {
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return bottom + size;
}
size_t os::current_stack_size() {
// stack size includes normal stack and HotSpot guard pages
address bottom;
size_t size;
current_stack_region(&bottom, &size);
return size;
assert(os::current_stack_pointer() >= bottom &&
os::current_stack_pointer() < *base, "just checking");
}
/////////////////////////////////////////////////////////////////////////////

View File

@@ -32,6 +32,7 @@
#include "runtime/icache.hpp"
#include "runtime/javaThread.hpp"
#include "runtime/os.hpp"
#include "utilities/checkedCast.hpp"
// Implementation of AbstractAssembler
//

View File

@@ -30,6 +30,7 @@
#include "code/oopRecorder.hpp"
#include "code/relocInfo.hpp"
#include "memory/allocation.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/debug.hpp"
#include "utilities/growableArray.hpp"
#include "utilities/macros.hpp"

View File

@@ -45,6 +45,7 @@
#include "runtime/sharedRuntime.hpp"
#include "runtime/vm_version.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/powerOfTwo.hpp"
#include "utilities/macros.hpp"
#if INCLUDE_JFR

View File

@@ -1949,6 +1949,14 @@ void LinearScan::resolve_exception_edge(XHandler* handler, int throwing_op_id, i
// interval at the throwing instruction must be searched using the operands
// of the phi function
Value from_value = phi->operand_at(handler->phi_operand());
if (from_value == nullptr) {
// We have reached here in a kotlin application running with JVMTI
// capability "can_access_local_variables".
// The illegal state is not yet propagated to this phi. Do it here.
phi->make_illegal();
// We can skip the illegal phi edge.
return;
}
// with phi functions it can happen that the same from_value is used in
// multiple mappings, so notify move-resolver that this is allowed

View File

@@ -1656,6 +1656,20 @@ void FileMapInfo::close() {
}
}
/*
* Same as os::map_memory() but also pretouches if AlwaysPreTouch is enabled.
*/
char* map_memory(int fd, const char* file_name, size_t file_offset,
char *addr, size_t bytes, bool read_only,
bool allow_exec, MEMFLAGS flags = mtNone) {
char* mem = os::map_memory(fd, file_name, file_offset, addr, bytes,
AlwaysPreTouch ? false : read_only,
allow_exec, flags);
if (mem != nullptr && AlwaysPreTouch) {
os::pretouch_memory(mem, mem + bytes);
}
return mem;
}
// JVM/TI RedefineClasses() support:
// Remap the shared readonly space to shared readwrite, private.
@@ -1791,9 +1805,9 @@ MapArchiveResult FileMapInfo::map_region(int i, intx addr_delta, char* mapped_ba
// Note that this may either be a "fresh" mapping into unreserved address
// space (Windows, first mapping attempt), or a mapping into pre-reserved
// space (Posix). See also comment in MetaspaceShared::map_archives().
char* base = os::map_memory(_fd, _full_path, r->file_offset(),
requested_addr, size, r->read_only(),
r->allow_exec(), mtClassShared);
char* base = map_memory(_fd, _full_path, r->file_offset(),
requested_addr, size, r->read_only(),
r->allow_exec(), mtClassShared);
if (base != requested_addr) {
log_info(cds)("Unable to map %s shared space at " INTPTR_FORMAT,
shared_region_name[i], p2i(requested_addr));
@@ -1819,8 +1833,8 @@ char* FileMapInfo::map_bitmap_region() {
}
bool read_only = true, allow_exec = false;
char* requested_addr = nullptr; // allow OS to pick any location
char* bitmap_base = os::map_memory(_fd, _full_path, r->file_offset(),
requested_addr, r->used_aligned(), read_only, allow_exec, mtClassShared);
char* bitmap_base = map_memory(_fd, _full_path, r->file_offset(),
requested_addr, r->used_aligned(), read_only, allow_exec, mtClassShared);
if (bitmap_base == nullptr) {
log_info(cds)("failed to map relocation bitmap");
return nullptr;
@@ -2100,9 +2114,9 @@ bool FileMapInfo::map_heap_region_impl() {
// Map the archived heap data. No need to call MemTracker::record_virtual_memory_type()
// for mapped region as it is part of the reserved java heap, which is already recorded.
char* addr = (char*)_mapped_heap_memregion.start();
char* base = os::map_memory(_fd, _full_path, r->file_offset(),
addr, _mapped_heap_memregion.byte_size(), r->read_only(),
r->allow_exec());
char* base = map_memory(_fd, _full_path, r->file_offset(),
addr, _mapped_heap_memregion.byte_size(), r->read_only(),
r->allow_exec());
if (base == nullptr || base != addr) {
dealloc_heap_region();
log_info(cds)("UseSharedSpaces: Unable to map at required address in java heap. "

View File

@@ -31,6 +31,7 @@
#include "oops/constantPool.hpp"
#include "runtime/handles.inline.hpp"
#include "utilities/bytes.hpp"
#include "utilities/checkedCast.hpp"
u2 BytecodeConstantPool::find_or_add(BytecodeCPEntry const& bcpe, TRAPS) {

View File

@@ -75,6 +75,7 @@
#include "services/threadService.hpp"
#include "utilities/align.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/copy.hpp"
#include "utilities/formatBuffer.hpp"
#include "utilities/exceptions.hpp"

View File

@@ -73,6 +73,7 @@
#include "runtime/vm_version.hpp"
#include "services/management.hpp"
#include "services/threadService.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/classpathStream.hpp"
#include "utilities/events.hpp"
#include "utilities/macros.hpp"

View File

@@ -48,6 +48,7 @@
#include "runtime/handles.inline.hpp"
#include "runtime/java.hpp"
#include "runtime/os.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/stringUtils.hpp"
jshort ClassLoaderExt::_app_class_paths_start_index = ClassLoaderExt::max_classpath_index;

View File

@@ -38,7 +38,50 @@
#include "runtime/safepoint.hpp"
#include "utilities/resourceHash.hpp"
// Implementation Classes for Loader Constraints
// Overview
//
// The LoaderConstraintTable controls whether two ClassLoaders can resolve the same class name N
// to different InstanceKlasses.
//
// The design of the algorithm can be found in the OOPSLA'98 paper "Dynamic Class Loading in
// the Java Virtual Machine" by Sheng Liang and Gilad Bracha.
//
// To understand the implementation, start with LoaderConstraintTable::{add_entry, check_or_update}
//
// When a class name N is entered into the LoaderConstraintTable, it's mapped to a ConstraintSet which
// contains one or more LoaderConstraints:
//
// LoaderConstraint_a = { _klass_a, loader_a1, loader_a2, ...}
// LoaderConstraint_b = { _klass_b, loader_b1, loader_b2, ...}
// LoaderConstraint_c = { _klass_c, loader_c1, loader_c2, ...}
// ...
//
// If _klass_<m> is null, when the first loader_<m><n> resolves the name N to a class K,
// we assign _klass_<m> = K.
//
// if _klass_<m> is non-null, when a loader loader_<m><n> tries to resolve the name N to a class K,
// where _klass_<m> != K, a LinkageError is thrown, and the resolution fails.
//
// Management of LoaderConstraints
//
// When the SystemDictionary decides that loader_x and loader_y must resolve the name N to the same class:
// For the name N, find two LoaderConstraints such that:
//
// - LoaderConstraint_x contains loader_x
// - LoaderConstraint_y contains loader_y
//
// (Note that no class loader will appear in more than one LoaderConstraint for
// each name N, as enforced by the following steps).
//
// If neither LoaderConstraint_x nor LoaderConstraint_y exist, add a new LoaderConstraint that contains
// both loader_x and loader_y.
//
// Otherwise if LoaderConstraint_x exists but LoaderConstraint_y doesn't exist, add loader_y to LoaderConstraint_x,
// or vice versa.
//
// Otherwise if both LoaderConstraints have different values for _klass, a LinkageError is thrown.
//
// Otherwise the two LoaderConstraints are merged into one.
class LoaderConstraint : public CHeapObj<mtClass> {
InstanceKlass* _klass;

View File

@@ -26,6 +26,7 @@
#define SHARE_CLASSFILE_STACKMAPTABLEFORMAT_HPP
#include "classfile/verificationType.hpp"
#include "utilities/checkedCast.hpp"
// These classes represent the stack-map substructures described in the JVMS
// (hence the non-conforming naming scheme).

View File

@@ -29,6 +29,7 @@
#include "jvm_constants.h"
#include "jvm_io.h"
#include "runtime/vm_version.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/tribool.hpp"
#include "utilities/xmlstream.hpp"

View File

@@ -34,6 +34,7 @@
#include "runtime/flags/flagSetting.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include "utilities/align.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/copy.hpp"
#include <new>

View File

@@ -28,6 +28,7 @@
#include "memory/allocation.hpp"
#include "oops/oopsHierarchy.hpp"
#include "runtime/osInfo.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"

View File

@@ -30,6 +30,7 @@
#include "oops/oop.inline.hpp"
#include "runtime/mutexLocker.hpp"
#include "utilities/align.hpp"
#include "utilities/checkedCast.hpp"
// Implementation of StubQueue

View File

@@ -28,6 +28,7 @@
#include "asm/register.hpp"
#include "code/vmregTypes.hpp"
#include "runtime/globals.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/macros.hpp"
#include "utilities/ostream.hpp"

View File

@@ -28,6 +28,7 @@
#include "asm/macroAssembler.hpp"
#include "code/vmreg.hpp"
#include "memory/allStatic.hpp"
#include "utilities/checkedCast.hpp"
// A VtableStub holds an individual code stub for a pair (vtable index, #args) for either itables or vtables
// There's a one-to-one relationship between a VtableStub and such a pair.

View File

@@ -2225,7 +2225,7 @@ void CompileBroker::invoke_compiler_on_method(CompileTask* task) {
}
}
}
if (!task->is_success()) {
if (!task->is_success() && !JVMCI::in_shutdown()) {
handle_compile_error(thread, task, nullptr, compilable, failure_reason);
}
if (event.should_commit()) {

View File

@@ -30,6 +30,7 @@
#include "memory/allocation.hpp"
#include "memory/iterator.hpp"
#include "oops/oopsHierarchy.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/growableArray.hpp"
// Interface for generating the frame map for compiled code. A frame map

View File

@@ -158,13 +158,13 @@ void G1BarrierSetC1::post_barrier(LIRAccess& access, LIR_Opr addr, LIR_Opr new_v
__ logical_xor(xor_res, new_val, xor_res);
__ move(xor_res, xor_shift_res);
__ unsigned_shift_right(xor_shift_res,
LIR_OprFact::intConst(HeapRegion::LogOfHRGrainBytes),
LIR_OprFact::intConst(checked_cast<jint>(HeapRegion::LogOfHRGrainBytes)),
xor_shift_res,
LIR_Opr::illegalOpr());
} else {
__ logical_xor(addr, new_val, xor_res);
__ unsigned_shift_right(xor_res,
LIR_OprFact::intConst(HeapRegion::LogOfHRGrainBytes),
LIR_OprFact::intConst(checked_cast<jint>(HeapRegion::LogOfHRGrainBytes)),
xor_shift_res,
LIR_Opr::illegalOpr());
}

View File

@@ -454,7 +454,7 @@ void G1BarrierSetC2::post_barrier(GraphKit* kit,
// Should be able to do an unsigned compare of region_size instead of
// and extra shift. Do we have an unsigned compare??
// Node* region_size = __ ConI(1 << HeapRegion::LogOfHRGrainBytes);
Node* xor_res = __ URShiftX ( __ XorX( cast, __ CastPX(__ ctrl(), val)), __ ConI(HeapRegion::LogOfHRGrainBytes));
Node* xor_res = __ URShiftX ( __ XorX( cast, __ CastPX(__ ctrl(), val)), __ ConI(checked_cast<jint>(HeapRegion::LogOfHRGrainBytes)));
// if (xor_res == 0) same region so skip
__ if_then(xor_res, BoolTest::ne, zeroX, likely); {

View File

@@ -94,7 +94,7 @@ G1Analytics::G1Analytics(const G1Predictions* predictor) :
_recent_prev_end_times_for_all_gcs_sec.add(os::elapsedTime());
_prev_collection_pause_end_ms = os::elapsedTime() * 1000.0;
int index = MIN2(ParallelGCThreads - 1, 7u);
uint index = MIN2(ParallelGCThreads - 1, 7u);
// Start with inverse of maximum STW cost.
_concurrent_refine_rate_ms_seq.add(1/cost_per_logged_card_ms_defaults[0]);

View File

@@ -30,6 +30,7 @@
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/g1/g1HeapVerifier.hpp"
#include "gc/g1/heapRegion.hpp"
#include "gc/g1/heapRegionBounds.inline.hpp"
#include "gc/g1/heapRegionRemSet.hpp"
#include "gc/shared/cardTable.hpp"
#include "gc/shared/gcArguments.hpp"
@@ -131,11 +132,13 @@ void G1Arguments::initialize_mark_stack_size() {
void G1Arguments::initialize_card_set_configuration() {
assert(HeapRegion::LogOfHRGrainBytes != 0, "not initialized");
// Array of Cards card set container globals.
const int LOG_M = 20;
uint region_size_log_mb = (uint)MAX2(HeapRegion::LogOfHRGrainBytes - LOG_M, 0);
const uint LOG_M = 20;
assert(log2i_exact(HeapRegionBounds::min_size()) == LOG_M, "inv");
assert(HeapRegion::LogOfHRGrainBytes >= LOG_M, "from the above");
uint region_size_log_mb = HeapRegion::LogOfHRGrainBytes - LOG_M;
if (FLAG_IS_DEFAULT(G1RemSetArrayOfCardsEntries)) {
uint max_cards_in_inline_ptr = G1CardSetConfiguration::max_cards_in_inline_ptr(HeapRegion::LogOfHRGrainBytes - CardTable::card_shift());
uint max_cards_in_inline_ptr = G1CardSetConfiguration::max_cards_in_inline_ptr(HeapRegion::LogCardsPerRegion);
FLAG_SET_ERGO(G1RemSetArrayOfCardsEntries, MAX2(max_cards_in_inline_ptr * 2,
G1RemSetArrayOfCardsEntriesBase << region_size_log_mb));
}

View File

@@ -46,7 +46,7 @@ inline HeapWord* G1BlockOffsetTablePart::block_start_reaching_into_card(const vo
size_t index = _bot->index_for(addr);
uint offset = _bot->offset_array(index);
u_char offset = _bot->offset_array(index);
while (offset >= BOTConstants::card_size_in_words()) {
// The excess of the offset from N_words indicates a power of Base
// to go back by.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2021, 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
@@ -28,6 +28,7 @@
#include "gc/g1/g1CardSetContainers.hpp"
#include "gc/g1/g1GCPhaseTimes.hpp"
#include "utilities/bitMap.inline.hpp"
#include "utilities/checkedCast.hpp"
#include "utilities/globalDefinitions.hpp"
#include "utilities/spinYield.hpp"

View File

@@ -32,7 +32,7 @@ void G1CardTable::g1_mark_as_young(const MemRegion& mr) {
CardValue *const first = byte_for(mr.start());
CardValue *const last = byte_after(mr.last());
memset_with_concurrent_readers(first, g1_young_gen, last - first);
memset_with_concurrent_readers(first, g1_young_gen, pointer_delta(last, first, sizeof(CardValue)));
}
#ifndef PRODUCT

View File

@@ -31,7 +31,7 @@
inline uint G1CardTable::region_idx_for(CardValue* p) {
size_t const card_idx = pointer_delta(p, _byte_map, sizeof(CardValue));
return (uint)(card_idx >> (HeapRegion::LogOfHRGrainBytes - _card_shift));
return (uint)(card_idx >> HeapRegion::LogCardsPerRegion);
}
inline bool G1CardTable::mark_clean_as_dirty(CardValue* card) {

View File

@@ -390,8 +390,8 @@ G1ConcurrentMark::G1ConcurrentMark(G1CollectedHeap* g1h,
// _num_active_tasks set in set_non_marking_state()
// _tasks set inside the constructor
_task_queues(new G1CMTaskQueueSet((int) _max_num_tasks)),
_terminator((int) _max_num_tasks, _task_queues),
_task_queues(new G1CMTaskQueueSet(_max_num_tasks)),
_terminator(_max_num_tasks, _task_queues),
_first_overflow_barrier_sync(),
_second_overflow_barrier_sync(),
@@ -540,8 +540,8 @@ void G1ConcurrentMark::set_concurrency(uint active_tasks) {
// Need to update the three data structures below according to the
// number of active threads for this phase.
_terminator.reset_for_reuse(active_tasks);
_first_overflow_barrier_sync.set_n_workers((int) active_tasks);
_second_overflow_barrier_sync.set_n_workers((int) active_tasks);
_first_overflow_barrier_sync.set_n_workers(active_tasks);
_second_overflow_barrier_sync.set_n_workers(active_tasks);
}
void G1ConcurrentMark::set_concurrency_and_phase(uint active_tasks, bool concurrent) {

View File

@@ -511,7 +511,7 @@ public:
// running.
void abort_marking_threads();
void update_accum_task_vtime(int i, double vtime) {
void update_accum_task_vtime(uint i, double vtime) {
_accum_task_vtime[i] += vtime;
}

View File

@@ -74,7 +74,7 @@ size_t G1CMObjArrayProcessor::process_slice(HeapWord* slice) {
objArrayOop objArray = objArrayOop(cast_to_oop(start_address));
size_t already_scanned = slice - start_address;
size_t already_scanned = pointer_delta(slice, start_address);
size_t remaining = objArray->size() - already_scanned;
return process_array_slice(objArray, slice, remaining);

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