Merge "Optimize java JVM with PGO instrumentation" into main
diff --git a/build-openjdk17-linux.sh b/build-openjdk17-linux.sh
index 676c376..789fb36 100755
--- a/build-openjdk17-linux.sh
+++ b/build-openjdk17-linux.sh
@@ -45,6 +45,7 @@
 declare -r build_dir="$out_path/build"
 declare -r top=$(realpath "$(dirname "$0")/../../..")
 declare -r clang_bin="$top/prebuilts/clang/host/linux-x86/clang-r475365b/bin"
+declare -r profdata="$top/toolchain/jdk/build//openjdk17.profdata"
 
 # "Installs" given Debian packages into specified directory.
 function unpack_dependencies() {
@@ -117,9 +118,9 @@
      --with-zlib=bundled \
      --x-libraries="$sysroot/usr/lib/x86_64-linux-gnu" \
      --x-includes="$sysroot/usr/include" \
-     --with-extra-cflags="--sysroot=$sysroot -fno-delete-null-pointer-checks -flto=full" \
-     --with-extra-cxxflags="--sysroot=$sysroot -fno-delete-null-pointer-checks -flto=full" \
-     --with-extra-ldflags="--sysroot=$sysroot -fuse-ld=lld -flto=full" \
+     --with-extra-cflags="--sysroot=$sysroot -fno-delete-null-pointer-checks -flto=full -fprofile-instr-use=$profdata" \
+     --with-extra-cxxflags="--sysroot=$sysroot -fno-delete-null-pointer-checks -flto=full -fprofile-instr-use=$profdata" \
+     --with-extra-ldflags="--sysroot=$sysroot -fuse-ld=lld -flto=full -fprofile-instr-use=$profdata" \
      AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip
 )
 
diff --git a/openjdk17.profdata b/openjdk17.profdata
new file mode 100644
index 0000000..799e6ca
--- /dev/null
+++ b/openjdk17.profdata
Binary files differ