mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-26 10:10:19 +00:00
Merge branch 'openjdk:master' into jbs8374322
This commit is contained in:
commit
e8b051f2d7
2
.github/actions/build-jtreg/action.yml
vendored
2
.github/actions/build-jtreg/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2023, 2025, 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
|
||||
|
||||
2
.github/actions/get-bundles/action.yml
vendored
2
.github/actions/get-bundles/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
|
||||
2
.github/actions/get-gtest/action.yml
vendored
2
.github/actions/get-gtest/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
|
||||
2
.github/actions/get-jtreg/action.yml
vendored
2
.github/actions/get-jtreg/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2023, 2025, 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
|
||||
|
||||
2
.github/actions/get-msys2/action.yml
vendored
2
.github/actions/get-msys2/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
|
||||
2
.github/actions/upload-bundles/action.yml
vendored
2
.github/actions/upload-bundles/action.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
|
||||
4
.github/workflows/build-alpine-linux.yml
vendored
4
.github/workflows/build-alpine-linux.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2024, 2025, 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
|
||||
@ -96,6 +96,8 @@ jobs:
|
||||
--with-boot-jdk=${{ steps.bootjdk.outputs.path }}
|
||||
--with-zlib=system
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
--with-native-debug-symbols-level=1
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
|
||||
4
.github/workflows/build-cross-compile.yml
vendored
4
.github/workflows/build-cross-compile.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -179,6 +179,8 @@ jobs:
|
||||
--openjdk-target=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}
|
||||
--with-sysroot=sysroot
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
--with-native-debug-symbols-level=1
|
||||
CC=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-gcc-${{ inputs.gcc-major-version }}
|
||||
CXX=${{ matrix.gnu-arch }}-linux-gnu${{ matrix.gnu-abi}}-g++-${{ inputs.gcc-major-version }}
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
|
||||
4
.github/workflows/build-linux.yml
vendored
4
.github/workflows/build-linux.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
@ -143,6 +143,8 @@ jobs:
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--with-zlib=system
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
--with-native-debug-symbols-level=1
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
|
||||
4
.github/workflows/build-macos.yml
vendored
4
.github/workflows/build-macos.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
@ -110,6 +110,8 @@ jobs:
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--with-zlib=system
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
--with-native-debug-symbols-level=1
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
|
||||
3
.github/workflows/build-windows.yml
vendored
3
.github/workflows/build-windows.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
@ -134,6 +134,7 @@ jobs:
|
||||
--with-gtest=${{ steps.gtest.outputs.path }}
|
||||
--with-msvc-toolset-version=${{ inputs.msvc-toolset-version }}
|
||||
--with-jmod-compress=zip-1
|
||||
--with-external-symbols-in-bundles=none
|
||||
${{ inputs.extra-conf-options }} ${{ inputs.configure-arguments }} || (
|
||||
echo "Dumping config.log:" &&
|
||||
cat config.log &&
|
||||
|
||||
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2022, 2025, 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
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/bash -f
|
||||
|
||||
#
|
||||
# Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2010, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
#
|
||||
# This code is free software; you can redistribute it and/or modify it
|
||||
@ -23,9 +23,13 @@
|
||||
# questions.
|
||||
#
|
||||
|
||||
# Script to update the Copyright YEAR range in Mercurial & Git sources.
|
||||
# Script to update the Copyright YEAR range in Git sources.
|
||||
# (Originally from xdono, Thanks!)
|
||||
|
||||
# To update Copyright years for changes in a specific branch,
|
||||
# you use a command along these lines:
|
||||
# $ git diff upstream/master...<branch-name> | lsdiff | cut -d '/' -f 2- | bash bin/update_copyright_year.sh -m -
|
||||
|
||||
#------------------------------------------------------------
|
||||
copyright="Copyright"
|
||||
copyright_symbol="(c)"
|
||||
@ -47,7 +51,7 @@ rm -f -r ${tmp}
|
||||
mkdir -p ${tmp}
|
||||
total=0
|
||||
|
||||
usage="Usage: `basename "$0"` [-c company] [-y year] [-h|f]"
|
||||
usage="Usage: `basename "$0"` [-c company] [-y year] [-m file] [-h|f]"
|
||||
Help()
|
||||
{
|
||||
# Display Help
|
||||
@ -65,15 +69,18 @@ Help()
|
||||
echo "-b Specifies the base reference for change set lookup."
|
||||
echo "-f Updates the copyright for all change sets in a given year,"
|
||||
echo " as specified by -y. Overrides -b flag."
|
||||
echo "-m Read the list of modified files from the given file,"
|
||||
echo " use - to read from stdin"
|
||||
echo "-h Print this help."
|
||||
echo
|
||||
}
|
||||
|
||||
full_year=false
|
||||
base_reference=master
|
||||
modified_files_origin="";
|
||||
|
||||
# Process options
|
||||
while getopts "b:c:fhy:" option; do
|
||||
while getopts "b:c:fhm:y:" option; do
|
||||
case $option in
|
||||
b) # supplied base reference
|
||||
base_reference=${OPTARG}
|
||||
@ -91,6 +98,9 @@ while getopts "b:c:fhy:" option; do
|
||||
y) # supplied company year
|
||||
year=${OPTARG}
|
||||
;;
|
||||
m) # modified files will be read from the given origin
|
||||
modified_files_origin="${OPTARG}"
|
||||
;;
|
||||
\?) # illegal option
|
||||
echo "$usage"
|
||||
exit 1
|
||||
@ -110,18 +120,10 @@ git status &> /dev/null && git_found=true
|
||||
if [ "$git_found" != "true" ]; then
|
||||
echo "Error: Please execute script from within a JDK git repository."
|
||||
exit 1
|
||||
else
|
||||
echo "Using Git version control system"
|
||||
vcs_status=(git ls-files -m)
|
||||
if [ "$full_year" = "true" ]; then
|
||||
vcs_list_changesets=(git log --no-merges --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
|
||||
else
|
||||
vcs_list_changesets=(git log --no-merges "${base_reference}..HEAD" --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
|
||||
fi
|
||||
vcs_changeset_message=(git log -1 --pretty=tformat:"%B") # followed by ${changeset}
|
||||
vcs_changeset_files=(git diff-tree --no-commit-id --name-only -r) # followed by ${changeset}
|
||||
fi
|
||||
|
||||
echo "Using Git version control system"
|
||||
|
||||
# Return true if it makes sense to edit this file
|
||||
saneFileToCheck()
|
||||
{
|
||||
@ -168,6 +170,25 @@ updateFile() # file
|
||||
echo "${changed}"
|
||||
}
|
||||
|
||||
# Update the copyright year on files sent in stdin
|
||||
updateFiles() # stdin: list of files to update
|
||||
{
|
||||
count=0
|
||||
fcount=0
|
||||
while read i; do
|
||||
fcount=`expr ${fcount} '+' 1`
|
||||
if [ `updateFile "${i}"` = "true" ] ; then
|
||||
count=`expr ${count} '+' 1`
|
||||
fi
|
||||
done
|
||||
if [ ${count} -gt 0 ] ; then
|
||||
printf " UPDATED year on %d of %d files.\n" ${count} ${fcount}
|
||||
total=`expr ${total} '+' ${count}`
|
||||
else
|
||||
printf " None of the %d files were changed.\n" ${fcount}
|
||||
fi
|
||||
}
|
||||
|
||||
# Update the copyright year on all files changed by this changeset
|
||||
updateChangesetFiles() # changeset
|
||||
{
|
||||
@ -178,18 +199,7 @@ updateChangesetFiles() # changeset
|
||||
| ${awk} -F' ' '{for(i=1;i<=NF;i++)print $i}' \
|
||||
> ${files}
|
||||
if [ -f "${files}" -a -s "${files}" ] ; then
|
||||
fcount=`cat ${files}| wc -l`
|
||||
for i in `cat ${files}` ; do
|
||||
if [ `updateFile "${i}"` = "true" ] ; then
|
||||
count=`expr ${count} '+' 1`
|
||||
fi
|
||||
done
|
||||
if [ ${count} -gt 0 ] ; then
|
||||
printf " UPDATED year on %d of %d files.\n" ${count} ${fcount}
|
||||
total=`expr ${total} '+' ${count}`
|
||||
else
|
||||
printf " None of the %d files were changed.\n" ${fcount}
|
||||
fi
|
||||
cat ${files} | updateFiles
|
||||
else
|
||||
printf " ERROR: No files changed in the changeset? Must be a mistake.\n"
|
||||
set -x
|
||||
@ -204,67 +214,80 @@ updateChangesetFiles() # changeset
|
||||
}
|
||||
|
||||
# Check if repository is clean
|
||||
vcs_status=(git ls-files -m)
|
||||
previous=`"${vcs_status[@]}"|wc -l`
|
||||
if [ ${previous} -ne 0 ] ; then
|
||||
echo "WARNING: This repository contains previously edited working set files."
|
||||
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
|
||||
fi
|
||||
|
||||
# Get all changesets this year
|
||||
all_changesets=${tmp}/all_changesets
|
||||
rm -f ${all_changesets}
|
||||
"${vcs_list_changesets[@]}" > ${all_changesets}
|
||||
|
||||
# Check changeset to see if it is Copyright only changes, filter changesets
|
||||
if [ -s ${all_changesets} ] ; then
|
||||
echo "Changesets made in ${year}: `cat ${all_changesets} | wc -l`"
|
||||
index=0
|
||||
cat ${all_changesets} | while read changeset ; do
|
||||
index=`expr ${index} '+' 1`
|
||||
desc=${tmp}/desc.${changeset}
|
||||
rm -f ${desc}
|
||||
echo "------------------------------------------------"
|
||||
"${vcs_changeset_message[@]}" "${changeset}" > ${desc}
|
||||
printf "%d: %s\n%s\n" ${index} "${changeset}" "`cat ${desc}|head -1`"
|
||||
if [ "${year}" = "2010" ] ; then
|
||||
if cat ${desc} | grep -i -F "Added tag" > /dev/null ; then
|
||||
printf " EXCLUDED tag changeset.\n"
|
||||
elif cat ${desc} | grep -i -F rebrand > /dev/null ; then
|
||||
printf " EXCLUDED rebrand changeset.\n"
|
||||
elif cat ${desc} | grep -i -F copyright > /dev/null ; then
|
||||
printf " EXCLUDED copyright changeset.\n"
|
||||
else
|
||||
updateChangesetFiles ${changeset}
|
||||
fi
|
||||
else
|
||||
if cat ${desc} | grep -i -F "Added tag" > /dev/null ; then
|
||||
printf " EXCLUDED tag changeset.\n"
|
||||
elif cat ${desc} | grep -i -F "copyright year" > /dev/null ; then
|
||||
printf " EXCLUDED copyright year changeset.\n"
|
||||
else
|
||||
updateChangesetFiles ${changeset}
|
||||
fi
|
||||
fi
|
||||
rm -f ${desc}
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ${total} -gt 0 ] ; then
|
||||
echo "---------------------------------------------"
|
||||
echo "Updated the copyright year on a total of ${total} files."
|
||||
if [ ${previous} -eq 0 ] ; then
|
||||
echo "This count should match the count of modified files in the repository: ${vcs_status[*]}"
|
||||
else
|
||||
echo "WARNING: This repository contained previously edited working set files."
|
||||
fi
|
||||
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
|
||||
if [ "x$modified_files_origin" != "x" ]; then
|
||||
cat $modified_files_origin | updateFiles
|
||||
else
|
||||
echo "---------------------------------------------"
|
||||
echo "No files were changed"
|
||||
if [ ${previous} -ne 0 ] ; then
|
||||
echo "WARNING: This repository contained previously edited working set files."
|
||||
fi
|
||||
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
|
||||
# Get all changesets this year
|
||||
if [ "$full_year" = "true" ]; then
|
||||
vcs_list_changesets=(git log --no-merges --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
|
||||
else
|
||||
vcs_list_changesets=(git log --no-merges "${base_reference}..HEAD" --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
|
||||
fi
|
||||
vcs_changeset_message=(git log -1 --pretty=tformat:"%B") # followed by ${changeset}
|
||||
vcs_changeset_files=(git diff-tree --no-commit-id --name-only -r) # followed by ${changeset}
|
||||
|
||||
all_changesets=${tmp}/all_changesets
|
||||
rm -f ${all_changesets}
|
||||
"${vcs_list_changesets[@]}" > ${all_changesets}
|
||||
|
||||
# Check changeset to see if it is Copyright only changes, filter changesets
|
||||
if [ -s ${all_changesets} ] ; then
|
||||
echo "Changesets made in ${year}: `cat ${all_changesets} | wc -l`"
|
||||
index=0
|
||||
cat ${all_changesets} | while read changeset ; do
|
||||
index=`expr ${index} '+' 1`
|
||||
desc=${tmp}/desc.${changeset}
|
||||
rm -f ${desc}
|
||||
echo "------------------------------------------------"
|
||||
"${vcs_changeset_message[@]}" "${changeset}" > ${desc}
|
||||
printf "%d: %s\n%s\n" ${index} "${changeset}" "`cat ${desc}|head -1`"
|
||||
if [ "${year}" = "2010" ] ; then
|
||||
if cat ${desc} | grep -i -F "Added tag" > /dev/null ; then
|
||||
printf " EXCLUDED tag changeset.\n"
|
||||
elif cat ${desc} | grep -i -F rebrand > /dev/null ; then
|
||||
printf " EXCLUDED rebrand changeset.\n"
|
||||
elif cat ${desc} | grep -i -F copyright > /dev/null ; then
|
||||
printf " EXCLUDED copyright changeset.\n"
|
||||
else
|
||||
updateChangesetFiles ${changeset}
|
||||
fi
|
||||
else
|
||||
if cat ${desc} | grep -i -F "Added tag" > /dev/null ; then
|
||||
printf " EXCLUDED tag changeset.\n"
|
||||
elif cat ${desc} | grep -i -F "copyright year" > /dev/null ; then
|
||||
printf " EXCLUDED copyright year changeset.\n"
|
||||
else
|
||||
updateChangesetFiles ${changeset}
|
||||
fi
|
||||
fi
|
||||
rm -f ${desc}
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ${total} -gt 0 ] ; then
|
||||
echo "---------------------------------------------"
|
||||
echo "Updated the copyright year on a total of ${total} files."
|
||||
if [ ${previous} -eq 0 ] ; then
|
||||
echo "This count should match the count of modified files in the repository: ${vcs_status[*]}"
|
||||
else
|
||||
echo "WARNING: This repository contained previously edited working set files."
|
||||
fi
|
||||
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
|
||||
else
|
||||
echo "---------------------------------------------"
|
||||
echo "No files were changed"
|
||||
if [ ${previous} -ne 0 ] ; then
|
||||
echo "WARNING: This repository contained previously edited working set files."
|
||||
fi
|
||||
echo " ${vcs_status[*]} | wc -l = `"${vcs_status[@]}" | wc -l`"
|
||||
fi
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
|
||||
@ -1385,10 +1385,9 @@ dpkg-deb -x /tmp/libasound2-dev_1.0.25-4_armhf.deb .</code></pre></li>
|
||||
can specify it by <code>--with-alsa</code>.</p></li>
|
||||
</ul>
|
||||
<h4 id="x11-1">X11</h4>
|
||||
<p>You will need X11 libraries suitable for your <em>target</em> system.
|
||||
In most cases, using Debian's pre-built libraries work fine.</p>
|
||||
<p>Note that X11 is needed even if you only want to build a headless
|
||||
JDK.</p>
|
||||
<p>When not building a headless JDK, you will need X11 libraries
|
||||
suitable for your <em>target</em> system. In most cases, using Debian's
|
||||
pre-built libraries work fine.</p>
|
||||
<ul>
|
||||
<li><p>Go to <a href="https://www.debian.org/distrib/packages">Debian
|
||||
Package Search</a>, search for the following packages for your
|
||||
|
||||
@ -1178,10 +1178,8 @@ Note that alsa is needed even if you only want to build a headless JDK.
|
||||
|
||||
#### X11
|
||||
|
||||
You will need X11 libraries suitable for your *target* system. In most cases,
|
||||
using Debian's pre-built libraries work fine.
|
||||
|
||||
Note that X11 is needed even if you only want to build a headless JDK.
|
||||
When not building a headless JDK, you will need X11 libraries suitable for your
|
||||
*target* system. In most cases, using Debian's pre-built libraries work fine.
|
||||
|
||||
* Go to [Debian Package Search](https://www.debian.org/distrib/packages),
|
||||
search for the following packages for your *target* system, and download them
|
||||
|
||||
@ -965,9 +965,8 @@ rather than <code>NULL</code>. See the paper for reasons to avoid
|
||||
<code>NULL</code>.</p>
|
||||
<p>Don't use (constant expression or literal) 0 for pointers. Note that
|
||||
C++14 removed non-literal 0 constants from <em>null pointer
|
||||
constants</em>, though some compilers continue to treat them as such.
|
||||
For historical reasons there may be lingering uses of 0 as a
|
||||
pointer.</p>
|
||||
constants</em>, though some compilers continue to treat them as
|
||||
such.</p>
|
||||
<h3 id="atomic"><atomic></h3>
|
||||
<p>Do not use facilities provided by the <code><atomic></code>
|
||||
header (<a
|
||||
|
||||
@ -884,8 +884,7 @@ rather than `NULL`. See the paper for reasons to avoid `NULL`.
|
||||
|
||||
Don't use (constant expression or literal) 0 for pointers. Note that C++14
|
||||
removed non-literal 0 constants from _null pointer constants_, though some
|
||||
compilers continue to treat them as such. For historical reasons there may be
|
||||
lingering uses of 0 as a pointer.
|
||||
compilers continue to treat them as such.
|
||||
|
||||
### <atomic>
|
||||
|
||||
|
||||
@ -72,6 +72,7 @@ id="toc-notes-for-specific-tests">Notes for Specific Tests</a>
|
||||
<li><a href="#non-us-locale" id="toc-non-us-locale">Non-US
|
||||
locale</a></li>
|
||||
<li><a href="#pkcs11-tests" id="toc-pkcs11-tests">PKCS11 Tests</a></li>
|
||||
<li><a href="#sctp-tests" id="toc-sctp-tests">SCTP Tests</a></li>
|
||||
<li><a href="#testing-ahead-of-time-optimizations"
|
||||
id="toc-testing-ahead-of-time-optimizations">Testing Ahead-of-time
|
||||
Optimizations</a></li>
|
||||
@ -621,6 +622,21 @@ element of the appropriate <code>@Artifact</code> class. (See
|
||||
JTREG="JAVA_OPTIONS=-Djdk.test.lib.artifacts.nsslib-linux_aarch64=/path/to/NSS-libs"</code></pre>
|
||||
<p>For more notes about the PKCS11 tests, please refer to
|
||||
test/jdk/sun/security/pkcs11/README.</p>
|
||||
<h3 id="sctp-tests">SCTP Tests</h3>
|
||||
<p>The SCTP tests require the SCTP runtime library, which is often not
|
||||
installed by default in popular Linux distributions. Without this
|
||||
library, the SCTP tests will be skipped. If you want to enable the SCTP
|
||||
tests, you should install the SCTP library before running the tests.</p>
|
||||
<p>For distributions using the .deb packaging format and the apt tool
|
||||
(such as Debian, Ubuntu, etc.), try this:</p>
|
||||
<pre><code>sudo apt install libsctp1
|
||||
sudo modprobe sctp
|
||||
lsmod | grep sctp</code></pre>
|
||||
<p>For distributions using the .rpm packaging format and the dnf tool
|
||||
(such as Fedora, Red Hat, etc.), try this:</p>
|
||||
<pre><code>sudo dnf install -y lksctp-tools
|
||||
sudo modprobe sctp
|
||||
lsmod | grep sctp</code></pre>
|
||||
<h3 id="testing-ahead-of-time-optimizations">Testing Ahead-of-time
|
||||
Optimizations</h3>
|
||||
<p>One way to improve test coverage of ahead-of-time (AOT) optimizations
|
||||
|
||||
@ -640,6 +640,32 @@ $ make test TEST="jtreg:sun/security/pkcs11/Secmod/AddTrustedCert.java" \
|
||||
For more notes about the PKCS11 tests, please refer to
|
||||
test/jdk/sun/security/pkcs11/README.
|
||||
|
||||
|
||||
### SCTP Tests
|
||||
|
||||
The SCTP tests require the SCTP runtime library, which is often not installed
|
||||
by default in popular Linux distributions. Without this library, the SCTP tests
|
||||
will be skipped. If you want to enable the SCTP tests, you should install the
|
||||
SCTP library before running the tests.
|
||||
|
||||
For distributions using the .deb packaging format and the apt tool
|
||||
(such as Debian, Ubuntu, etc.), try this:
|
||||
|
||||
```
|
||||
sudo apt install libsctp1
|
||||
sudo modprobe sctp
|
||||
lsmod | grep sctp
|
||||
```
|
||||
|
||||
For distributions using the .rpm packaging format and the dnf tool
|
||||
(such as Fedora, Red Hat, etc.), try this:
|
||||
|
||||
```
|
||||
sudo dnf install -y lksctp-tools
|
||||
sudo modprobe sctp
|
||||
lsmod | grep sctp
|
||||
```
|
||||
|
||||
### Testing Ahead-of-time Optimizations
|
||||
|
||||
One way to improve test coverage of ahead-of-time (AOT) optimizations in
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2026, 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
|
||||
@ -972,6 +972,10 @@ define SetupRunJtregTestBody
|
||||
JTREG_AUTO_PROBLEM_LISTS += ProblemList-enable-preview.txt
|
||||
endif
|
||||
|
||||
ifneq ($$(findstring -XX:+UseCompactObjectHeaders, $$(JTREG_ALL_OPTIONS)), )
|
||||
JTREG_AUTO_PROBLEM_LISTS += ProblemList-coh.txt
|
||||
endif
|
||||
|
||||
|
||||
ifneq ($$(JTREG_EXTRA_PROBLEM_LISTS), )
|
||||
# Accept both absolute paths as well as relative to the current test root.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2017, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2015, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2025, 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2026, 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
|
||||
@ -69,6 +69,19 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
# Debug prefix mapping if supported by compiler
|
||||
DEBUG_PREFIX_CFLAGS=
|
||||
|
||||
UTIL_ARG_WITH(NAME: native-debug-symbols-level, TYPE: literal,
|
||||
DEFAULT: [auto], VALID_VALUES: [auto 1 2 3],
|
||||
CHECK_AVAILABLE: [
|
||||
if test x$TOOLCHAIN_TYPE = xmicrosoft; then
|
||||
AVAILABLE=false
|
||||
fi
|
||||
],
|
||||
DESC: [set the native debug symbol level (GCC and Clang only)],
|
||||
DEFAULT_DESC: [toolchain default],
|
||||
IF_AUTO: [
|
||||
RESULT=""
|
||||
])
|
||||
|
||||
# Debug symbols
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
|
||||
@ -93,8 +106,9 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
)
|
||||
fi
|
||||
|
||||
CFLAGS_DEBUG_SYMBOLS="-g -gdwarf-4"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g"
|
||||
# Debug info level should follow the debug format to be effective.
|
||||
CFLAGS_DEBUG_SYMBOLS="-gdwarf-4 -g${NATIVE_DEBUG_SYMBOLS_LEVEL}"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g${NATIVE_DEBUG_SYMBOLS_LEVEL}"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
if test "x$ALLOW_ABSOLUTE_PATHS_IN_OUTPUT" = "xfalse"; then
|
||||
# Check if compiler supports -fdebug-prefix-map. If so, use that to make
|
||||
@ -113,8 +127,9 @@ AC_DEFUN([FLAGS_SETUP_DEBUG_SYMBOLS],
|
||||
FLAGS_COMPILER_CHECK_ARGUMENTS(ARGUMENT: [${GDWARF_FLAGS}],
|
||||
IF_FALSE: [GDWARF_FLAGS=""])
|
||||
|
||||
CFLAGS_DEBUG_SYMBOLS="-g ${GDWARF_FLAGS}"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g"
|
||||
# Debug info level should follow the debug format to be effective.
|
||||
CFLAGS_DEBUG_SYMBOLS="${GDWARF_FLAGS} -g${NATIVE_DEBUG_SYMBOLS_LEVEL}"
|
||||
ASFLAGS_DEBUG_SYMBOLS="-g${NATIVE_DEBUG_SYMBOLS_LEVEL}"
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
CFLAGS_DEBUG_SYMBOLS="-Z7"
|
||||
fi
|
||||
@ -194,8 +209,12 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
BUILD_CC_DISABLE_WARNING_PREFIX="-wd"
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-WX"
|
||||
|
||||
WARNINGS_ENABLE_ALL="-W3"
|
||||
WARNINGS_ENABLE_ALL_NORMAL="-W3"
|
||||
WARNINGS_ENABLE_ADDITIONAL=""
|
||||
WARNINGS_ENABLE_ADDITIONAL_CXX=""
|
||||
WARNINGS_ENABLE_ADDITIONAL_JVM=""
|
||||
DISABLED_WARNINGS="4800 5105"
|
||||
CFLAGS_CONVERSION_WARNINGS=
|
||||
;;
|
||||
|
||||
gcc)
|
||||
@ -203,14 +222,16 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||
|
||||
WARNINGS_ENABLE_ALL_NORMAL="-Wall -Wextra"
|
||||
|
||||
# Additional warnings that are not activated by -Wall and -Wextra
|
||||
WARNINGS_ENABLE_ADDITIONAL="-Winvalid-pch -Wpointer-arith -Wreturn-type \
|
||||
WARNINGS_ENABLE_ADDITIONAL="-Wformat=2 \
|
||||
-Winvalid-pch -Wpointer-arith -Wreturn-type \
|
||||
-Wsign-compare -Wtrampolines -Wtype-limits -Wundef -Wuninitialized \
|
||||
-Wunused-const-variable=1 -Wunused-function -Wunused-result \
|
||||
-Wunused-value"
|
||||
WARNINGS_ENABLE_ADDITIONAL_CXX="-Woverloaded-virtual -Wreorder"
|
||||
WARNINGS_ENABLE_ALL_CFLAGS="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
|
||||
WARNINGS_ENABLE_ALL_CXXFLAGS="$WARNINGS_ENABLE_ALL_CFLAGS $WARNINGS_ENABLE_ADDITIONAL_CXX"
|
||||
WARNINGS_ENABLE_ADDITIONAL_JVM="-Wzero-as-null-pointer-constant"
|
||||
|
||||
# These warnings will never be turned on, since they generate too many
|
||||
# false positives.
|
||||
@ -219,6 +240,7 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
if test "x$OPENJDK_TARGET_CPU_ARCH" = "xppc"; then
|
||||
DISABLED_WARNINGS="$DISABLED_WARNINGS psabi"
|
||||
fi
|
||||
CFLAGS_CONVERSION_WARNINGS="-Wconversion -Wno-float-conversion"
|
||||
;;
|
||||
|
||||
clang)
|
||||
@ -226,22 +248,32 @@ AC_DEFUN([FLAGS_SETUP_WARNINGS],
|
||||
BUILD_CC_DISABLE_WARNING_PREFIX="-Wno-"
|
||||
CFLAGS_WARNINGS_ARE_ERRORS="-Werror"
|
||||
|
||||
WARNINGS_ENABLE_ALL_NORMAL="-Wall -Wextra"
|
||||
|
||||
# Additional warnings that are not activated by -Wall and -Wextra
|
||||
WARNINGS_ENABLE_ADDITIONAL="-Wpointer-arith -Wsign-compare -Wreorder \
|
||||
WARNINGS_ENABLE_ADDITIONAL="-Wformat=2 \
|
||||
-Wpointer-arith -Wsign-compare -Wreorder \
|
||||
-Wunused-function -Wundef -Wunused-value -Woverloaded-virtual"
|
||||
WARNINGS_ENABLE_ALL="-Wall -Wextra -Wformat=2 $WARNINGS_ENABLE_ADDITIONAL"
|
||||
WARNINGS_ENABLE_ADDITIONAL_CXX=""
|
||||
WARNINGS_ENABLE_ADDITIONAL_JVM="-Wzero-as-null-pointer-constant"
|
||||
|
||||
# These warnings will never be turned on, since they generate too many
|
||||
# false positives.
|
||||
DISABLED_WARNINGS="unknown-warning-option unused-parameter"
|
||||
CFLAGS_CONVERSION_WARNINGS="-Wimplicit-int-conversion"
|
||||
;;
|
||||
esac
|
||||
WARNINGS_ENABLE_ALL="$WARNINGS_ENABLE_ALL_NORMAL $WARNINGS_ENABLE_ADDITIONAL"
|
||||
WARNINGS_ENABLE_ALL_CXX="$WARNINGS_ENABLE_ALL $WARNINGS_ENABLE_ADDITIONAL_CXX"
|
||||
WARNINGS_ENABLE_ALL_JVM="$WARNINGS_ENABLE_ALL_CXX $WARNINGS_ENABLE_ADDITIONAL_JVM"
|
||||
|
||||
AC_SUBST(DISABLE_WARNING_PREFIX)
|
||||
AC_SUBST(BUILD_CC_DISABLE_WARNING_PREFIX)
|
||||
AC_SUBST(CFLAGS_WARNINGS_ARE_ERRORS)
|
||||
AC_SUBST(DISABLED_WARNINGS)
|
||||
AC_SUBST(DISABLED_WARNINGS_C)
|
||||
AC_SUBST(DISABLED_WARNINGS_CXX)
|
||||
AC_SUBST(CFLAGS_CONVERSION_WARNINGS)
|
||||
])
|
||||
|
||||
AC_DEFUN([FLAGS_SETUP_QUALITY_CHECKS],
|
||||
@ -589,19 +621,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_HELPER],
|
||||
ADLC_LANGSTD_CXXFLAGS="$LANGSTD_CXXFLAGS"
|
||||
|
||||
# CFLAGS WARNINGS STUFF
|
||||
# Set JVM_CFLAGS warning handling
|
||||
if test "x$TOOLCHAIN_TYPE" = xgcc; then
|
||||
WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL_CFLAGS"
|
||||
WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXXFLAGS"
|
||||
WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_CXXFLAGS"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xclang; then
|
||||
WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
|
||||
|
||||
elif test "x$TOOLCHAIN_TYPE" = xmicrosoft; then
|
||||
WARNING_CFLAGS="$WARNINGS_ENABLE_ALL"
|
||||
|
||||
fi
|
||||
WARNING_CFLAGS_JDK_CONLY="$WARNINGS_ENABLE_ALL"
|
||||
WARNING_CFLAGS_JDK_CXXONLY="$WARNINGS_ENABLE_ALL_CXX"
|
||||
WARNING_CFLAGS_JVM="$WARNINGS_ENABLE_ALL_JVM"
|
||||
|
||||
# Set some additional per-OS defines.
|
||||
|
||||
@ -863,12 +885,12 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP],
|
||||
CFLAGS_JVM_COMMON="$ALWAYS_CFLAGS_JVM $ALWAYS_DEFINES_JVM \
|
||||
$TOOLCHAIN_CFLAGS_JVM ${$1_TOOLCHAIN_CFLAGS_JVM} \
|
||||
$OS_CFLAGS $OS_CFLAGS_JVM $CFLAGS_OS_DEF_JVM $DEBUG_CFLAGS_JVM \
|
||||
$WARNING_CFLAGS $WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS \
|
||||
$WARNING_CFLAGS_JVM $JVM_PICFLAG $FILE_MACRO_CFLAGS \
|
||||
$REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
|
||||
|
||||
CFLAGS_JDK_COMMON="$ALWAYS_DEFINES_JDK $TOOLCHAIN_CFLAGS_JDK \
|
||||
$OS_CFLAGS $CFLAGS_OS_DEF_JDK $DEBUG_CFLAGS_JDK $DEBUG_OPTIONS_FLAGS_JDK \
|
||||
$WARNING_CFLAGS $WARNING_CFLAGS_JDK $DEBUG_SYMBOLS_CFLAGS_JDK \
|
||||
$DEBUG_SYMBOLS_CFLAGS_JDK \
|
||||
$FILE_MACRO_CFLAGS $REPRODUCIBLE_CFLAGS $BRANCH_PROTECTION_CFLAGS"
|
||||
|
||||
# Use ${$2EXTRA_CFLAGS} to block EXTRA_CFLAGS to be added to build flags.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2026, 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,7 +28,7 @@
|
||||
################################################################################
|
||||
|
||||
# Minimum supported versions
|
||||
JTREG_MINIMUM_VERSION=8.1
|
||||
JTREG_MINIMUM_VERSION=8.2.1
|
||||
GTEST_MINIMUM_VERSION=1.14.0
|
||||
|
||||
################################################################################
|
||||
|
||||
@ -42,12 +42,12 @@ m4_include([lib-tests.m4])
|
||||
AC_DEFUN_ONCE([LIB_DETERMINE_DEPENDENCIES],
|
||||
[
|
||||
# Check if X11 is needed
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows || test "x$OPENJDK_TARGET_OS" = xmacosx; then
|
||||
# No X11 support on windows or macosx
|
||||
if test "x$OPENJDK_TARGET_OS" = xwindows ||
|
||||
test "x$OPENJDK_TARGET_OS" = xmacosx ||
|
||||
test "x$ENABLE_HEADLESS_ONLY" = xtrue; then
|
||||
NEEDS_LIB_X11=false
|
||||
else
|
||||
# All other instances need X11, even if building headless only, libawt still
|
||||
# needs X11 headers.
|
||||
# All other instances need X11 for libawt.
|
||||
NEEDS_LIB_X11=true
|
||||
fi
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2026, 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
|
||||
@ -311,6 +311,12 @@ AC_DEFUN([PLATFORM_EXTRACT_TARGET_AND_BUILD],
|
||||
else
|
||||
OPENJDK_BUILD_OS_ENV="$VAR_OS"
|
||||
fi
|
||||
# Special handling for MSYS2 that reports a Cygwin triplet as the default host triplet.
|
||||
case `uname` in
|
||||
MSYS*)
|
||||
OPENJDK_BUILD_OS_ENV=windows.msys2
|
||||
;;
|
||||
esac
|
||||
OPENJDK_BUILD_CPU="$VAR_CPU"
|
||||
OPENJDK_BUILD_CPU_ARCH="$VAR_CPU_ARCH"
|
||||
OPENJDK_BUILD_CPU_BITS="$VAR_CPU_BITS"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2026, 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
|
||||
@ -529,6 +529,7 @@ CFLAGS_WARNINGS_ARE_ERRORS := @CFLAGS_WARNINGS_ARE_ERRORS@
|
||||
DISABLED_WARNINGS := @DISABLED_WARNINGS@
|
||||
DISABLED_WARNINGS_C := @DISABLED_WARNINGS_C@
|
||||
DISABLED_WARNINGS_CXX := @DISABLED_WARNINGS_CXX@
|
||||
CFLAGS_CONVERSION_WARNINGS := @CFLAGS_CONVERSION_WARNINGS@
|
||||
|
||||
# A global flag (true or false) determining if native warnings are considered errors.
|
||||
WARNINGS_AS_ERRORS := @WARNINGS_AS_ERRORS@
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2011, 2026, 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
|
||||
@ -141,6 +141,66 @@ endef
|
||||
# Make sure logging is setup for everyone that includes MakeBase.gmk.
|
||||
$(eval $(call SetupLogging))
|
||||
|
||||
################################################################################
|
||||
# Make does not have support for VARARGS, you can send variable amount
|
||||
# of arguments, but you can for example not append a list at the end.
|
||||
# It is therefore not easy to send the elements of a list of unknown
|
||||
# length as argument to a function. This can somewhat be worked around
|
||||
# by sending a list as an argument, and then interpreting each element
|
||||
# of the list as an argument to the function. However, Make is
|
||||
# limited, and using this method you can not easily send spaces.
|
||||
#
|
||||
# We need to quote strings for two reasons when sending them as
|
||||
# "variable append packs":
|
||||
#
|
||||
# 1) variable appends can include spaces, and those must be preserved
|
||||
# 2) variable appends can include assignment strings ":=", and those
|
||||
# must be quoted to a form so that we can recognise the "append pack".
|
||||
# We recognise an "append pack" by its lack of strict assignment ":="
|
||||
|
||||
Q := $(HASH)
|
||||
SpaceQ := $(Q)s
|
||||
AppendQ := $(Q)+
|
||||
AssignQ := $(Q)a
|
||||
QQ := $(Q)$(Q)
|
||||
|
||||
# $(call Quote,echo "#trala:=") -> echo#s"##trala#a"
|
||||
Quote = $(subst :=,$(AssignQ),$(subst $(SPACE),$(SpaceQ),$(subst $(Q),$(QQ),$1)))
|
||||
|
||||
# $(call Unquote,echo#s"##trala#a") -> echo "#trala:="
|
||||
Unquote = $(subst $(QQ),$(Q),$(subst $(SpaceQ),$(SPACE),$(subst $(AssignQ),:=,$1)))
|
||||
|
||||
# $(call QuoteAppend,name,some value) -> name#+some#svalue
|
||||
# $(call QuoteAppend,bad+=name,some value) -> error
|
||||
QuoteAppend = $(if $(findstring +=,$1),$(error you can not have += in a variable name: "$1"),$(call Quote,$1)$(AppendQ)$(call Quote,$2))
|
||||
|
||||
# $(call UnquoteAppendIndex,name#+some#svalue,1) -> name
|
||||
# $(call UnquoteAppendIndex,name#+some#svalue,2) -> some value
|
||||
UnquoteAppendIndex = $(call Unquote,$(word $2,$(subst $(AppendQ),$(SPACE),$1)))
|
||||
|
||||
# $(call FilterFiles,dir,%.cpp) -> file1.cpp file2.cpp (without path)
|
||||
FilterFiles = $(filter $2,$(notdir $(call FindFiles,$1)))
|
||||
|
||||
# $(call Unpack module_,file1.cpp_CXXFLAGS#+-Wconversion file2.cpp_CXXFLAGS#+-Wconversion) -> module_file1.cpp_CXXFLAGS += -Wconversion
|
||||
# module_file2.cpp_CXXFLAGS += -Wconversion
|
||||
Unpack = $(foreach pair,$2,$1$(call UnquoteAppendIndex,$(pair),1) += $(call UnquoteAppendIndex,$(pair),2)$(NEWLINE))
|
||||
|
||||
# This macro takes four arguments:
|
||||
# $1: directory where to find files (striped), example: $(TOPDIR)/src/hotspot/share/gc/g1
|
||||
# $2: filter to match what to keep (striped), example: g1Concurrent%.cpp
|
||||
# $3: what flags to override (striped), example: _CXXFLAGS
|
||||
# $4: what value to append to the flag (striped), example: $(CFLAGS_CONVERSION_WARNINGS)
|
||||
#
|
||||
# The result will be a quoted string that can be unpacked to a list of
|
||||
# variable appendings (see macro Unpack above). You do not need to take
|
||||
# care of unpacking, it is done in NamedParamsMacroTemplate.
|
||||
#
|
||||
# This feature should only be used for warnings that we want to
|
||||
# incrementally add to the rest of the code base.
|
||||
#
|
||||
# $(call ExtendFlags,dir,%.cpp,_CXXFLAGS,-Wconversion) -> file1.cpp_CXXFLAGS#+-Wconversion file2.cpp_CXXFLAGS#+-Wconversion
|
||||
ExtendFlags = $(foreach file,$(call FilterFiles,$(strip $1),$(strip $2)),$(call QuoteAppend,$(file)$(strip $3),$(strip $4)))
|
||||
|
||||
################################################################################
|
||||
|
||||
MAX_PARAMS := 96
|
||||
@ -166,7 +226,10 @@ define NamedParamsMacroTemplate
|
||||
Too many named arguments to macro, please update MAX_PARAMS in MakeBase.gmk))
|
||||
# Iterate over 2 3 4... and evaluate the named parameters with $1_ as prefix
|
||||
$(foreach i, $(PARAM_SEQUENCE), $(if $(strip $($i)), \
|
||||
$(strip $1)_$(strip $(call EscapeHash, $(call DoubleDollar, $($i))))$(NEWLINE)))
|
||||
$(if $(findstring :=,$($i)), \
|
||||
$(strip $1)_$(strip $(call EscapeHash, $(call DoubleDollar, $($i))))$(NEWLINE), \
|
||||
$(call Unpack,$(strip $1)_,$($i)))))
|
||||
|
||||
# Debug print all named parameter names and values
|
||||
$(if $(findstring $(LOG_LEVEL), trace), \
|
||||
$(info $0 $(strip $1) $(foreach i, $(PARAM_SEQUENCE), \
|
||||
|
||||
@ -114,7 +114,7 @@ EscapeDollar = $(subst $$,\$$,$(subst \$$,$$,$(strip $1)))
|
||||
|
||||
################################################################################
|
||||
# This macro works just like EscapeDollar above, but for #.
|
||||
EscapeHash = $(subst \#,\\\#,$(subst \\\#,\#,$(strip $1)))
|
||||
EscapeHash = $(subst $(HASH),\$(HASH),$(subst \$(HASH),$(HASH),$(strip $1)))
|
||||
|
||||
################################################################################
|
||||
# This macro translates $ into $$ to protect the string from make itself.
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2020, 2026, 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
|
||||
@ -26,7 +26,7 @@
|
||||
# Versions and download locations for dependencies used by GitHub Actions (GHA)
|
||||
|
||||
GTEST_VERSION=1.14.0
|
||||
JTREG_VERSION=8.1+1
|
||||
JTREG_VERSION=8.2.1+1
|
||||
|
||||
LINUX_X64_BOOT_JDK_EXT=tar.gz
|
||||
LINUX_X64_BOOT_JDK_URL=https://download.java.net/java/GA/jdk25/bd75d5f9689641da8e1daabeccb5528b/36/GPL/openjdk-25_linux-x64_bin.tar.gz
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2015, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2026, 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
|
||||
@ -1174,9 +1174,9 @@ var getJibProfilesDependencies = function (input, common) {
|
||||
jtreg: {
|
||||
server: "jpg",
|
||||
product: "jtreg",
|
||||
version: "8.1",
|
||||
version: "8.2.1",
|
||||
build_number: "1",
|
||||
file: "bundles/jtreg-8.1+1.zip",
|
||||
file: "bundles/jtreg-8.2.1+1.zip",
|
||||
environment_name: "JT_HOME",
|
||||
environment_path: input.get("jtreg", "home_path") + "/bin",
|
||||
configure_args: "--with-jtreg=" + input.get("jtreg", "home_path"),
|
||||
|
||||
@ -78,7 +78,7 @@ else ifeq ($(BASE_OS), Fedora)
|
||||
endif
|
||||
BASE_URL := http://fedora.riscv.rocks/repos-dist/f$(BASE_OS_VERSION)/latest/$(ARCH)/Packages/
|
||||
else
|
||||
LATEST_ARCHIVED_OS_VERSION := 36
|
||||
LATEST_ARCHIVED_OS_VERSION := 41
|
||||
ifeq ($(filter aarch64 armhfp x86_64, $(ARCH)), )
|
||||
FEDORA_TYPE := fedora-secondary
|
||||
else
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2015, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2015, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2016, 2026, 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
|
||||
@ -61,7 +61,8 @@ $(eval $(call SetupJdkLibrary, BUILD_GTEST_LIBGTEST, \
|
||||
INCLUDE_FILES := gtest-all.cc gmock-all.cc, \
|
||||
DISABLED_WARNINGS_gcc := format-nonliteral maybe-uninitialized undef \
|
||||
unused-result zero-as-null-pointer-constant, \
|
||||
DISABLED_WARNINGS_clang := format-nonliteral undef unused-result, \
|
||||
DISABLED_WARNINGS_clang := format-nonliteral undef unused-result \
|
||||
zero-as-null-pointer-constant, \
|
||||
DISABLED_WARNINGS_microsoft := 4530, \
|
||||
DEFAULT_CFLAGS := false, \
|
||||
CFLAGS := $(JVM_CFLAGS) \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2013, 2026, 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
|
||||
@ -190,6 +190,8 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJVM, \
|
||||
abstract_vm_version.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
|
||||
arguments.cpp_CXXFLAGS := $(CFLAGS_VM_VERSION), \
|
||||
whitebox.cpp_CXXFLAGS := $(CFLAGS_SHIP_DEBUGINFO), \
|
||||
$(call ExtendFlags, $(TOPDIR)/src/hotspot/share/gc/g1, \
|
||||
g1Numa.cpp, _CXXFLAGS, $(CFLAGS_CONVERSION_WARNINGS)), \
|
||||
DISABLED_WARNINGS_gcc := $(DISABLED_WARNINGS_gcc), \
|
||||
DISABLED_WARNINGS_gcc_ad_$(HOTSPOT_TARGET_CPU_ARCH).cpp := nonnull, \
|
||||
DISABLED_WARNINGS_gcc_bytecodeInterpreter.cpp := unused-label, \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2012, 2026, 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
|
||||
@ -293,8 +293,10 @@ public class CLDRConverter {
|
||||
bundleGenerator = new ResourceBundleGenerator();
|
||||
|
||||
// Parse data independent of locales
|
||||
parseSupplemental();
|
||||
// parseBCP47() must precede parseSupplemental(). The latter depends
|
||||
// on IANA alias map, which is produced by the former.
|
||||
parseBCP47();
|
||||
parseSupplemental();
|
||||
|
||||
// rules maps
|
||||
pluralRules = generateRules(handlerPlurals);
|
||||
@ -536,6 +538,12 @@ public class CLDRConverter {
|
||||
|
||||
// canonical tz name map
|
||||
// alias -> primary
|
||||
//
|
||||
// Note that CLDR meta zones do not necessarily align with IANA's
|
||||
// current time zone identifiers. For example, the CLDR "India"
|
||||
// meta zone maps to "Asia/Calcutta", whereas IANA now uses
|
||||
// "Asia/Kolkata" for the zone. Accordingly, "canonical" here is
|
||||
// defined in terms of CLDR's zone mappings.
|
||||
handlerTimeZone.getData().forEach((k, v) -> {
|
||||
String[] ids = ((String)v).split("\\s");
|
||||
for (int i = 1; i < ids.length; i++) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2026, 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
|
||||
@ -27,6 +27,9 @@ package build.tools.cldrconverter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.xml.sax.Attributes;
|
||||
import org.xml.sax.InputSource;
|
||||
@ -40,6 +43,10 @@ import org.xml.sax.SAXException;
|
||||
class TimeZoneParseHandler extends AbstractLDMLHandler<Object> {
|
||||
private static final String PREF_PREFIX = "preferred:";
|
||||
|
||||
// CLDR aliases to IANA ids map. The initial capacity is estimated
|
||||
// from the number of aliases in timezone.xml as of CLDR v48
|
||||
private final Map<String, String> ianaAliasMap = HashMap.newHashMap(32);
|
||||
|
||||
@Override
|
||||
public InputSource resolveEntity(String publicID, String systemID) throws IOException, SAXException {
|
||||
// avoid HTTP traffic to unicode.org
|
||||
@ -61,7 +68,16 @@ class TimeZoneParseHandler extends AbstractLDMLHandler<Object> {
|
||||
put(attributes.getValue("name"), PREF_PREFIX + preferred);
|
||||
}
|
||||
} else {
|
||||
put(attributes.getValue("name"), attributes.getValue("alias"));
|
||||
var alias = attributes.getValue("alias");
|
||||
var iana = attributes.getValue("iana");
|
||||
if (iana != null) {
|
||||
for (var a : alias.split("\\s+")) {
|
||||
if (!a.equals(iana)) {
|
||||
ianaAliasMap.put(a, iana);
|
||||
}
|
||||
}
|
||||
}
|
||||
put(attributes.getValue("name"), alias);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -80,4 +96,8 @@ class TimeZoneParseHandler extends AbstractLDMLHandler<Object> {
|
||||
.forEach(e -> map.put(e.getKey(),
|
||||
map.get(e.getValue().toString().substring(PREF_PREFIX.length()))));
|
||||
}
|
||||
|
||||
Map<String, String> getIanaAliasMap() {
|
||||
return ianaAliasMap;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2026, 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
|
||||
@ -56,6 +56,7 @@ class WinZonesParseHandler extends AbstractLDMLHandler<Object> {
|
||||
String zoneName = attributes.getValue("other");
|
||||
String territory = attributes.getValue("territory");
|
||||
String javatz = attributes.getValue("type").replaceFirst("\\s.*", "");
|
||||
javatz = CLDRConverter.handlerTimeZone.getIanaAliasMap().getOrDefault(javatz, javatz);
|
||||
put(zoneName + ":" + territory, javatz);
|
||||
pushIgnoredContainer(qName);
|
||||
break;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2026, 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
|
||||
@ -49,13 +49,15 @@ import static com.sun.source.doctree.DocTree.Kind.*;
|
||||
* The tags can be used as follows:
|
||||
*
|
||||
* <pre>
|
||||
* @jls section-number description
|
||||
* @jls chapter.section description
|
||||
* @jls preview-feature-chapter.section description
|
||||
* </pre>
|
||||
*
|
||||
* For example:
|
||||
*
|
||||
* <pre>
|
||||
* @jls 3.4 Line Terminators
|
||||
* @jls primitive-types-in-patterns-instanceof-switch-5.7.1 Exact Testing Conversions
|
||||
* </pre>
|
||||
*
|
||||
* will produce the following HTML, depending on the file containing
|
||||
@ -64,10 +66,24 @@ import static com.sun.source.doctree.DocTree.Kind.*;
|
||||
* <pre>{@code
|
||||
* <dt>See <i>Java Language Specification</i>:
|
||||
* <dd><a href="../../specs/jls/jls-3.html#jls-3.4">3.4 Line terminators</a>
|
||||
* <dd><a href="../../specs/primitive-types-in-patterns-instanceof-switch-jls.html#jls-5.7.1">
|
||||
* 5.7.1 Exact Testing Conversions</a><sup class="preview-mark">
|
||||
* <a href="../../specs/jls/jls-1.html#jls-1.5.1">PREVIEW</a></sup>
|
||||
* }</pre>
|
||||
*
|
||||
* Copies of JLS and JVMS are expected to have been placed in the {@code specs}
|
||||
* folder. These documents are not included in open-source repositories.
|
||||
* In inline tags (note you need manual JLS/JVMS prefix):
|
||||
* <pre>
|
||||
* JLS {@jls 3.4}
|
||||
* </pre>
|
||||
*
|
||||
* produces (note the section sign and no trailing dot):
|
||||
* <pre>
|
||||
* JLS <a href="../../specs/jls/jls-3.html#jls-3.4">§3.4</a>
|
||||
* </pre>
|
||||
*
|
||||
* Copies of JLS, JVMS, and preview JLS and JVMS changes are expected to have
|
||||
* been placed in the {@code specs} folder. These documents are not included
|
||||
* in open-source repositories.
|
||||
*/
|
||||
public class JSpec implements Taglet {
|
||||
|
||||
@ -87,9 +103,9 @@ public class JSpec implements Taglet {
|
||||
}
|
||||
}
|
||||
|
||||
private String tagName;
|
||||
private String specTitle;
|
||||
private String idPrefix;
|
||||
private final String tagName;
|
||||
private final String specTitle;
|
||||
private final String idPrefix;
|
||||
|
||||
JSpec(String tagName, String specTitle, String idPrefix) {
|
||||
this.tagName = tagName;
|
||||
@ -98,7 +114,7 @@ public class JSpec implements Taglet {
|
||||
}
|
||||
|
||||
// Note: Matches special cases like @jvms 6.5.checkcast
|
||||
private static final Pattern TAG_PATTERN = Pattern.compile("(?s)(.+ )?(?<chapter>[1-9][0-9]*)(?<section>[0-9a-z_.]*)( .*)?$");
|
||||
private static final Pattern TAG_PATTERN = Pattern.compile("(?s)(.+ )?(?<preview>([a-z0-9]+-)+)?(?<chapter>[1-9][0-9]*)(?<section>[0-9a-z_.]*)( .*)?$");
|
||||
|
||||
/**
|
||||
* Returns the set of locations in which the tag may be used.
|
||||
@ -157,19 +173,50 @@ public class JSpec implements Taglet {
|
||||
.trim();
|
||||
Matcher m = TAG_PATTERN.matcher(tagText);
|
||||
if (m.find()) {
|
||||
// preview-feature-4.6 is preview-feature-, 4, .6
|
||||
String preview = m.group("preview"); // null if no preview feature
|
||||
String chapter = m.group("chapter");
|
||||
String section = m.group("section");
|
||||
String rootParent = currentPath().replaceAll("[^/]+", "..");
|
||||
|
||||
String url = String.format("%1$s/specs/%2$s/%2$s-%3$s.html#%2$s-%3$s%4$s",
|
||||
rootParent, idPrefix, chapter, section);
|
||||
String url = preview == null ?
|
||||
String.format("%1$s/specs/%2$s/%2$s-%3$s.html#%2$s-%3$s%4$s",
|
||||
rootParent, idPrefix, chapter, section) :
|
||||
String.format("%1$s/specs/%5$s%2$s.html#%2$s-%3$s%4$s",
|
||||
rootParent, idPrefix, chapter, section, preview);
|
||||
|
||||
var literal = expand(contents).trim();
|
||||
var prefix = (preview == null ? "" : preview) + chapter + section;
|
||||
if (literal.startsWith(prefix)) {
|
||||
var hasFullTitle = literal.length() > prefix.length();
|
||||
if (hasFullTitle) {
|
||||
// Drop the preview identifier
|
||||
literal = chapter + section + literal.substring(prefix.length());
|
||||
} else {
|
||||
// No section sign if the tag refers to a chapter, like {@jvms 4}
|
||||
String sectionSign = section.isEmpty() ? "" : "§";
|
||||
// Change whole text to "§chapter.x" in inline tags.
|
||||
literal = sectionSign + chapter + section;
|
||||
}
|
||||
}
|
||||
|
||||
sb.append("<a href=\"")
|
||||
.append(url)
|
||||
.append("\">")
|
||||
.append(expand(contents))
|
||||
.append(literal)
|
||||
.append("</a>");
|
||||
|
||||
if (preview != null) {
|
||||
// Add PREVIEW superscript that links to JLS/JVMS 1.5.1
|
||||
// "Restrictions on the Use of Preview Features"
|
||||
// Similar to how APIs link to the Preview info box warning
|
||||
var sectionLink = String.format("%1$s/specs/%2$s/%2$s-%3$s.html#%2$s-%3$s%4$s",
|
||||
rootParent, idPrefix, "1", ".5.1");
|
||||
sb.append("<sup class=\"preview-mark\"><a href=\"")
|
||||
.append(sectionLink)
|
||||
.append("\">PREVIEW</a></sup>");
|
||||
}
|
||||
|
||||
if (tag.getKind() == DocTree.Kind.UNKNOWN_BLOCK_TAG) {
|
||||
sb.append("<br>");
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2017, 2025, 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
|
||||
|
||||
@ -286,7 +286,7 @@ public class ClassGenerator {
|
||||
diagnosticFlags.isEmpty() ?
|
||||
StubKind.DIAGNOSTIC_FLAGS_EMPTY.format() :
|
||||
StubKind.DIAGNOSTIC_FLAGS_NON_EMPTY.format(diagnosticFlags),
|
||||
StubKind.LINT_CATEGORY.format("\"" + lintCategory + "\""),
|
||||
StubKind.LINT_CATEGORY.format(toLintFieldName(lintCategory)),
|
||||
"\"" + keyParts[0] + "\"",
|
||||
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
|
||||
javadoc);
|
||||
@ -314,7 +314,7 @@ public class ClassGenerator {
|
||||
diagnosticFlags.isEmpty() ?
|
||||
StubKind.DIAGNOSTIC_FLAGS_EMPTY.format() :
|
||||
StubKind.DIAGNOSTIC_FLAGS_NON_EMPTY.format(diagnosticFlags),
|
||||
StubKind.LINT_CATEGORY.format("\"" + lintCategory + "\""),
|
||||
StubKind.LINT_CATEGORY.format(toLintFieldName(lintCategory)),
|
||||
"\"" + keyParts[0] + "\"",
|
||||
"\"" + Stream.of(keyParts).skip(2).collect(Collectors.joining(".")) + "\"",
|
||||
argNames.stream().collect(Collectors.joining(", ")));
|
||||
@ -329,6 +329,11 @@ public class ClassGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
String toLintFieldName(String lintCategory) {
|
||||
return lintCategory.toUpperCase()
|
||||
.replaceAll("-", "_");
|
||||
}
|
||||
|
||||
/**
|
||||
* Form the name of a factory method/field given a resource key.
|
||||
*/
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
|
||||
@ -87,7 +87,7 @@ suppress.warnings=\
|
||||
@SuppressWarnings("rawtypes")\n
|
||||
|
||||
lint.category=\
|
||||
LintCategory.get({0}).get()
|
||||
LintCategory.{0}
|
||||
|
||||
diagnostic.flags.empty=\
|
||||
EnumSet.noneOf(DiagnosticFlag.class)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2014, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2014, 2026, 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
|
||||
@ -172,6 +172,10 @@ ifeq ($(USE_EXTERNAL_LIBZ), true)
|
||||
LEGAL_EXCLUDES += zlib.md
|
||||
endif
|
||||
|
||||
ifneq ($(TOOLCHAIN_TYPE), gcc)
|
||||
LEGAL_EXCLUDES += gcc.md
|
||||
endif
|
||||
|
||||
$(eval $(call SetupCopyLegalFiles, COPY_LEGAL, \
|
||||
EXCLUDES := $(LEGAL_EXCLUDES), \
|
||||
))
|
||||
|
||||
@ -88,6 +88,10 @@ LIBAWT_EXTRA_HEADER_DIRS := \
|
||||
|
||||
LIBAWT_CFLAGS := -D__MEDIALIB_OLD_NAMES -D__USE_J2D_NAMES -DMLIB_NO_LIBSUNMATH
|
||||
|
||||
ifeq ($(ENABLE_HEADLESS_ONLY), true)
|
||||
LIBAWT_CFLAGS += -DHEADLESS
|
||||
endif
|
||||
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
LIBAWT_CFLAGS += -EHsc -DUNICODE -D_UNICODE -DMLIB_OS64BIT
|
||||
LIBAWT_RCFLAGS ?= -I$(TOPDIR)/src/java.base/windows/native/launcher/icons
|
||||
@ -167,11 +171,18 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
$(TOPDIR)/src/$(MODULE)/$(OPENJDK_TARGET_OS_TYPE)/native/common/awt \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_EXCLUDE_FILES := \
|
||||
GLXGraphicsConfig.c \
|
||||
GLXSurfaceData.c \
|
||||
X11PMBlitLoops.c \
|
||||
X11Renderer.c \
|
||||
X11SurfaceData.c \
|
||||
#
|
||||
|
||||
LIBAWT_HEADLESS_EXTRA_HEADER_DIRS := \
|
||||
$(LIBAWT_DEFAULT_HEADER_DIRS) \
|
||||
common/awt/debug \
|
||||
common/font \
|
||||
common/java2d/opengl \
|
||||
java.base:libjvm \
|
||||
#
|
||||
|
||||
@ -191,7 +202,8 @@ ifeq ($(call isTargetOs, windows macosx), false)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBAWT_HEADLESS, \
|
||||
NAME := awt_headless, \
|
||||
EXTRA_SRC := $(LIBAWT_HEADLESS_EXTRA_SRC), \
|
||||
EXCLUDES := medialib, \
|
||||
EXCLUDES := medialib opengl, \
|
||||
EXCLUDE_FILES := $(LIBAWT_HEADLESS_EXCLUDE_FILES), \
|
||||
ONLY_EXPORTED := $(LIBAWT_HEADLESS_ONLY_EXPORTED), \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DHEADLESS=true $(CUPS_CFLAGS) $(FONTCONFIG_CFLAGS) \
|
||||
|
||||
@ -164,7 +164,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
|
||||
|
||||
ifeq ($(USE_EXTERNAL_LIBPNG), false)
|
||||
LIBSPLASHSCREEN_HEADER_DIRS += libsplashscreen/libpng
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0
|
||||
LIBSPLASHSCREEN_CFLAGS += -DPNG_NO_MMX_CODE -DPNG_ARM_NEON_OPT=0 \
|
||||
-DPNG_ARM_NEON_IMPLEMENTATION=0 -DPNG_LOONGARCH_LSX_OPT=0
|
||||
|
||||
ifeq ($(call isTargetOs, linux)+$(call isTargetCpuArch, ppc), true+true)
|
||||
|
||||
@ -54,21 +54,6 @@ $(eval $(call SetupJdkLibrary, BUILD_LIBJDWP, \
|
||||
NAME := jdwp, \
|
||||
OPTIMIZATION := LOW, \
|
||||
CFLAGS := -DJDWP_LOGGING $(ICONV_CFLAGS), \
|
||||
DISABLED_WARNINGS_gcc_eventFilter.c := unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_SDE.c := unused-function, \
|
||||
DISABLED_WARNINGS_gcc_threadControl.c := unused-but-set-variable \
|
||||
unused-variable, \
|
||||
DISABLED_WARNINGS_gcc_utf_util.c := unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_clang_error_messages.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_eventFilter.c := unused-variable, \
|
||||
DISABLED_WARNINGS_clang_EventRequestImpl.c := self-assign, \
|
||||
DISABLED_WARNINGS_clang_inStream.c := sometimes-uninitialized, \
|
||||
DISABLED_WARNINGS_clang_log_messages.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_SDE.c := unused-function, \
|
||||
DISABLED_WARNINGS_clang_threadControl.c := unused-but-set-variable \
|
||||
unused-variable, \
|
||||
DISABLED_WARNINGS_clang_utf_util.c := unused-but-set-variable, \
|
||||
DISABLED_WARNINGS_microsoft_debugInit.c := 5287, \
|
||||
LDFLAGS := $(ICONV_LDFLAGS), \
|
||||
EXTRA_HEADER_DIRS := \
|
||||
include \
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2018, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2018, 2026, 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
|
||||
@ -54,7 +54,7 @@ $(eval $(call SetupJdkExecutable, BUILD_JPACKAGEAPPLAUNCHER, \
|
||||
SRC := applauncher, \
|
||||
EXTRA_SRC := common, \
|
||||
INCLUDE_FILES := $(JPACKAGEAPPLAUNCHER_INCLUDE_FILES), \
|
||||
OPTIMIZATION := LOW, \
|
||||
OPTIMIZATION := SIZE, \
|
||||
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_LinuxPackage.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_Log.cpp := unused-const-variable, \
|
||||
@ -91,7 +91,7 @@ ifeq ($(call isTargetOs, linux), true)
|
||||
common, \
|
||||
EXCLUDE_FILES := LinuxLauncher.c LinuxPackage.c, \
|
||||
LINK_TYPE := C++, \
|
||||
OPTIMIZATION := LOW, \
|
||||
OPTIMIZATION := SIZE, \
|
||||
DISABLED_WARNINGS_gcc_Log.cpp := unused-const-variable, \
|
||||
DISABLED_WARNINGS_clang_JvmLauncherLib.c := format-nonliteral, \
|
||||
DISABLED_WARNINGS_clang_tstrings.cpp := format-nonliteral, \
|
||||
|
||||
@ -31,13 +31,14 @@ include LibCommon.gmk
|
||||
## Build libjaas
|
||||
################################################################################
|
||||
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAAS, \
|
||||
NAME := jaas, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
LIBS_windows := advapi32.lib mpr.lib netapi32.lib user32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJAAS)
|
||||
ifeq ($(call isTargetOs, windows), true)
|
||||
$(eval $(call SetupJdkLibrary, BUILD_LIBJAAS, \
|
||||
NAME := jaas, \
|
||||
OPTIMIZATION := LOW, \
|
||||
EXTRA_HEADER_DIRS := java.base:libjava, \
|
||||
LIBS_windows := advapi32.lib mpr.lib netapi32.lib user32.lib, \
|
||||
))
|
||||
|
||||
TARGETS += $(BUILD_LIBJAAS)
|
||||
endif
|
||||
################################################################################
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2025, 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2012, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<!--
|
||||
Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
Copyright (c) 2005, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2007, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
# Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
|
||||
@ -1,264 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* - Neither the name of Oracle nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This source code is provided to illustrate the usage of a given feature
|
||||
* or technique and has been deliberately simplified. Additional steps
|
||||
* required for a production-quality application, such as security checks,
|
||||
* input validation and proper error handling, might not be present in
|
||||
* this sample code.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
import java.util.EventObject;
|
||||
import java.util.List;
|
||||
import javax.swing.JTable;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
import javax.swing.table.TableCellEditor;
|
||||
import javax.swing.table.TableCellRenderer;
|
||||
import javax.swing.table.TableColumn;
|
||||
|
||||
|
||||
/**
|
||||
* The OldJTable is an unsupported class containing some methods that were
|
||||
* deleted from the JTable between releases 0.6 and 0.7
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class OldJTable extends JTable
|
||||
{
|
||||
/*
|
||||
* A new convenience method returning the index of the column in the
|
||||
* co-ordinate space of the view.
|
||||
*/
|
||||
public int getColumnIndex(Object identifier) {
|
||||
return getColumnModel().getColumnIndex(identifier);
|
||||
}
|
||||
|
||||
//
|
||||
// Methods deleted from the JTable because they only work with the
|
||||
// DefaultTableModel.
|
||||
//
|
||||
|
||||
public TableColumn addColumn(Object columnIdentifier, int width) {
|
||||
return addColumn(columnIdentifier, width, null, null, null);
|
||||
}
|
||||
|
||||
public TableColumn addColumn(Object columnIdentifier, List<?> columnData) {
|
||||
return addColumn(columnIdentifier, -1, null, null, columnData);
|
||||
}
|
||||
|
||||
// Override the new JTable implementation - it will not add a column to the
|
||||
// DefaultTableModel.
|
||||
public TableColumn addColumn(Object columnIdentifier, int width,
|
||||
TableCellRenderer renderer,
|
||||
TableCellEditor editor) {
|
||||
return addColumn(columnIdentifier, width, renderer, editor, null);
|
||||
}
|
||||
|
||||
public TableColumn addColumn(Object columnIdentifier, int width,
|
||||
TableCellRenderer renderer,
|
||||
TableCellEditor editor, List<?> columnData) {
|
||||
checkDefaultTableModel();
|
||||
|
||||
// Set up the model side first
|
||||
DefaultTableModel m = (DefaultTableModel)getModel();
|
||||
m.addColumn(columnIdentifier, columnData.toArray());
|
||||
|
||||
// The column will have been added to the end, so the index of the
|
||||
// column in the model is the last element.
|
||||
TableColumn newColumn = new TableColumn(
|
||||
m.getColumnCount()-1, width, renderer, editor);
|
||||
super.addColumn(newColumn);
|
||||
return newColumn;
|
||||
}
|
||||
|
||||
// Not possilble to make this work the same way ... change it so that
|
||||
// it does not delete columns from the model.
|
||||
public void removeColumn(Object columnIdentifier) {
|
||||
super.removeColumn(getColumn(columnIdentifier));
|
||||
}
|
||||
|
||||
public void addRow(Object[] rowData) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).addRow(rowData);
|
||||
}
|
||||
|
||||
public void addRow(List<?> rowData) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).addRow(rowData.toArray());
|
||||
}
|
||||
|
||||
public void removeRow(int rowIndex) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).removeRow(rowIndex);
|
||||
}
|
||||
|
||||
public void moveRow(int startIndex, int endIndex, int toIndex) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).moveRow(startIndex, endIndex, toIndex);
|
||||
}
|
||||
|
||||
public void insertRow(int rowIndex, Object[] rowData) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).insertRow(rowIndex, rowData);
|
||||
}
|
||||
|
||||
public void insertRow(int rowIndex, List<?> rowData) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).insertRow(rowIndex, rowData.toArray());
|
||||
}
|
||||
|
||||
public void setNumRows(int newSize) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).setNumRows(newSize);
|
||||
}
|
||||
|
||||
public void setDataVector(Object[][] newData, List<?> columnIds) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).setDataVector(
|
||||
newData, columnIds.toArray());
|
||||
}
|
||||
|
||||
public void setDataVector(Object[][] newData, Object[] columnIds) {
|
||||
checkDefaultTableModel();
|
||||
((DefaultTableModel)getModel()).setDataVector(newData, columnIds);
|
||||
}
|
||||
|
||||
protected void checkDefaultTableModel() {
|
||||
if(!(dataModel instanceof DefaultTableModel))
|
||||
throw new InternalError("In order to use this method, the data model must be an instance of DefaultTableModel.");
|
||||
}
|
||||
|
||||
//
|
||||
// Methods removed from JTable in the move from identifiers to ints.
|
||||
//
|
||||
|
||||
public Object getValueAt(Object columnIdentifier, int rowIndex) {
|
||||
return super.getValueAt(rowIndex, getColumnIndex(columnIdentifier));
|
||||
}
|
||||
|
||||
public boolean isCellEditable(Object columnIdentifier, int rowIndex) {
|
||||
return super.isCellEditable(rowIndex, getColumnIndex(columnIdentifier));
|
||||
}
|
||||
|
||||
public void setValueAt(Object aValue, Object columnIdentifier, int rowIndex) {
|
||||
super.setValueAt(aValue, rowIndex, getColumnIndex(columnIdentifier));
|
||||
}
|
||||
|
||||
public boolean editColumnRow(Object identifier, int row) {
|
||||
return super.editCellAt(row, getColumnIndex(identifier));
|
||||
}
|
||||
|
||||
public void moveColumn(Object columnIdentifier, Object targetColumnIdentifier) {
|
||||
moveColumn(getColumnIndex(columnIdentifier),
|
||||
getColumnIndex(targetColumnIdentifier));
|
||||
}
|
||||
|
||||
public boolean isColumnSelected(Object identifier) {
|
||||
return isColumnSelected(getColumnIndex(identifier));
|
||||
}
|
||||
|
||||
public TableColumn addColumn(int modelColumn, int width) {
|
||||
return addColumn(modelColumn, width, null, null);
|
||||
}
|
||||
|
||||
public TableColumn addColumn(int modelColumn) {
|
||||
return addColumn(modelColumn, 75, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new column with <I>modelColumn</I>, <I>width</I>,
|
||||
* <I>renderer</I>, and <I>editor</I> and adds it to the end of
|
||||
* the JTable's array of columns. This method also retrieves the
|
||||
* name of the column using the model's <I>getColumnName(modelColumn)</I>
|
||||
* method, and sets the both the header value and the identifier
|
||||
* for this TableColumn accordingly.
|
||||
* <p>
|
||||
* The <I>modelColumn</I> is the index of the column in the model which
|
||||
* will supply the data for this column in the table. This, like the
|
||||
* <I>columnIdentifier</I> in previous releases, does not change as the
|
||||
* columns are moved in the view.
|
||||
* <p>
|
||||
* For the rest of the JTable API, and all of its associated classes,
|
||||
* columns are referred to in the co-ordinate system of the view, the
|
||||
* index of the column in the model is kept inside the TableColumn
|
||||
* and is used only to retrieve the information from the appropraite
|
||||
* column in the model.
|
||||
* <p>
|
||||
*
|
||||
* @param modelColumn The index of the column in the model
|
||||
* @param width The new column's width. Or -1 to use
|
||||
* the default width
|
||||
* @param renderer The renderer used with the new column.
|
||||
* Or null to use the default renderer.
|
||||
* @param editor The editor used with the new column.
|
||||
* Or null to use the default editor.
|
||||
*/
|
||||
public TableColumn addColumn(int modelColumn, int width,
|
||||
TableCellRenderer renderer,
|
||||
TableCellEditor editor) {
|
||||
TableColumn newColumn = new TableColumn(
|
||||
modelColumn, width, renderer, editor);
|
||||
addColumn(newColumn);
|
||||
return newColumn;
|
||||
}
|
||||
|
||||
//
|
||||
// Methods that had their arguments switched.
|
||||
//
|
||||
|
||||
// These won't work with the new table package.
|
||||
|
||||
/*
|
||||
public Object getValueAt(int columnIndex, int rowIndex) {
|
||||
return super.getValueAt(rowIndex, columnIndex);
|
||||
}
|
||||
|
||||
public boolean isCellEditable(int columnIndex, int rowIndex) {
|
||||
return super.isCellEditable(rowIndex, columnIndex);
|
||||
}
|
||||
|
||||
public void setValueAt(Object aValue, int columnIndex, int rowIndex) {
|
||||
super.setValueAt(aValue, rowIndex, columnIndex);
|
||||
}
|
||||
*/
|
||||
|
||||
public boolean editColumnRow(int columnIndex, int rowIndex) {
|
||||
return super.editCellAt(rowIndex, columnIndex);
|
||||
}
|
||||
|
||||
public boolean editColumnRow(int columnIndex, int rowIndex, EventObject e){
|
||||
return super.editCellAt(rowIndex, columnIndex, e);
|
||||
}
|
||||
|
||||
|
||||
} // End Of Class OldJTable
|
||||
@ -1229,7 +1229,7 @@ public:
|
||||
// predicate controlling addressing modes
|
||||
bool size_fits_all_mem_uses(AddPNode* addp, int shift);
|
||||
|
||||
// Convert BootTest condition to Assembler condition.
|
||||
// Convert BoolTest condition to Assembler condition.
|
||||
// Replicate the logic of cmpOpOper::ccode() and cmpOpUOper::ccode().
|
||||
Assembler::Condition to_assembler_cond(BoolTest::mask cond);
|
||||
%}
|
||||
@ -2579,7 +2579,7 @@ bool size_fits_all_mem_uses(AddPNode* addp, int shift) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Convert BootTest condition to Assembler condition.
|
||||
// Convert BoolTest condition to Assembler condition.
|
||||
// Replicate the logic of cmpOpOper::ccode() and cmpOpUOper::ccode().
|
||||
Assembler::Condition to_assembler_cond(BoolTest::mask cond) {
|
||||
Assembler::Condition result;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2020, 2025, Arm Limited. All rights reserved.
|
||||
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
//
|
||||
@ -201,6 +201,8 @@ source %{
|
||||
case Op_XorReductionV:
|
||||
case Op_MinReductionV:
|
||||
case Op_MaxReductionV:
|
||||
case Op_UMinReductionV:
|
||||
case Op_UMaxReductionV:
|
||||
// Reductions with less than 8 bytes vector length are
|
||||
// not supported.
|
||||
if (length_in_bytes < 8) {
|
||||
@ -383,6 +385,8 @@ source %{
|
||||
return !VM_Version::use_neon_for_vector(length_in_bytes);
|
||||
case Op_MinReductionV:
|
||||
case Op_MaxReductionV:
|
||||
case Op_UMinReductionV:
|
||||
case Op_UMaxReductionV:
|
||||
// For BYTE/SHORT/INT/FLOAT/DOUBLE types, we prefer using NEON
|
||||
// instructions rather than SVE predicated instructions for
|
||||
// better performance.
|
||||
@ -4218,6 +4222,224 @@ instruct reduce_minD_masked(vRegD dst, vRegD dsrc, vReg vsrc, pRegGov pg) %{
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// -------------------- Vector reduction unsigned min/max ----------------------
|
||||
|
||||
// reduction uminI
|
||||
|
||||
instruct reduce_uminI_neon(iRegINoSp dst, iRegIorL2I isrc, vReg vsrc,
|
||||
vReg tmp, rFlagsReg cr) %{
|
||||
predicate(VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(2))) &&
|
||||
(Matcher::vector_element_basic_type(n->in(2)) == T_BYTE ||
|
||||
Matcher::vector_element_basic_type(n->in(2)) == T_SHORT ||
|
||||
Matcher::vector_element_basic_type(n->in(2)) == T_INT));
|
||||
match(Set dst (UMinReductionV isrc vsrc));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_uminI_neon $dst, $isrc, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
|
||||
__ neon_reduce_minmax_integral(this->ideal_Opcode(), $dst$$Register, bt,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
length_in_bytes, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct reduce_uminI_sve(iRegINoSp dst, iRegIorL2I isrc, vReg vsrc,
|
||||
vRegD tmp, rFlagsReg cr) %{
|
||||
predicate(!VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(2))) &&
|
||||
(Matcher::vector_element_basic_type(n->in(2)) == T_BYTE ||
|
||||
Matcher::vector_element_basic_type(n->in(2)) == T_SHORT ||
|
||||
Matcher::vector_element_basic_type(n->in(2)) == T_INT));
|
||||
match(Set dst (UMinReductionV isrc vsrc));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_uminI_sve $dst, $isrc, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
|
||||
assert(length_in_bytes == MaxVectorSize, "invalid vector length");
|
||||
__ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
ptrue, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// reduction uminL
|
||||
|
||||
instruct reduce_uminL_neon(iRegLNoSp dst, iRegL isrc, vReg vsrc, rFlagsReg cr) %{
|
||||
predicate(UseSVE == 0 && Matcher::vector_element_basic_type(n->in(2)) == T_LONG);
|
||||
match(Set dst (UMinReductionV isrc vsrc));
|
||||
effect(TEMP_DEF dst, KILL cr);
|
||||
format %{ "reduce_uminL_neon $dst, $isrc, $vsrc\t# 2L. KILL cr" %}
|
||||
ins_encode %{
|
||||
__ neon_reduce_minmax_integral(this->ideal_Opcode(), $dst$$Register, T_LONG,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
/* vector_length_in_bytes */ 16, fnoreg);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct reduce_uminL_sve(iRegLNoSp dst, iRegL isrc, vReg vsrc,
|
||||
vRegD tmp, rFlagsReg cr) %{
|
||||
predicate(UseSVE > 0 && Matcher::vector_element_basic_type(n->in(2)) == T_LONG);
|
||||
match(Set dst (UMinReductionV isrc vsrc));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_uminL_sve $dst, $isrc, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
|
||||
assert(length_in_bytes == MaxVectorSize, "invalid vector length");
|
||||
__ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
ptrue, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// reduction umin - predicated
|
||||
|
||||
instruct reduce_uminI_masked(iRegINoSp dst, iRegIorL2I isrc, vReg vsrc, pRegGov pg,
|
||||
vRegD tmp, rFlagsReg cr) %{
|
||||
predicate(UseSVE > 0 &&
|
||||
(Matcher::vector_element_basic_type(n->in(1)->in(2)) == T_BYTE ||
|
||||
Matcher::vector_element_basic_type(n->in(1)->in(2)) == T_SHORT ||
|
||||
Matcher::vector_element_basic_type(n->in(1)->in(2)) == T_INT));
|
||||
match(Set dst (UMinReductionV (Binary isrc vsrc) pg));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_uminI_masked $dst, $isrc, $pg, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
|
||||
__ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
$pg$$PRegister, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct reduce_uminL_masked(iRegLNoSp dst, iRegL isrc, vReg vsrc, pRegGov pg,
|
||||
vRegD tmp, rFlagsReg cr) %{
|
||||
predicate(UseSVE > 0 && Matcher::vector_element_basic_type(n->in(1)->in(2)) == T_LONG);
|
||||
match(Set dst (UMinReductionV (Binary isrc vsrc) pg));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_uminL_masked $dst, $isrc, $pg, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
|
||||
__ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
$pg$$PRegister, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// reduction umaxI
|
||||
|
||||
instruct reduce_umaxI_neon(iRegINoSp dst, iRegIorL2I isrc, vReg vsrc,
|
||||
vReg tmp, rFlagsReg cr) %{
|
||||
predicate(VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(2))) &&
|
||||
(Matcher::vector_element_basic_type(n->in(2)) == T_BYTE ||
|
||||
Matcher::vector_element_basic_type(n->in(2)) == T_SHORT ||
|
||||
Matcher::vector_element_basic_type(n->in(2)) == T_INT));
|
||||
match(Set dst (UMaxReductionV isrc vsrc));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_umaxI_neon $dst, $isrc, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
|
||||
__ neon_reduce_minmax_integral(this->ideal_Opcode(), $dst$$Register, bt,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
length_in_bytes, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct reduce_umaxI_sve(iRegINoSp dst, iRegIorL2I isrc, vReg vsrc,
|
||||
vRegD tmp, rFlagsReg cr) %{
|
||||
predicate(!VM_Version::use_neon_for_vector(Matcher::vector_length_in_bytes(n->in(2))) &&
|
||||
(Matcher::vector_element_basic_type(n->in(2)) == T_BYTE ||
|
||||
Matcher::vector_element_basic_type(n->in(2)) == T_SHORT ||
|
||||
Matcher::vector_element_basic_type(n->in(2)) == T_INT));
|
||||
match(Set dst (UMaxReductionV isrc vsrc));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_umaxI_sve $dst, $isrc, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
assert(UseSVE > 0, "must be sve");
|
||||
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
|
||||
assert(length_in_bytes == MaxVectorSize, "invalid vector length");
|
||||
__ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
ptrue, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// reduction umaxL
|
||||
|
||||
instruct reduce_umaxL_neon(iRegLNoSp dst, iRegL isrc, vReg vsrc, rFlagsReg cr) %{
|
||||
predicate(UseSVE == 0 && Matcher::vector_element_basic_type(n->in(2)) == T_LONG);
|
||||
match(Set dst (UMaxReductionV isrc vsrc));
|
||||
effect(TEMP_DEF dst, KILL cr);
|
||||
format %{ "reduce_umaxL_neon $dst, $isrc, $vsrc\t# 2L. KILL cr" %}
|
||||
ins_encode %{
|
||||
__ neon_reduce_minmax_integral(this->ideal_Opcode(), $dst$$Register, T_LONG,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
/* vector_length_in_bytes */ 16, fnoreg);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct reduce_umaxL_sve(iRegLNoSp dst, iRegL isrc, vReg vsrc,
|
||||
vRegD tmp, rFlagsReg cr) %{
|
||||
predicate(UseSVE > 0 && Matcher::vector_element_basic_type(n->in(2)) == T_LONG);
|
||||
match(Set dst (UMaxReductionV isrc vsrc));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_umaxL_sve $dst, $isrc, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
uint length_in_bytes = Matcher::vector_length_in_bytes(this, $vsrc);
|
||||
assert(length_in_bytes == MaxVectorSize, "invalid vector length");
|
||||
__ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, T_LONG,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
ptrue, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// reduction umax - predicated
|
||||
|
||||
instruct reduce_umaxI_masked(iRegINoSp dst, iRegIorL2I isrc, vReg vsrc, pRegGov pg,
|
||||
vRegD tmp, rFlagsReg cr) %{
|
||||
predicate(UseSVE > 0 &&
|
||||
(Matcher::vector_element_basic_type(n->in(1)->in(2)) == T_BYTE ||
|
||||
Matcher::vector_element_basic_type(n->in(1)->in(2)) == T_SHORT ||
|
||||
Matcher::vector_element_basic_type(n->in(1)->in(2)) == T_INT));
|
||||
match(Set dst (UMaxReductionV (Binary isrc vsrc) pg));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_umaxI_masked $dst, $isrc, $pg, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
|
||||
__ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
$pg$$PRegister, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
instruct reduce_umaxL_masked(iRegLNoSp dst, iRegL isrc, vReg vsrc, pRegGov pg,
|
||||
vRegD tmp, rFlagsReg cr) %{
|
||||
predicate(UseSVE > 0 && Matcher::vector_element_basic_type(n->in(1)->in(2)) == T_LONG);
|
||||
match(Set dst (UMaxReductionV (Binary isrc vsrc) pg));
|
||||
effect(TEMP_DEF dst, TEMP tmp, KILL cr);
|
||||
format %{ "reduce_umaxL_masked $dst, $isrc, $pg, $vsrc\t# KILL $tmp, cr" %}
|
||||
ins_encode %{
|
||||
BasicType bt = Matcher::vector_element_basic_type(this, $vsrc);
|
||||
__ sve_reduce_integral(this->ideal_Opcode(), $dst$$Register, bt,
|
||||
$isrc$$Register, $vsrc$$FloatRegister,
|
||||
$pg$$PRegister, $tmp$$FloatRegister);
|
||||
%}
|
||||
ins_pipe(pipe_slow);
|
||||
%}
|
||||
|
||||
// ------------------------------ Vector reinterpret ---------------------------
|
||||
|
||||
instruct reinterpret_same_size(vReg dst_src) %{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2020, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2020, 2025, Arm Limited. All rights reserved.
|
||||
// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
//
|
||||
@ -191,6 +191,8 @@ source %{
|
||||
case Op_XorReductionV:
|
||||
case Op_MinReductionV:
|
||||
case Op_MaxReductionV:
|
||||
case Op_UMinReductionV:
|
||||
case Op_UMaxReductionV:
|
||||
// Reductions with less than 8 bytes vector length are
|
||||
// not supported.
|
||||
if (length_in_bytes < 8) {
|
||||
@ -373,6 +375,8 @@ source %{
|
||||
return !VM_Version::use_neon_for_vector(length_in_bytes);
|
||||
case Op_MinReductionV:
|
||||
case Op_MaxReductionV:
|
||||
case Op_UMinReductionV:
|
||||
case Op_UMaxReductionV:
|
||||
// For BYTE/SHORT/INT/FLOAT/DOUBLE types, we prefer using NEON
|
||||
// instructions rather than SVE predicated instructions for
|
||||
// better performance.
|
||||
@ -2505,6 +2509,32 @@ REDUCE_MAXMIN_INT_PREDICATE(min, L, iRegL, MinReductionV)
|
||||
REDUCE_MAXMIN_FP_PREDICATE(min, F, fsrc, MinReductionV, sve_fminv, fmins)
|
||||
REDUCE_MAXMIN_FP_PREDICATE(min, D, dsrc, MinReductionV, sve_fminv, fmind)
|
||||
|
||||
// -------------------- Vector reduction unsigned min/max ----------------------
|
||||
|
||||
// reduction uminI
|
||||
REDUCE_MAXMIN_I_NEON(umin, UMinReductionV)
|
||||
REDUCE_MAXMIN_I_SVE(umin, UMinReductionV)
|
||||
|
||||
// reduction uminL
|
||||
REDUCE_MAXMIN_L_NEON(umin, UMinReductionV)
|
||||
REDUCE_MAXMIN_L_SVE(umin, UMinReductionV)
|
||||
|
||||
// reduction umin - predicated
|
||||
REDUCE_MAXMIN_INT_PREDICATE(umin, I, iRegIorL2I, UMinReductionV)
|
||||
REDUCE_MAXMIN_INT_PREDICATE(umin, L, iRegL, UMinReductionV)
|
||||
|
||||
// reduction umaxI
|
||||
REDUCE_MAXMIN_I_NEON(umax, UMaxReductionV)
|
||||
REDUCE_MAXMIN_I_SVE(umax, UMaxReductionV)
|
||||
|
||||
// reduction umaxL
|
||||
REDUCE_MAXMIN_L_NEON(umax, UMaxReductionV)
|
||||
REDUCE_MAXMIN_L_SVE(umax, UMaxReductionV)
|
||||
|
||||
// reduction umax - predicated
|
||||
REDUCE_MAXMIN_INT_PREDICATE(umax, I, iRegIorL2I, UMaxReductionV)
|
||||
REDUCE_MAXMIN_INT_PREDICATE(umax, L, iRegL, UMaxReductionV)
|
||||
|
||||
// ------------------------------ Vector reinterpret ---------------------------
|
||||
|
||||
instruct reinterpret_same_size(vReg dst_src) %{
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2024, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -2658,6 +2658,8 @@ template<typename R, typename... Rx>
|
||||
INSN(uminv, 1, 0b011011, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
|
||||
INSN(smaxp, 0, 0b101001, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
|
||||
INSN(sminp, 0, 0b101011, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
|
||||
INSN(umaxp, 1, 0b101001, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
|
||||
INSN(uminp, 1, 0b101011, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
|
||||
INSN(sqdmulh,0, 0b101101, false); // accepted arrangements: T4H, T8H, T2S, T4S
|
||||
INSN(shsubv, 0, 0b001001, false); // accepted arrangements: T8B, T16B, T4H, T8H, T2S, T4S
|
||||
|
||||
@ -3490,7 +3492,9 @@ public:
|
||||
INSN(sve_sub, 0b00000100, 0b000001000); // vector sub
|
||||
INSN(sve_uaddv, 0b00000100, 0b000001001); // unsigned add reduction to scalar
|
||||
INSN(sve_umax, 0b00000100, 0b001001000); // unsigned maximum vectors
|
||||
INSN(sve_umaxv, 0b00000100, 0b001001001); // unsigned maximum reduction to scalar
|
||||
INSN(sve_umin, 0b00000100, 0b001011000); // unsigned minimum vectors
|
||||
INSN(sve_uminv, 0b00000100, 0b001011001); // unsigned minimum reduction to scalar
|
||||
#undef INSN
|
||||
|
||||
// SVE floating-point arithmetic - predicate
|
||||
@ -4325,6 +4329,7 @@ public:
|
||||
#undef INSN
|
||||
|
||||
Assembler(CodeBuffer* code) : AbstractAssembler(code) {
|
||||
MACOS_AARCH64_ONLY(os::thread_wx_enable_write());
|
||||
}
|
||||
|
||||
// Stack overflow checking
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
|
||||
@ -1218,43 +1218,11 @@ void LIR_Assembler::emit_alloc_array(LIR_OpAllocArray* op) {
|
||||
__ bind(*op->stub()->continuation());
|
||||
}
|
||||
|
||||
void LIR_Assembler::type_profile_helper(Register mdo,
|
||||
ciMethodData *md, ciProfileData *data,
|
||||
Register recv, Label* update_done) {
|
||||
void LIR_Assembler::type_profile_helper(Register mdo, ciMethodData *md,
|
||||
ciProfileData *data, Register recv) {
|
||||
|
||||
// Given a profile data offset, generate an Address which points to
|
||||
// the corresponding slot in mdo->data().
|
||||
// Clobbers rscratch2.
|
||||
auto slot_at = [=](ByteSize offset) -> Address {
|
||||
return __ form_address(rscratch2, mdo,
|
||||
md->byte_offset_of_slot(data, offset),
|
||||
LogBytesPerWord);
|
||||
};
|
||||
|
||||
for (uint i = 0; i < ReceiverTypeData::row_limit(); i++) {
|
||||
Label next_test;
|
||||
// See if the receiver is receiver[n].
|
||||
__ ldr(rscratch1, slot_at(ReceiverTypeData::receiver_offset(i)));
|
||||
__ cmp(recv, rscratch1);
|
||||
__ br(Assembler::NE, next_test);
|
||||
__ addptr(slot_at(ReceiverTypeData::receiver_count_offset(i)),
|
||||
DataLayout::counter_increment);
|
||||
__ b(*update_done);
|
||||
__ bind(next_test);
|
||||
}
|
||||
|
||||
// Didn't find receiver; find next empty slot and fill it in
|
||||
for (uint i = 0; i < ReceiverTypeData::row_limit(); i++) {
|
||||
Label next_test;
|
||||
Address recv_addr(slot_at(ReceiverTypeData::receiver_offset(i)));
|
||||
__ ldr(rscratch1, recv_addr);
|
||||
__ cbnz(rscratch1, next_test);
|
||||
__ str(recv, recv_addr);
|
||||
__ mov(rscratch1, DataLayout::counter_increment);
|
||||
__ str(rscratch1, slot_at(ReceiverTypeData::receiver_count_offset(i)));
|
||||
__ b(*update_done);
|
||||
__ bind(next_test);
|
||||
}
|
||||
int mdp_offset = md->byte_offset_of_slot(data, in_ByteSize(0));
|
||||
__ profile_receiver_type(recv, mdo, mdp_offset);
|
||||
}
|
||||
|
||||
void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, Label* failure, Label* obj_is_null) {
|
||||
@ -1316,14 +1284,9 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
|
||||
__ b(*obj_is_null);
|
||||
__ bind(not_null);
|
||||
|
||||
Label update_done;
|
||||
Register recv = k_RInfo;
|
||||
__ load_klass(recv, obj);
|
||||
type_profile_helper(mdo, md, data, recv, &update_done);
|
||||
Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()));
|
||||
__ addptr(counter_addr, DataLayout::counter_increment);
|
||||
|
||||
__ bind(update_done);
|
||||
type_profile_helper(mdo, md, data, recv);
|
||||
} else {
|
||||
__ cbz(obj, *obj_is_null);
|
||||
}
|
||||
@ -1430,13 +1393,9 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
|
||||
__ b(done);
|
||||
__ bind(not_null);
|
||||
|
||||
Label update_done;
|
||||
Register recv = k_RInfo;
|
||||
__ load_klass(recv, value);
|
||||
type_profile_helper(mdo, md, data, recv, &update_done);
|
||||
Address counter_addr(mdo, md->byte_offset_of_slot(data, CounterData::count_offset()));
|
||||
__ addptr(counter_addr, DataLayout::counter_increment);
|
||||
__ bind(update_done);
|
||||
type_profile_helper(mdo, md, data, recv);
|
||||
} else {
|
||||
__ cbz(value, done);
|
||||
}
|
||||
@ -2540,13 +2499,9 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
|
||||
if (C1OptimizeVirtualCallProfiling && known_klass != nullptr) {
|
||||
// We know the type that will be seen at this call site; we can
|
||||
// statically update the MethodData* rather than needing to do
|
||||
// dynamic tests on the receiver type
|
||||
|
||||
// NOTE: we should probably put a lock around this search to
|
||||
// avoid collisions by concurrent compilations
|
||||
// dynamic tests on the receiver type.
|
||||
ciVirtualCallData* vc_data = (ciVirtualCallData*) data;
|
||||
uint i;
|
||||
for (i = 0; i < VirtualCallData::row_limit(); i++) {
|
||||
for (uint i = 0; i < VirtualCallData::row_limit(); i++) {
|
||||
ciKlass* receiver = vc_data->receiver(i);
|
||||
if (known_klass->equals(receiver)) {
|
||||
Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)));
|
||||
@ -2554,36 +2509,13 @@ void LIR_Assembler::emit_profile_call(LIR_OpProfileCall* op) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Receiver type not found in profile data; select an empty slot
|
||||
|
||||
// Note that this is less efficient than it should be because it
|
||||
// always does a write to the receiver part of the
|
||||
// VirtualCallData rather than just the first time
|
||||
for (i = 0; i < VirtualCallData::row_limit(); i++) {
|
||||
ciKlass* receiver = vc_data->receiver(i);
|
||||
if (receiver == nullptr) {
|
||||
__ mov_metadata(rscratch1, known_klass->constant_encoding());
|
||||
Address recv_addr =
|
||||
__ form_address(rscratch2, mdo,
|
||||
md->byte_offset_of_slot(data, VirtualCallData::receiver_offset(i)),
|
||||
LogBytesPerWord);
|
||||
__ str(rscratch1, recv_addr);
|
||||
Address data_addr(mdo, md->byte_offset_of_slot(data, VirtualCallData::receiver_count_offset(i)));
|
||||
__ addptr(data_addr, DataLayout::counter_increment);
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Receiver type is not found in profile data.
|
||||
// Fall back to runtime helper to handle the rest at runtime.
|
||||
__ mov_metadata(recv, known_klass->constant_encoding());
|
||||
} else {
|
||||
__ load_klass(recv, recv);
|
||||
Label update_done;
|
||||
type_profile_helper(mdo, md, data, recv, &update_done);
|
||||
// Receiver did not match any saved receiver and there is no empty row for it.
|
||||
// Increment total counter to indicate polymorphic case.
|
||||
__ addptr(counter_addr, DataLayout::counter_increment);
|
||||
|
||||
__ bind(update_done);
|
||||
}
|
||||
type_profile_helper(mdo, md, data, recv);
|
||||
} else {
|
||||
// Static call
|
||||
__ addptr(counter_addr, DataLayout::counter_increment);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -50,9 +50,8 @@ friend class ArrayCopyStub;
|
||||
Address stack_slot_address(int index, uint shift, Register tmp, int adjust = 0);
|
||||
|
||||
// Record the type of the receiver in ReceiverTypeData
|
||||
void type_profile_helper(Register mdo,
|
||||
ciMethodData *md, ciProfileData *data,
|
||||
Register recv, Label* update_done);
|
||||
void type_profile_helper(Register mdo, ciMethodData *md,
|
||||
ciProfileData *data, Register recv);
|
||||
void add_debug_info_for_branch(address adr, CodeEmitInfo* info);
|
||||
|
||||
void casw(Register addr, Register newval, Register cmpval);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2026, 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
|
||||
@ -1960,50 +1960,76 @@ void C2_MacroAssembler::neon_reduce_logical(int opc, Register dst, BasicType bt,
|
||||
BLOCK_COMMENT("} neon_reduce_logical");
|
||||
}
|
||||
|
||||
// Vector reduction min/max for integral type with ASIMD instructions.
|
||||
// Helper function to decode min/max reduction operation properties
|
||||
void C2_MacroAssembler::decode_minmax_reduction_opc(int opc, bool* is_min,
|
||||
bool* is_unsigned,
|
||||
Condition* cond) {
|
||||
switch(opc) {
|
||||
case Op_MinReductionV:
|
||||
*is_min = true; *is_unsigned = false; *cond = LT; break;
|
||||
case Op_MaxReductionV:
|
||||
*is_min = false; *is_unsigned = false; *cond = GT; break;
|
||||
case Op_UMinReductionV:
|
||||
*is_min = true; *is_unsigned = true; *cond = LO; break;
|
||||
case Op_UMaxReductionV:
|
||||
*is_min = false; *is_unsigned = true; *cond = HI; break;
|
||||
default:
|
||||
ShouldNotReachHere();
|
||||
}
|
||||
}
|
||||
|
||||
// Vector reduction min/max/umin/umax for integral type with ASIMD instructions.
|
||||
// Note: vtmp is not used and expected to be fnoreg for T_LONG case.
|
||||
// Clobbers: rscratch1, rflags
|
||||
void C2_MacroAssembler::neon_reduce_minmax_integral(int opc, Register dst, BasicType bt,
|
||||
Register isrc, FloatRegister vsrc,
|
||||
unsigned vector_length_in_bytes,
|
||||
FloatRegister vtmp) {
|
||||
assert(opc == Op_MinReductionV || opc == Op_MaxReductionV, "unsupported");
|
||||
assert(opc == Op_MinReductionV || opc == Op_MaxReductionV ||
|
||||
opc == Op_UMinReductionV || opc == Op_UMaxReductionV, "unsupported");
|
||||
assert(vector_length_in_bytes == 8 || vector_length_in_bytes == 16, "unsupported");
|
||||
assert(bt == T_BYTE || bt == T_SHORT || bt == T_INT || bt == T_LONG, "unsupported");
|
||||
assert_different_registers(dst, isrc);
|
||||
bool isQ = vector_length_in_bytes == 16;
|
||||
bool is_min = opc == Op_MinReductionV;
|
||||
|
||||
bool is_min;
|
||||
bool is_unsigned;
|
||||
Condition cond;
|
||||
decode_minmax_reduction_opc(opc, &is_min, &is_unsigned, &cond);
|
||||
BLOCK_COMMENT("neon_reduce_minmax_integral {");
|
||||
if (bt == T_LONG) {
|
||||
assert(vtmp == fnoreg, "should be");
|
||||
assert(isQ, "should be");
|
||||
umov(rscratch1, vsrc, D, 0);
|
||||
cmp(isrc, rscratch1);
|
||||
csel(dst, isrc, rscratch1, is_min ? LT : GT);
|
||||
csel(dst, isrc, rscratch1, cond);
|
||||
umov(rscratch1, vsrc, D, 1);
|
||||
cmp(dst, rscratch1);
|
||||
csel(dst, dst, rscratch1, is_min ? LT : GT);
|
||||
csel(dst, dst, rscratch1, cond);
|
||||
} else {
|
||||
SIMD_Arrangement size = esize2arrangement((unsigned)type2aelembytes(bt), isQ);
|
||||
if (size == T2S) {
|
||||
is_min ? sminp(vtmp, size, vsrc, vsrc) : smaxp(vtmp, size, vsrc, vsrc);
|
||||
// For T2S (2x32-bit elements), use pairwise instructions because
|
||||
// uminv/umaxv/sminv/smaxv don't support arrangement 2S.
|
||||
neon_minmaxp(is_unsigned, is_min, vtmp, size, vsrc, vsrc);
|
||||
} else {
|
||||
is_min ? sminv(vtmp, size, vsrc) : smaxv(vtmp, size, vsrc);
|
||||
// For other sizes, use reduction to scalar instructions.
|
||||
neon_minmaxv(is_unsigned, is_min, vtmp, size, vsrc);
|
||||
}
|
||||
if (bt == T_INT) {
|
||||
umov(dst, vtmp, S, 0);
|
||||
} else if (is_unsigned) {
|
||||
umov(dst, vtmp, elemType_to_regVariant(bt), 0);
|
||||
} else {
|
||||
smov(dst, vtmp, elemType_to_regVariant(bt), 0);
|
||||
}
|
||||
cmpw(dst, isrc);
|
||||
cselw(dst, dst, isrc, is_min ? LT : GT);
|
||||
cselw(dst, dst, isrc, cond);
|
||||
}
|
||||
BLOCK_COMMENT("} neon_reduce_minmax_integral");
|
||||
}
|
||||
|
||||
// Vector reduction for integral type with SVE instruction.
|
||||
// Supported operations are Add, And, Or, Xor, Max, Min.
|
||||
// Supported operations are Add, And, Or, Xor, Max, Min, UMax, UMin.
|
||||
// rflags would be clobbered if opc is Op_MaxReductionV or Op_MinReductionV.
|
||||
void C2_MacroAssembler::sve_reduce_integral(int opc, Register dst, BasicType bt, Register src1,
|
||||
FloatRegister src2, PRegister pg, FloatRegister tmp) {
|
||||
@ -2075,35 +2101,27 @@ void C2_MacroAssembler::sve_reduce_integral(int opc, Register dst, BasicType bt,
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Op_MaxReductionV: {
|
||||
sve_smaxv(tmp, size, pg, src2);
|
||||
if (bt == T_INT || bt == T_LONG) {
|
||||
case Op_MaxReductionV:
|
||||
case Op_MinReductionV:
|
||||
case Op_UMaxReductionV:
|
||||
case Op_UMinReductionV: {
|
||||
bool is_min;
|
||||
bool is_unsigned;
|
||||
Condition cond;
|
||||
decode_minmax_reduction_opc(opc, &is_min, &is_unsigned, &cond);
|
||||
sve_minmaxv(is_unsigned, is_min, tmp, size, pg, src2);
|
||||
// Move result from vector to general register
|
||||
if (is_unsigned || bt == T_INT || bt == T_LONG) {
|
||||
umov(dst, tmp, size, 0);
|
||||
} else {
|
||||
smov(dst, tmp, size, 0);
|
||||
}
|
||||
if (bt == T_LONG) {
|
||||
cmp(dst, src1);
|
||||
csel(dst, dst, src1, Assembler::GT);
|
||||
csel(dst, dst, src1, cond);
|
||||
} else {
|
||||
cmpw(dst, src1);
|
||||
cselw(dst, dst, src1, Assembler::GT);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Op_MinReductionV: {
|
||||
sve_sminv(tmp, size, pg, src2);
|
||||
if (bt == T_INT || bt == T_LONG) {
|
||||
umov(dst, tmp, size, 0);
|
||||
} else {
|
||||
smov(dst, tmp, size, 0);
|
||||
}
|
||||
if (bt == T_LONG) {
|
||||
cmp(dst, src1);
|
||||
csel(dst, dst, src1, Assembler::LT);
|
||||
} else {
|
||||
cmpw(dst, src1);
|
||||
cselw(dst, dst, src1, Assembler::LT);
|
||||
cselw(dst, dst, src1, cond);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2020, 2026, 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
|
||||
@ -34,6 +34,37 @@
|
||||
void neon_reduce_logical_helper(int opc, bool sf, Register Rd, Register Rn, Register Rm,
|
||||
enum shift_kind kind = Assembler::LSL, unsigned shift = 0);
|
||||
|
||||
// Helper functions for min/max reduction operations
|
||||
|
||||
void decode_minmax_reduction_opc(int opc, bool* is_min, bool* is_unsigned, Condition* cond);
|
||||
|
||||
void neon_minmaxp(bool is_unsigned, bool is_min, FloatRegister dst,
|
||||
SIMD_Arrangement size, FloatRegister src1, FloatRegister src2) {
|
||||
auto m = is_unsigned ? (is_min ? &Assembler::uminp : &Assembler::umaxp)
|
||||
: (is_min ? &Assembler::sminp : &Assembler::smaxp);
|
||||
(this->*m)(dst, size, src1, src2);
|
||||
}
|
||||
|
||||
// Typedefs used to disambiguate overloaded member functions.
|
||||
typedef void (Assembler::*neon_reduction2)
|
||||
(FloatRegister, SIMD_Arrangement, FloatRegister);
|
||||
|
||||
void neon_minmaxv(bool is_unsigned, bool is_min, FloatRegister dst,
|
||||
SIMD_Arrangement size, FloatRegister src) {
|
||||
auto m = is_unsigned ? (is_min ? (neon_reduction2)&Assembler::uminv
|
||||
: (neon_reduction2)&Assembler::umaxv)
|
||||
: (is_min ? &Assembler::sminv
|
||||
: &Assembler::smaxv);
|
||||
(this->*m)(dst, size, src);
|
||||
}
|
||||
|
||||
void sve_minmaxv(bool is_unsigned, bool is_min, FloatRegister dst,
|
||||
SIMD_RegVariant size, PRegister pg, FloatRegister src) {
|
||||
auto m = is_unsigned ? (is_min ? &Assembler::sve_uminv : &Assembler::sve_umaxv)
|
||||
: (is_min ? &Assembler::sve_sminv : &Assembler::sve_smaxv);
|
||||
(this->*m)(dst, size, pg, src);
|
||||
}
|
||||
|
||||
void select_from_two_vectors_neon(FloatRegister dst, FloatRegister src1,
|
||||
FloatRegister src2, FloatRegister index,
|
||||
FloatRegister tmp, unsigned vector_length_in_bytes);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2022, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2025, 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
|
||||
|
||||
@ -209,6 +209,10 @@ void BarrierSetNMethod::set_guard_value(nmethod* nm, int value, int bit_mask) {
|
||||
bs_asm->increment_patching_epoch();
|
||||
}
|
||||
|
||||
// Enable WXWrite: the function is called directly from nmethod_entry_barrier
|
||||
// stub.
|
||||
MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, Thread::current()));
|
||||
|
||||
NativeNMethodBarrier barrier(nm);
|
||||
barrier.set_value(value, bit_mask);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2018, 2025, 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
|
||||
|
||||
@ -85,26 +85,16 @@ void ShenandoahBarrierSetAssembler::arraycopy_epilogue(MacroAssembler* masm, Dec
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::shenandoah_write_barrier_pre(MacroAssembler* masm,
|
||||
Register obj,
|
||||
Register pre_val,
|
||||
Register thread,
|
||||
Register tmp,
|
||||
bool tosca_live,
|
||||
bool expand_call) {
|
||||
if (ShenandoahSATBBarrier) {
|
||||
satb_write_barrier_pre(masm, obj, pre_val, thread, tmp, rscratch1, tosca_live, expand_call);
|
||||
}
|
||||
}
|
||||
void ShenandoahBarrierSetAssembler::satb_barrier(MacroAssembler* masm,
|
||||
Register obj,
|
||||
Register pre_val,
|
||||
Register thread,
|
||||
Register tmp1,
|
||||
Register tmp2,
|
||||
bool tosca_live,
|
||||
bool expand_call) {
|
||||
assert(ShenandoahSATBBarrier, "Should be checked by caller");
|
||||
|
||||
void ShenandoahBarrierSetAssembler::satb_write_barrier_pre(MacroAssembler* masm,
|
||||
Register obj,
|
||||
Register pre_val,
|
||||
Register thread,
|
||||
Register tmp1,
|
||||
Register tmp2,
|
||||
bool tosca_live,
|
||||
bool expand_call) {
|
||||
// If expand_call is true then we expand the call_VM_leaf macro
|
||||
// directly to skip generating the check by
|
||||
// InterpreterMacroAssembler::call_VM_leaf_base that checks _last_sp.
|
||||
@ -358,20 +348,20 @@ void ShenandoahBarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet d
|
||||
if (ShenandoahBarrierSet::need_keep_alive_barrier(decorators, type)) {
|
||||
__ enter(/*strip_ret_addr*/true);
|
||||
__ push_call_clobbered_registers();
|
||||
satb_write_barrier_pre(masm /* masm */,
|
||||
noreg /* obj */,
|
||||
dst /* pre_val */,
|
||||
rthread /* thread */,
|
||||
tmp1 /* tmp1 */,
|
||||
tmp2 /* tmp2 */,
|
||||
true /* tosca_live */,
|
||||
true /* expand_call */);
|
||||
satb_barrier(masm /* masm */,
|
||||
noreg /* obj */,
|
||||
dst /* pre_val */,
|
||||
rthread /* thread */,
|
||||
tmp1 /* tmp1 */,
|
||||
tmp2 /* tmp2 */,
|
||||
true /* tosca_live */,
|
||||
true /* expand_call */);
|
||||
__ pop_call_clobbered_registers();
|
||||
__ leave();
|
||||
}
|
||||
}
|
||||
|
||||
void ShenandoahBarrierSetAssembler::store_check(MacroAssembler* masm, Register obj) {
|
||||
void ShenandoahBarrierSetAssembler::card_barrier(MacroAssembler* masm, Register obj) {
|
||||
assert(ShenandoahCardBarrier, "Should have been checked by caller");
|
||||
|
||||
__ lsr(obj, obj, CardTable::card_shift());
|
||||
@ -394,13 +384,13 @@ void ShenandoahBarrierSetAssembler::store_check(MacroAssembler* masm, Register o
|
||||
|
||||
void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type,
|
||||
Address dst, Register val, Register tmp1, Register tmp2, Register tmp3) {
|
||||
bool on_oop = is_reference_type(type);
|
||||
if (!on_oop) {
|
||||
// 1: non-reference types require no barriers
|
||||
if (!is_reference_type(type)) {
|
||||
BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2, tmp3);
|
||||
return;
|
||||
}
|
||||
|
||||
// flatten object address if needed
|
||||
// Flatten object address right away for simplicity: likely needed by barriers
|
||||
if (dst.index() == noreg && dst.offset() == 0) {
|
||||
if (dst.base() != tmp3) {
|
||||
__ mov(tmp3, dst.base());
|
||||
@ -409,20 +399,26 @@ void ShenandoahBarrierSetAssembler::store_at(MacroAssembler* masm, DecoratorSet
|
||||
__ lea(tmp3, dst);
|
||||
}
|
||||
|
||||
shenandoah_write_barrier_pre(masm,
|
||||
tmp3 /* obj */,
|
||||
tmp2 /* pre_val */,
|
||||
rthread /* thread */,
|
||||
tmp1 /* tmp */,
|
||||
val != noreg /* tosca_live */,
|
||||
false /* expand_call */);
|
||||
bool storing_non_null = (val != noreg);
|
||||
|
||||
// 2: pre-barrier: SATB needs the previous value
|
||||
if (ShenandoahBarrierSet::need_satb_barrier(decorators, type)) {
|
||||
satb_barrier(masm,
|
||||
tmp3 /* obj */,
|
||||
tmp2 /* pre_val */,
|
||||
rthread /* thread */,
|
||||
tmp1 /* tmp */,
|
||||
rscratch1 /* tmp2 */,
|
||||
storing_non_null /* tosca_live */,
|
||||
false /* expand_call */);
|
||||
}
|
||||
|
||||
// Store!
|
||||
BarrierSetAssembler::store_at(masm, decorators, type, Address(tmp3, 0), val, noreg, noreg, noreg);
|
||||
|
||||
bool in_heap = (decorators & IN_HEAP) != 0;
|
||||
bool needs_post_barrier = (val != noreg) && in_heap && ShenandoahCardBarrier;
|
||||
if (needs_post_barrier) {
|
||||
store_check(masm, tmp3);
|
||||
// 3: post-barrier: card barrier needs store address
|
||||
if (ShenandoahBarrierSet::need_card_barrier(decorators, type) && storing_non_null) {
|
||||
card_barrier(masm, tmp3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -40,23 +40,16 @@ class StubCodeGenerator;
|
||||
class ShenandoahBarrierSetAssembler: public BarrierSetAssembler {
|
||||
private:
|
||||
|
||||
void satb_write_barrier_pre(MacroAssembler* masm,
|
||||
Register obj,
|
||||
Register pre_val,
|
||||
Register thread,
|
||||
Register tmp1,
|
||||
Register tmp2,
|
||||
bool tosca_live,
|
||||
bool expand_call);
|
||||
void shenandoah_write_barrier_pre(MacroAssembler* masm,
|
||||
Register obj,
|
||||
Register pre_val,
|
||||
Register thread,
|
||||
Register tmp,
|
||||
bool tosca_live,
|
||||
bool expand_call);
|
||||
void satb_barrier(MacroAssembler* masm,
|
||||
Register obj,
|
||||
Register pre_val,
|
||||
Register thread,
|
||||
Register tmp1,
|
||||
Register tmp2,
|
||||
bool tosca_live,
|
||||
bool expand_call);
|
||||
|
||||
void store_check(MacroAssembler* masm, Register obj);
|
||||
void card_barrier(MacroAssembler* masm, Register obj);
|
||||
|
||||
void resolve_forward_pointer(MacroAssembler* masm, Register dst, Register tmp = noreg);
|
||||
void resolve_forward_pointer_not_null(MacroAssembler* masm, Register dst, Register tmp = noreg);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
//
|
||||
// Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
// Copyright (c) 2019, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2015, 2019, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -39,7 +39,7 @@ define_pd_global(bool, UncommonNullCast, true); // Uncommon-trap nulls
|
||||
define_pd_global(bool, DelayCompilerStubsGeneration, COMPILER2_OR_JVMCI);
|
||||
|
||||
define_pd_global(size_t, CodeCacheSegmentSize, 64);
|
||||
define_pd_global(intx, CodeEntryAlignment, 64);
|
||||
define_pd_global(uint, CodeEntryAlignment, 64);
|
||||
define_pd_global(intx, OptoLoopAlignment, 16);
|
||||
|
||||
#define DEFAULT_STACK_YELLOW_PAGES (2)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2023, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2020, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -23,13 +23,13 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h> // do not reorder
|
||||
#include <stdint.h> // do not reorder
|
||||
|
||||
#include "cppstdlib/cstdlib.hpp"
|
||||
#include "immediate_aarch64.hpp"
|
||||
#include "metaprogramming/primitiveConversions.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// there are at most 2^13 possible logical immediate encodings
|
||||
// however, some combinations of immr and imms are invalid
|
||||
static const unsigned LI_TABLE_SIZE = (1 << 13);
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2025, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -22,10 +23,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _IMMEDIATE_H
|
||||
#define _IMMEDIATE_H
|
||||
#ifndef CPU_AARCH64_IMMEDIATE_AARCH64_HPP
|
||||
#define CPU_AARCH64_IMMEDIATE_AARCH64_HPP
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* functions to map backwards and forwards between logical or floating
|
||||
@ -51,4 +52,4 @@ uint32_t encoding_for_logical_immediate(uint64_t immediate);
|
||||
uint64_t fp_immediate_for_encoding(uint32_t imm8, int is_dp);
|
||||
uint32_t encoding_for_fp_immediate(float immediate);
|
||||
|
||||
#endif // _IMMEDIATE_H
|
||||
#endif // CPU_AARCH64_IMMEDIATE_AARCH64_HPP
|
||||
|
||||
@ -240,15 +240,14 @@ void InterpreterMacroAssembler::load_resolved_klass_at_offset(
|
||||
// Rsub_klass: subklass
|
||||
//
|
||||
// Kills:
|
||||
// r2, r5
|
||||
// r2
|
||||
void InterpreterMacroAssembler::gen_subtype_check(Register Rsub_klass,
|
||||
Label& ok_is_subtype) {
|
||||
assert(Rsub_klass != r0, "r0 holds superklass");
|
||||
assert(Rsub_klass != r2, "r2 holds 2ndary super array length");
|
||||
assert(Rsub_klass != r5, "r5 holds 2ndary super array scan ptr");
|
||||
|
||||
// Profile the not-null value's klass.
|
||||
profile_typecheck(r2, Rsub_klass, r5); // blows r2, reloads r5
|
||||
profile_typecheck(r2, Rsub_klass); // blows r2
|
||||
|
||||
// Do the check.
|
||||
check_klass_subtype(Rsub_klass, r0, r2, ok_is_subtype); // blows r2
|
||||
@ -991,7 +990,6 @@ void InterpreterMacroAssembler::profile_final_call(Register mdp) {
|
||||
|
||||
void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
|
||||
Register mdp,
|
||||
Register reg2,
|
||||
bool receiver_can_be_null) {
|
||||
if (ProfileInterpreter) {
|
||||
Label profile_continue;
|
||||
@ -1009,7 +1007,7 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
|
||||
}
|
||||
|
||||
// Record the receiver type.
|
||||
record_klass_in_profile(receiver, mdp, reg2);
|
||||
profile_receiver_type(receiver, mdp, 0);
|
||||
bind(skip_receiver_profile);
|
||||
|
||||
// The method data pointer needs to be updated to reflect the new target.
|
||||
@ -1018,131 +1016,6 @@ void InterpreterMacroAssembler::profile_virtual_call(Register receiver,
|
||||
}
|
||||
}
|
||||
|
||||
// This routine creates a state machine for updating the multi-row
|
||||
// type profile at a virtual call site (or other type-sensitive bytecode).
|
||||
// The machine visits each row (of receiver/count) until the receiver type
|
||||
// is found, or until it runs out of rows. At the same time, it remembers
|
||||
// the location of the first empty row. (An empty row records null for its
|
||||
// receiver, and can be allocated for a newly-observed receiver type.)
|
||||
// Because there are two degrees of freedom in the state, a simple linear
|
||||
// search will not work; it must be a decision tree. Hence this helper
|
||||
// function is recursive, to generate the required tree structured code.
|
||||
// It's the interpreter, so we are trading off code space for speed.
|
||||
// See below for example code.
|
||||
void InterpreterMacroAssembler::record_klass_in_profile_helper(
|
||||
Register receiver, Register mdp,
|
||||
Register reg2, int start_row,
|
||||
Label& done) {
|
||||
if (TypeProfileWidth == 0) {
|
||||
increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
|
||||
} else {
|
||||
record_item_in_profile_helper(receiver, mdp, reg2, 0, done, TypeProfileWidth,
|
||||
&VirtualCallData::receiver_offset, &VirtualCallData::receiver_count_offset);
|
||||
}
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::record_item_in_profile_helper(Register item, Register mdp,
|
||||
Register reg2, int start_row, Label& done, int total_rows,
|
||||
OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn) {
|
||||
int last_row = total_rows - 1;
|
||||
assert(start_row <= last_row, "must be work left to do");
|
||||
// Test this row for both the item and for null.
|
||||
// Take any of three different outcomes:
|
||||
// 1. found item => increment count and goto done
|
||||
// 2. found null => keep looking for case 1, maybe allocate this cell
|
||||
// 3. found something else => keep looking for cases 1 and 2
|
||||
// Case 3 is handled by a recursive call.
|
||||
for (int row = start_row; row <= last_row; row++) {
|
||||
Label next_test;
|
||||
bool test_for_null_also = (row == start_row);
|
||||
|
||||
// See if the item is item[n].
|
||||
int item_offset = in_bytes(item_offset_fn(row));
|
||||
test_mdp_data_at(mdp, item_offset, item,
|
||||
(test_for_null_also ? reg2 : noreg),
|
||||
next_test);
|
||||
// (Reg2 now contains the item from the CallData.)
|
||||
|
||||
// The item is item[n]. Increment count[n].
|
||||
int count_offset = in_bytes(item_count_offset_fn(row));
|
||||
increment_mdp_data_at(mdp, count_offset);
|
||||
b(done);
|
||||
bind(next_test);
|
||||
|
||||
if (test_for_null_also) {
|
||||
Label found_null;
|
||||
// Failed the equality check on item[n]... Test for null.
|
||||
if (start_row == last_row) {
|
||||
// The only thing left to do is handle the null case.
|
||||
cbz(reg2, found_null);
|
||||
// Item did not match any saved item and there is no empty row for it.
|
||||
// Increment total counter to indicate polymorphic case.
|
||||
increment_mdp_data_at(mdp, in_bytes(CounterData::count_offset()));
|
||||
b(done);
|
||||
bind(found_null);
|
||||
break;
|
||||
}
|
||||
// Since null is rare, make it be the branch-taken case.
|
||||
cbz(reg2, found_null);
|
||||
|
||||
// Put all the "Case 3" tests here.
|
||||
record_item_in_profile_helper(item, mdp, reg2, start_row + 1, done, total_rows,
|
||||
item_offset_fn, item_count_offset_fn);
|
||||
|
||||
// Found a null. Keep searching for a matching item,
|
||||
// but remember that this is an empty (unused) slot.
|
||||
bind(found_null);
|
||||
}
|
||||
}
|
||||
|
||||
// In the fall-through case, we found no matching item, but we
|
||||
// observed the item[start_row] is null.
|
||||
|
||||
// Fill in the item field and increment the count.
|
||||
int item_offset = in_bytes(item_offset_fn(start_row));
|
||||
set_mdp_data_at(mdp, item_offset, item);
|
||||
int count_offset = in_bytes(item_count_offset_fn(start_row));
|
||||
mov(reg2, DataLayout::counter_increment);
|
||||
set_mdp_data_at(mdp, count_offset, reg2);
|
||||
if (start_row > 0) {
|
||||
b(done);
|
||||
}
|
||||
}
|
||||
|
||||
// Example state machine code for three profile rows:
|
||||
// // main copy of decision tree, rooted at row[1]
|
||||
// if (row[0].rec == rec) { row[0].incr(); goto done; }
|
||||
// if (row[0].rec != nullptr) {
|
||||
// // inner copy of decision tree, rooted at row[1]
|
||||
// if (row[1].rec == rec) { row[1].incr(); goto done; }
|
||||
// if (row[1].rec != nullptr) {
|
||||
// // degenerate decision tree, rooted at row[2]
|
||||
// if (row[2].rec == rec) { row[2].incr(); goto done; }
|
||||
// if (row[2].rec != nullptr) { count.incr(); goto done; } // overflow
|
||||
// row[2].init(rec); goto done;
|
||||
// } else {
|
||||
// // remember row[1] is empty
|
||||
// if (row[2].rec == rec) { row[2].incr(); goto done; }
|
||||
// row[1].init(rec); goto done;
|
||||
// }
|
||||
// } else {
|
||||
// // remember row[0] is empty
|
||||
// if (row[1].rec == rec) { row[1].incr(); goto done; }
|
||||
// if (row[2].rec == rec) { row[2].incr(); goto done; }
|
||||
// row[0].init(rec); goto done;
|
||||
// }
|
||||
// done:
|
||||
|
||||
void InterpreterMacroAssembler::record_klass_in_profile(Register receiver,
|
||||
Register mdp, Register reg2) {
|
||||
assert(ProfileInterpreter, "must be profiling");
|
||||
Label done;
|
||||
|
||||
record_klass_in_profile_helper(receiver, mdp, reg2, 0, done);
|
||||
|
||||
bind (done);
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::profile_ret(Register return_bci,
|
||||
Register mdp) {
|
||||
if (ProfileInterpreter) {
|
||||
@ -1200,7 +1073,7 @@ void InterpreterMacroAssembler::profile_null_seen(Register mdp) {
|
||||
}
|
||||
}
|
||||
|
||||
void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass, Register reg2) {
|
||||
void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass) {
|
||||
if (ProfileInterpreter) {
|
||||
Label profile_continue;
|
||||
|
||||
@ -1213,7 +1086,7 @@ void InterpreterMacroAssembler::profile_typecheck(Register mdp, Register klass,
|
||||
mdp_delta = in_bytes(VirtualCallData::virtual_call_data_size());
|
||||
|
||||
// Record the object type.
|
||||
record_klass_in_profile(klass, mdp, reg2);
|
||||
profile_receiver_type(klass, mdp, 0);
|
||||
}
|
||||
update_mdp_by_constant(mdp, mdp_delta);
|
||||
|
||||
|
||||
@ -273,15 +273,6 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
Register test_value_out,
|
||||
Label& not_equal_continue);
|
||||
|
||||
void record_klass_in_profile(Register receiver, Register mdp,
|
||||
Register reg2);
|
||||
void record_klass_in_profile_helper(Register receiver, Register mdp,
|
||||
Register reg2, int start_row,
|
||||
Label& done);
|
||||
void record_item_in_profile_helper(Register item, Register mdp,
|
||||
Register reg2, int start_row, Label& done, int total_rows,
|
||||
OffsetFunction item_offset_fn, OffsetFunction item_count_offset_fn);
|
||||
|
||||
void update_mdp_by_offset(Register mdp_in, int offset_of_offset);
|
||||
void update_mdp_by_offset(Register mdp_in, Register reg, int offset_of_disp);
|
||||
void update_mdp_by_constant(Register mdp_in, int constant);
|
||||
@ -295,11 +286,10 @@ class InterpreterMacroAssembler: public MacroAssembler {
|
||||
void profile_call(Register mdp);
|
||||
void profile_final_call(Register mdp);
|
||||
void profile_virtual_call(Register receiver, Register mdp,
|
||||
Register scratch2,
|
||||
bool receiver_can_be_null = false);
|
||||
void profile_ret(Register return_bci, Register mdp);
|
||||
void profile_null_seen(Register mdp);
|
||||
void profile_typecheck(Register mdp, Register klass, Register scratch);
|
||||
void profile_typecheck(Register mdp, Register klass);
|
||||
void profile_typecheck_failed(Register mdp);
|
||||
void profile_switch_default(Register mdp);
|
||||
void profile_switch_case(Register index_in_scratch, Register mdp,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2002, 2023, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2002, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1997, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2024, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
@ -473,6 +473,7 @@ address MacroAssembler::target_addr_for_insn(address insn_addr) {
|
||||
// Patch any kind of instruction; there may be several instructions.
|
||||
// Return the total length (in bytes) of the instructions.
|
||||
int MacroAssembler::pd_patch_instruction_size(address insn_addr, address target) {
|
||||
MACOS_AARCH64_ONLY(os::thread_wx_enable_write());
|
||||
return RelocActions<Patcher>::run(insn_addr, target);
|
||||
}
|
||||
|
||||
@ -481,6 +482,8 @@ int MacroAssembler::patch_oop(address insn_addr, address o) {
|
||||
unsigned insn = *(unsigned*)insn_addr;
|
||||
assert(nativeInstruction_at(insn_addr+4)->is_movk(), "wrong insns in patch");
|
||||
|
||||
MACOS_AARCH64_ONLY(os::thread_wx_enable_write());
|
||||
|
||||
// OOPs are either narrow (32 bits) or wide (48 bits). We encode
|
||||
// narrow OOPs by setting the upper 16 bits in the first
|
||||
// instruction.
|
||||
@ -510,6 +513,8 @@ int MacroAssembler::patch_narrow_klass(address insn_addr, narrowKlass n) {
|
||||
assert(Instruction_aarch64::extract(insn->encoding(), 31, 21) == 0b11010010101 &&
|
||||
nativeInstruction_at(insn_addr+4)->is_movk(), "wrong insns in patch");
|
||||
|
||||
MACOS_AARCH64_ONLY(os::thread_wx_enable_write());
|
||||
|
||||
Instruction_aarch64::patch(insn_addr, 20, 5, n >> 16);
|
||||
Instruction_aarch64::patch(insn_addr+4, 20, 5, n & 0xffff);
|
||||
return 2 * NativeInstruction::instruction_size;
|
||||
@ -2118,6 +2123,161 @@ Address MacroAssembler::argument_address(RegisterOrConstant arg_slot,
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the receiver type profile update given the "recv" klass.
|
||||
//
|
||||
// Normally updates the ReceiverData (RD) that starts at "mdp" + "mdp_offset".
|
||||
// If there are no matching or claimable receiver entries in RD, updates
|
||||
// the polymorphic counter.
|
||||
//
|
||||
// This code expected to run by either the interpreter or JIT-ed code, without
|
||||
// extra synchronization. For safety, receiver cells are claimed atomically, which
|
||||
// avoids grossly misrepresenting the profiles under concurrent updates. For speed,
|
||||
// counter updates are not atomic.
|
||||
//
|
||||
void MacroAssembler::profile_receiver_type(Register recv, Register mdp, int mdp_offset) {
|
||||
assert_different_registers(recv, mdp, rscratch1, rscratch2);
|
||||
|
||||
int base_receiver_offset = in_bytes(ReceiverTypeData::receiver_offset(0));
|
||||
int end_receiver_offset = in_bytes(ReceiverTypeData::receiver_offset(ReceiverTypeData::row_limit()));
|
||||
int poly_count_offset = in_bytes(CounterData::count_offset());
|
||||
int receiver_step = in_bytes(ReceiverTypeData::receiver_offset(1)) - base_receiver_offset;
|
||||
int receiver_to_count_step = in_bytes(ReceiverTypeData::receiver_count_offset(0)) - base_receiver_offset;
|
||||
|
||||
// Adjust for MDP offsets.
|
||||
base_receiver_offset += mdp_offset;
|
||||
end_receiver_offset += mdp_offset;
|
||||
poly_count_offset += mdp_offset;
|
||||
|
||||
#ifdef ASSERT
|
||||
// We are about to walk the MDO slots without asking for offsets.
|
||||
// Check that our math hits all the right spots.
|
||||
for (uint c = 0; c < ReceiverTypeData::row_limit(); c++) {
|
||||
int real_recv_offset = mdp_offset + in_bytes(ReceiverTypeData::receiver_offset(c));
|
||||
int real_count_offset = mdp_offset + in_bytes(ReceiverTypeData::receiver_count_offset(c));
|
||||
int offset = base_receiver_offset + receiver_step*c;
|
||||
int count_offset = offset + receiver_to_count_step;
|
||||
assert(offset == real_recv_offset, "receiver slot math");
|
||||
assert(count_offset == real_count_offset, "receiver count math");
|
||||
}
|
||||
int real_poly_count_offset = mdp_offset + in_bytes(CounterData::count_offset());
|
||||
assert(poly_count_offset == real_poly_count_offset, "poly counter math");
|
||||
#endif
|
||||
|
||||
// Corner case: no profile table. Increment poly counter and exit.
|
||||
if (ReceiverTypeData::row_limit() == 0) {
|
||||
increment(Address(mdp, poly_count_offset), DataLayout::counter_increment);
|
||||
return;
|
||||
}
|
||||
|
||||
Register offset = rscratch2;
|
||||
|
||||
Label L_loop_search_receiver, L_loop_search_empty;
|
||||
Label L_restart, L_found_recv, L_found_empty, L_polymorphic, L_count_update;
|
||||
|
||||
// The code here recognizes three major cases:
|
||||
// A. Fastest: receiver found in the table
|
||||
// B. Fast: no receiver in the table, and the table is full
|
||||
// C. Slow: no receiver in the table, free slots in the table
|
||||
//
|
||||
// The case A performance is most important, as perfectly-behaved code would end up
|
||||
// there, especially with larger TypeProfileWidth. The case B performance is
|
||||
// important as well, this is where bulk of code would land for normally megamorphic
|
||||
// cases. The case C performance is not essential, its job is to deal with installation
|
||||
// races, we optimize for code density instead. Case C needs to make sure that receiver
|
||||
// rows are only claimed once. This makes sure we never overwrite a row for another
|
||||
// receiver and never duplicate the receivers in the list, making profile type-accurate.
|
||||
//
|
||||
// It is very tempting to handle these cases in a single loop, and claim the first slot
|
||||
// without checking the rest of the table. But, profiling code should tolerate free slots
|
||||
// in the table, as class unloading can clear them. After such cleanup, the receiver
|
||||
// we need might be _after_ the free slot. Therefore, we need to let at least full scan
|
||||
// to complete, before trying to install new slots. Splitting the code in several tight
|
||||
// loops also helpfully optimizes for cases A and B.
|
||||
//
|
||||
// This code is effectively:
|
||||
//
|
||||
// restart:
|
||||
// // Fastest: receiver is already installed
|
||||
// for (i = 0; i < receiver_count(); i++) {
|
||||
// if (receiver(i) == recv) goto found_recv(i);
|
||||
// }
|
||||
//
|
||||
// // Fast: no receiver, but profile is full
|
||||
// for (i = 0; i < receiver_count(); i++) {
|
||||
// if (receiver(i) == null) goto found_null(i);
|
||||
// }
|
||||
// goto polymorphic
|
||||
//
|
||||
// // Slow: try to install receiver
|
||||
// found_null(i):
|
||||
// CAS(&receiver(i), null, recv);
|
||||
// goto restart
|
||||
//
|
||||
// polymorphic:
|
||||
// count++;
|
||||
// return
|
||||
//
|
||||
// found_recv(i):
|
||||
// *receiver_count(i)++
|
||||
//
|
||||
|
||||
bind(L_restart);
|
||||
|
||||
// Fastest: receiver is already installed
|
||||
mov(offset, base_receiver_offset);
|
||||
bind(L_loop_search_receiver);
|
||||
ldr(rscratch1, Address(mdp, offset));
|
||||
cmp(rscratch1, recv);
|
||||
br(Assembler::EQ, L_found_recv);
|
||||
add(offset, offset, receiver_step);
|
||||
sub(rscratch1, offset, end_receiver_offset);
|
||||
cbnz(rscratch1, L_loop_search_receiver);
|
||||
|
||||
// Fast: no receiver, but profile is full
|
||||
mov(offset, base_receiver_offset);
|
||||
bind(L_loop_search_empty);
|
||||
ldr(rscratch1, Address(mdp, offset));
|
||||
cbz(rscratch1, L_found_empty);
|
||||
add(offset, offset, receiver_step);
|
||||
sub(rscratch1, offset, end_receiver_offset);
|
||||
cbnz(rscratch1, L_loop_search_empty);
|
||||
b(L_polymorphic);
|
||||
|
||||
// Slow: try to install receiver
|
||||
bind(L_found_empty);
|
||||
|
||||
// Atomically swing receiver slot: null -> recv.
|
||||
//
|
||||
// The update uses CAS, which clobbers rscratch1. Therefore, rscratch2
|
||||
// is used to hold the destination address. This is safe because the
|
||||
// offset is no longer needed after the address is computed.
|
||||
|
||||
lea(rscratch2, Address(mdp, offset));
|
||||
cmpxchg(/*addr*/ rscratch2, /*expected*/ zr, /*new*/ recv, Assembler::xword,
|
||||
/*acquire*/ false, /*release*/ false, /*weak*/ true, noreg);
|
||||
|
||||
// CAS success means the slot now has the receiver we want. CAS failure means
|
||||
// something had claimed the slot concurrently: it can be the same receiver we want,
|
||||
// or something else. Since this is a slow path, we can optimize for code density,
|
||||
// and just restart the search from the beginning.
|
||||
b(L_restart);
|
||||
|
||||
// Counter updates:
|
||||
|
||||
// Increment polymorphic counter instead of receiver slot.
|
||||
bind(L_polymorphic);
|
||||
mov(offset, poly_count_offset);
|
||||
b(L_count_update);
|
||||
|
||||
// Found a receiver, convert its slot offset to corresponding count offset.
|
||||
bind(L_found_recv);
|
||||
add(offset, offset, receiver_to_count_step);
|
||||
|
||||
bind(L_count_update);
|
||||
increment(Address(mdp, offset), DataLayout::counter_increment);
|
||||
}
|
||||
|
||||
|
||||
void MacroAssembler::call_VM_leaf_base(address entry_point,
|
||||
int number_of_arguments,
|
||||
Label *retaddr) {
|
||||
@ -5606,12 +5766,11 @@ void MacroAssembler::adrp(Register reg1, const Address &dest, uint64_t &byte_off
|
||||
}
|
||||
|
||||
void MacroAssembler::load_byte_map_base(Register reg) {
|
||||
CardTable::CardValue* byte_map_base =
|
||||
((CardTableBarrierSet*)(BarrierSet::barrier_set()))->card_table()->byte_map_base();
|
||||
CardTableBarrierSet* ctbs = CardTableBarrierSet::barrier_set();
|
||||
|
||||
// Strictly speaking the byte_map_base isn't an address at all, and it might
|
||||
// Strictly speaking the card table base isn't an address at all, and it might
|
||||
// even be negative. It is thus materialised as a constant.
|
||||
mov(reg, (uint64_t)byte_map_base);
|
||||
mov(reg, (uint64_t)ctbs->card_table_base_const());
|
||||
}
|
||||
|
||||
void MacroAssembler::build_frame(int framesize) {
|
||||
@ -5782,6 +5941,9 @@ address MacroAssembler::arrays_equals(Register a1, Register a2, Register tmp3,
|
||||
// return false;
|
||||
bind(A_IS_NOT_NULL);
|
||||
ldrw(cnt1, Address(a1, length_offset));
|
||||
ldrw(tmp5, Address(a2, length_offset));
|
||||
cmp(cnt1, tmp5);
|
||||
br(NE, DONE); // If lengths differ, return false
|
||||
// Increase loop counter by diff between base- and actual start-offset.
|
||||
addw(cnt1, cnt1, extra_length);
|
||||
lea(a1, Address(a1, start_offset));
|
||||
@ -5848,6 +6010,9 @@ address MacroAssembler::arrays_equals(Register a1, Register a2, Register tmp3,
|
||||
cbz(a1, DONE);
|
||||
ldrw(cnt1, Address(a1, length_offset));
|
||||
cbz(a2, DONE);
|
||||
ldrw(tmp5, Address(a2, length_offset));
|
||||
cmp(cnt1, tmp5);
|
||||
br(NE, DONE); // If lengths differ, return false
|
||||
// Increase loop counter by diff between base- and actual start-offset.
|
||||
addw(cnt1, cnt1, extra_length);
|
||||
|
||||
|
||||
@ -1122,6 +1122,8 @@ public:
|
||||
|
||||
Address argument_address(RegisterOrConstant arg_slot, int extra_slot_offset = 0);
|
||||
|
||||
void profile_receiver_type(Register recv, Register mdp, int mdp_offset);
|
||||
|
||||
void verify_sve_vector_length(Register tmp = rscratch1);
|
||||
void reinitialize_ptrue() {
|
||||
if (UseSVE > 0) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2010, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
|
||||
@ -133,7 +133,6 @@ void NativeMovConstReg::verify() {
|
||||
|
||||
|
||||
intptr_t NativeMovConstReg::data() const {
|
||||
// das(uint64_t(instruction_address()),2);
|
||||
address addr = MacroAssembler::target_addr_for_insn(instruction_address());
|
||||
if (maybe_cpool_ref(instruction_address())) {
|
||||
return *(intptr_t*)addr;
|
||||
@ -144,6 +143,7 @@ intptr_t NativeMovConstReg::data() const {
|
||||
|
||||
void NativeMovConstReg::set_data(intptr_t x) {
|
||||
if (maybe_cpool_ref(instruction_address())) {
|
||||
MACOS_AARCH64_ONLY(os::thread_wx_enable_write());
|
||||
address addr = MacroAssembler::target_addr_for_insn(instruction_address());
|
||||
*(intptr_t*)addr = x;
|
||||
} else {
|
||||
@ -350,8 +350,6 @@ bool NativeInstruction::is_stop() {
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
void NativeGeneralJump::verify() { }
|
||||
|
||||
// MT-safe patching of a long jump instruction.
|
||||
void NativeGeneralJump::replace_mt_safe(address instr_addr, address code_buffer) {
|
||||
ShouldNotCallThis();
|
||||
|
||||
@ -90,16 +90,18 @@ protected:
|
||||
|
||||
s_char sbyte_at(int offset) const { return *(s_char*)addr_at(offset); }
|
||||
u_char ubyte_at(int offset) const { return *(u_char*)addr_at(offset); }
|
||||
jint int_at(int offset) const { return *(jint*)addr_at(offset); }
|
||||
juint uint_at(int offset) const { return *(juint*)addr_at(offset); }
|
||||
address ptr_at(int offset) const { return *(address*)addr_at(offset); }
|
||||
oop oop_at(int offset) const { return *(oop*)addr_at(offset); }
|
||||
jint int_at(int offset) const { return *(jint*)addr_at(offset); }
|
||||
juint uint_at(int offset) const { return *(juint*)addr_at(offset); }
|
||||
address ptr_at(int offset) const { return *(address*)addr_at(offset); }
|
||||
oop oop_at(int offset) const { return *(oop*)addr_at(offset); }
|
||||
|
||||
void set_char_at(int offset, char c) { *addr_at(offset) = (u_char)c; }
|
||||
void set_int_at(int offset, jint i) { *(jint*)addr_at(offset) = i; }
|
||||
void set_uint_at(int offset, jint i) { *(juint*)addr_at(offset) = i; }
|
||||
void set_ptr_at(int offset, address ptr) { *(address*)addr_at(offset) = ptr; }
|
||||
void set_oop_at(int offset, oop o) { *(oop*)addr_at(offset) = o; }
|
||||
#define MACOS_WX_WRITE MACOS_AARCH64_ONLY(os::thread_wx_enable_write())
|
||||
void set_char_at(int offset, char c) { MACOS_WX_WRITE; *addr_at(offset) = (u_char)c; }
|
||||
void set_int_at(int offset, jint i) { MACOS_WX_WRITE; *(jint*)addr_at(offset) = i; }
|
||||
void set_uint_at(int offset, jint i) { MACOS_WX_WRITE; *(juint*)addr_at(offset) = i; }
|
||||
void set_ptr_at(int offset, address ptr) { MACOS_WX_WRITE; *(address*)addr_at(offset) = ptr; }
|
||||
void set_oop_at(int offset, oop o) { MACOS_WX_WRITE; *(oop*)addr_at(offset) = o; }
|
||||
#undef MACOS_WX_WRITE
|
||||
|
||||
void wrote(int offset);
|
||||
|
||||
@ -380,7 +382,6 @@ public:
|
||||
void set_jump_destination(address dest);
|
||||
|
||||
static void replace_mt_safe(address instr_addr, address code_buffer);
|
||||
static void verify();
|
||||
};
|
||||
|
||||
inline NativeGeneralJump* nativeGeneralJump_at(address address) {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2003, 2026, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2014, 2021, Red Hat Inc. All rights reserved.
|
||||
* Copyright (c) 2021, Azul Systems, Inc. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -722,22 +722,20 @@ void SharedRuntime::generate_i2c2i_adapters(MacroAssembler *masm,
|
||||
|
||||
// Class initialization barrier for static methods
|
||||
entry_address[AdapterBlob::C2I_No_Clinit_Check] = nullptr;
|
||||
if (VM_Version::supports_fast_class_init_checks()) {
|
||||
Label L_skip_barrier;
|
||||
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
|
||||
Label L_skip_barrier;
|
||||
|
||||
{ // Bypass the barrier for non-static methods
|
||||
__ ldrh(rscratch1, Address(rmethod, Method::access_flags_offset()));
|
||||
__ andsw(zr, rscratch1, JVM_ACC_STATIC);
|
||||
__ br(Assembler::EQ, L_skip_barrier); // non-static
|
||||
}
|
||||
// Bypass the barrier for non-static methods
|
||||
__ ldrh(rscratch1, Address(rmethod, Method::access_flags_offset()));
|
||||
__ andsw(zr, rscratch1, JVM_ACC_STATIC);
|
||||
__ br(Assembler::EQ, L_skip_barrier); // non-static
|
||||
|
||||
__ load_method_holder(rscratch2, rmethod);
|
||||
__ clinit_barrier(rscratch2, rscratch1, &L_skip_barrier);
|
||||
__ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub()));
|
||||
__ load_method_holder(rscratch2, rmethod);
|
||||
__ clinit_barrier(rscratch2, rscratch1, &L_skip_barrier);
|
||||
__ far_jump(RuntimeAddress(SharedRuntime::get_handle_wrong_method_stub()));
|
||||
|
||||
__ bind(L_skip_barrier);
|
||||
entry_address[AdapterBlob::C2I_No_Clinit_Check] = __ pc();
|
||||
}
|
||||
__ bind(L_skip_barrier);
|
||||
entry_address[AdapterBlob::C2I_No_Clinit_Check] = __ pc();
|
||||
|
||||
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
|
||||
bs->c2i_entry_barrier(masm);
|
||||
@ -1508,7 +1506,8 @@ nmethod* SharedRuntime::generate_native_wrapper(MacroAssembler* masm,
|
||||
// SVC, HVC, or SMC. Make it a NOP.
|
||||
__ nop();
|
||||
|
||||
if (VM_Version::supports_fast_class_init_checks() && method->needs_clinit_barrier()) {
|
||||
if (method->needs_clinit_barrier()) {
|
||||
assert(VM_Version::supports_fast_class_init_checks(), "sanity");
|
||||
Label L_skip_barrier;
|
||||
__ mov_metadata(rscratch2, method->method_holder()); // InstanceKlass*
|
||||
__ clinit_barrier(rscratch2, rscratch1, &L_skip_barrier);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2025, 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
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 2024, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2019, 2025, 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
|
||||
|
||||
@ -6081,14 +6081,18 @@ class StubGenerator: public StubCodeGenerator {
|
||||
// static int implKyber12To16(
|
||||
// byte[] condensed, int index, short[] parsed, int parsedLength) {}
|
||||
//
|
||||
// (parsedLength or (parsedLength - 48) must be divisible by 64.)
|
||||
// we assume that parsed and condensed are allocated such that for
|
||||
// n = (parsedLength + 63) / 64
|
||||
// n blocks of 96 bytes of input can be processed, i.e.
|
||||
// index + n * 96 <= condensed.length and
|
||||
// n * 64 <= parsed.length
|
||||
//
|
||||
// condensed (byte[]) = c_rarg0
|
||||
// condensedIndex = c_rarg1
|
||||
// parsed (short[112 or 256]) = c_rarg2
|
||||
// parsedLength (112 or 256) = c_rarg3
|
||||
// parsed (short[]) = c_rarg2
|
||||
// parsedLength = c_rarg3
|
||||
address generate_kyber12To16() {
|
||||
Label L_F00, L_loop, L_end;
|
||||
Label L_F00, L_loop;
|
||||
|
||||
__ align(CodeEntryAlignment);
|
||||
StubId stub_id = StubId::stubgen_kyber12To16_id;
|
||||
@ -6209,75 +6213,8 @@ class StubGenerator: public StubCodeGenerator {
|
||||
vs_st2_post(vs_front(vb), __ T8H, parsed);
|
||||
|
||||
__ sub(parsedLength, parsedLength, 64);
|
||||
__ cmp(parsedLength, (u1)64);
|
||||
__ br(Assembler::GE, L_loop);
|
||||
__ cbz(parsedLength, L_end);
|
||||
|
||||
// if anything is left it should be a final 72 bytes of input
|
||||
// i.e. a final 48 12-bit values. so we handle this by loading
|
||||
// 48 bytes into all 16B lanes of front(vin) and only 24
|
||||
// bytes into the lower 8B lane of back(vin)
|
||||
vs_ld3_post(vs_front(vin), __ T16B, condensed);
|
||||
vs_ld3(vs_back(vin), __ T8B, condensed);
|
||||
|
||||
// Expand vin[0] into va[0:1], and vin[1] into va[2:3] and va[4:5]
|
||||
// n.b. target elements 2 and 3 of va duplicate elements 4 and
|
||||
// 5 and target element 2 of vb duplicates element 4.
|
||||
__ ushll(va[0], __ T8H, vin[0], __ T8B, 0);
|
||||
__ ushll2(va[1], __ T8H, vin[0], __ T16B, 0);
|
||||
__ ushll(va[2], __ T8H, vin[1], __ T8B, 0);
|
||||
__ ushll2(va[3], __ T8H, vin[1], __ T16B, 0);
|
||||
__ ushll(va[4], __ T8H, vin[1], __ T8B, 0);
|
||||
__ ushll2(va[5], __ T8H, vin[1], __ T16B, 0);
|
||||
|
||||
// This time expand just the lower 8 lanes
|
||||
__ ushll(vb[0], __ T8H, vin[3], __ T8B, 0);
|
||||
__ ushll(vb[2], __ T8H, vin[4], __ T8B, 0);
|
||||
__ ushll(vb[4], __ T8H, vin[4], __ T8B, 0);
|
||||
|
||||
// shift lo byte of copy 1 of the middle stripe into the high byte
|
||||
__ shl(va[2], __ T8H, va[2], 8);
|
||||
__ shl(va[3], __ T8H, va[3], 8);
|
||||
__ shl(vb[2], __ T8H, vb[2], 8);
|
||||
|
||||
// expand vin[2] into va[6:7] and lower 8 lanes of vin[5] into
|
||||
// vb[6] pre-shifted by 4 to ensure top bits of the input 12-bit
|
||||
// int are in bit positions [4..11].
|
||||
__ ushll(va[6], __ T8H, vin[2], __ T8B, 4);
|
||||
__ ushll2(va[7], __ T8H, vin[2], __ T16B, 4);
|
||||
__ ushll(vb[6], __ T8H, vin[5], __ T8B, 4);
|
||||
|
||||
// mask hi 4 bits of each 1st 12-bit int in pair from copy1 and
|
||||
// shift lo 4 bits of each 2nd 12-bit int in pair to bottom of
|
||||
// copy2
|
||||
__ andr(va[2], __ T16B, va[2], v31);
|
||||
__ andr(va[3], __ T16B, va[3], v31);
|
||||
__ ushr(va[4], __ T8H, va[4], 4);
|
||||
__ ushr(va[5], __ T8H, va[5], 4);
|
||||
__ andr(vb[2], __ T16B, vb[2], v31);
|
||||
__ ushr(vb[4], __ T8H, vb[4], 4);
|
||||
|
||||
|
||||
|
||||
// sum hi 4 bits and lo 8 bits of each 1st 12-bit int in pair and
|
||||
// hi 8 bits plus lo 4 bits of each 2nd 12-bit int in pair
|
||||
|
||||
// n.b. ordering ensures: i) inputs are consumed before they are
|
||||
// overwritten ii) order of 16-bit results across succsessive
|
||||
// pairs of vectors in va and then lower half of vb reflects order
|
||||
// of corresponding 12-bit inputs
|
||||
__ addv(va[0], __ T8H, va[0], va[2]);
|
||||
__ addv(va[2], __ T8H, va[1], va[3]);
|
||||
__ addv(va[1], __ T8H, va[4], va[6]);
|
||||
__ addv(va[3], __ T8H, va[5], va[7]);
|
||||
__ addv(vb[0], __ T8H, vb[0], vb[2]);
|
||||
__ addv(vb[1], __ T8H, vb[4], vb[6]);
|
||||
|
||||
// store 48 results interleaved as shorts
|
||||
vs_st2_post(vs_front(va), __ T8H, parsed);
|
||||
vs_st2_post(vs_front(vs_front(vb)), __ T8H, parsed);
|
||||
|
||||
__ BIND(L_end);
|
||||
__ cmp(parsedLength, (u1)0);
|
||||
__ br(Assembler::GT, L_loop);
|
||||
|
||||
__ leave(); // required for proper stackwalking of RuntimeStub frame
|
||||
__ mov(r0, zr); // return 0
|
||||
@ -11805,7 +11742,9 @@ class StubGenerator: public StubCodeGenerator {
|
||||
}
|
||||
#endif
|
||||
|
||||
StubRoutines::_unsafe_setmemory = generate_unsafe_setmemory();
|
||||
if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_setMemory)) {
|
||||
StubRoutines::_unsafe_setmemory = generate_unsafe_setmemory();
|
||||
}
|
||||
|
||||
StubRoutines::aarch64::set_completed(); // Inidicate that arraycopy and zero_blocks stubs are generated
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user