diff a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,37 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+Thank you for taking the time to help improve OpenJDK and Corretto.
+
+If your request concerns a security vulnerability then please report it by email to aws-security@amazon.com instead of here. (You can find more information regarding security issues at https://aws.amazon.com/security/vulnerability-reporting/.)
+
+Otherwise, if your issue concerns OpenJDK and is not specific to Corretto we ask that you raise it to the OpenJDK community. Depending on your contributor status for OpenJDK, please use the [JDK bug system](https://bugs.openjdk.java.net/) or the appropriate [mailing list](http://mail.openjdk.java.net/mailman/listinfo) for the given problem area or [update project](http://mail.openjdk.java.net/mailman/listinfo/jdk-updates-dev).
+
+If your issue is specific to Corretto, then you are in the right place. Please proceed with the following.
+
+### Describe the bug
+A clear and concise description of what the bug is.
+
+### To Reproduce
+Steps and (source) code to reproduce the behavior.
+
+### Expected behavior
+A clear and concise description of what you expected to happen.
+
+### Screenshots
+If applicable, add screenshots to help explain your problem.
+
+### Platform information
+    OS: [e.g. Amazon Linux 2]
+    Version [e.g. "Corretto-15.0.1.9.1" (output from "java -version")]
+
+### Additional context
+Add any other context about the problem here.
+
+For VM crashes, please attach the error report file. By default the file name is `hs_err_pidpid.log`, where pid is the process ID of the process.
diff a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,38 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+Thank you for taking the time to help improve OpenJDK and Corretto.
+
+If your request concerns a security vulnerability then please report it by email to aws-security@amazon.com instead of here.
+(You can find more information regarding security issues at https://aws.amazon.com/security/vulnerability-reporting/.)
+
+Otherwise, if your idea concerns OpenJDK
+and is not specific to Corretto
+we ask that you propose it to the OpenJDK community.
+Depending on your contributor status for OpenJDK,
+please use the [JDK bug system](https://bugs.openjdk.java.net/) or
+the appropriate [mailing list](http://mail.openjdk.java.net/mailman/listinfo)
+for the given problem area or [update project](http://mail.openjdk.java.net/mailman/listinfo/jdk-updates-dev)).
+
+If your proposal is specific to Corretto,
+then you are in the right place.
+Please proceed with the following.
+
+### Is your feature request related to a problem?
+Please provide a clear and concise description of what the problem is.
+
+### Describe a solution you would like
+Please provide a clear and concise description of what you want to happen.
+
+### Describe alternatives you have considered
+Please provide a clear and concise description
+of any alternative solutions or features you have considered.
+
+### Additional context
+Add any other context or screenshots about the feature request here.
diff a/.github/pull_request_template.md b/.github/pull_request_template.md
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,33 @@
+Thank you for taking the time to help improve OpenJDK and Corretto.
+
+If your pull request concerns a security vulnerability then please do not file it here.
+Instead, report the problem by email to aws-security@amazon.com.
+(You can find more information regarding security issues at https://aws.amazon.com/security/vulnerability-reporting/.)
+
+Otherwise, if your pull request concerns OpenJDK
+and is not specific to Corretto,
+then we ask you to redirect your contribution to the OpenJDK project.
+See http://openjdk.java.net/contribute/ for details on how to do that.
+
+If your issue is specific to Corretto,
+then you are in the right place.
+Please fill in the following information about your pull request.
+
+### Description
+
+
+### Related issues
+
+
+### Motivation and context
+
+
+### How has this been tested?
+
+
+### Platform information
+    Works on OS: [e.g. Amazon Linux 2 only]
+    Applies to version [e.g. "11.0.1+13-1" (see output from "java -version")]
+
+
+### Additional context
diff a/.github/scripts/update-version.sh b/.github/scripts/update-version.sh
--- /dev/null
+++ b/.github/scripts/update-version.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+set -x
+
+UPSTREAM_REMOTE=$1
+
+# Load the current OpenJDK version
+source make/conf/version-numbers.conf
+
+BUILD_NUMBER=$(git ls-remote --tags ${UPSTREAM_REMOTE} |grep jdk-${DEFAULT_VERSION_FEATURE}+ | grep -vE "(-ga|{})$" | cut -d+ -f 2 |sort -n |tail -1)
+
+# Load the current Corretto version
+CURRENT_VERSION=$(cat version.txt)
+
+if [[ ${CURRENT_VERSION} == ${DEFAULT_VERSION_FEATURE}.${DEFAULT_VERSION_INTERIM}.${DEFAULT_VERSION_UPDATE}.${BUILD_NUMBER:=0}.* ]]; then
+    echo "Corretto version is current."
+else
+    echo "Updating Corretto version"
+    NEW_VERSION="${DEFAULT_VERSION_FEATURE}.${DEFAULT_VERSION_INTERIM}.${DEFAULT_VERSION_UPDATE}.${BUILD_NUMBER}.1"
+    echo  "${NEW_VERSION}" > version.txt
+    git commit -m "Update Corretto version to match upstream: ${NEW_VERSION}" version.txt
+fi
diff a/.github/workflows/main.yml b/.github/workflows/main.yml
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -25,14 +25,15 @@
 
 name: 'OpenJDK GHA Sanity Checks'
 
 on:
   push:
-    branches-ignore:
-      - master
-      - pr/*
-      - jdk*
+    branches:
+      - develop
+  pull_request:
+    branches:
+      - develop
   workflow_dispatch:
     inputs:
       platforms:
         description: 'Platform(s) to execute on (comma separated, e.g. "linux-x64, macos, aarch64")'
         required: true
diff a/.github/workflows/refresh-jdk.yml b/.github/workflows/refresh-jdk.yml
--- /dev/null
+++ b/.github/workflows/refresh-jdk.yml
@@ -0,0 +1,37 @@
+name: "Refresh jdk25 from Upstream"
+on:
+  schedule:
+    - cron: '0 8 * * *'
+  workflow_dispatch:
+env:
+  UPSTREAM_REMOTE: https://github.com/openjdk/jdk.git
+  LOCAL_BRANCH: develop
+  
+jobs:
+    refresh-jdk:
+        runs-on: ubuntu-latest
+        name: "Update Corretto-25"
+        if: github.repository_owner == 'corretto'
+        steps:
+            - name: "Checkout code"
+              uses: actions/checkout@v2
+              with:
+                fetch-depth: 0
+                ref: ${{ env.LOCAL_BRANCH }}
+                
+            - name: "Configure the user"
+              run: |
+                git config user.email "no-reply@amazon.com"
+                git config user.name "corretto-github-robot"
+                
+            - name: "Merge openjdk/jdk:jdk25 to the corretto-25:develop"
+              run: |
+                git fetch $UPSTREAM_REMOTE jdk25 || exit 1
+                git merge -m "Merge upstream-jdk" FETCH_HEAD
+                
+            - name: "Update Corretto version"
+              shell: bash
+              run: bash ./.github/scripts/update-version.sh $UPSTREAM_REMOTE
+
+            - name: "Push to the corretto-25"
+              run: git push origin $LOCAL_BRANCH
diff a/.gitignore b/.gitignore
--- a/.gitignore
+++ b/.gitignore
@@ -1,10 +1,9 @@
 /build/
 /dist/
 /.idea/
 /.vscode/
-/nbproject/
 nbproject/private/
 /webrev
 /.src-rev
 /.jib/
 .DS_Store
@@ -13,13 +12,17 @@
 test/nashorn/script/external
 test/nashorn/lib
 NashornProfile.txt
 **/JTreport/**
 **/JTwork/**
+/.gradle/
+.gradletasknamecache
+/pre-build/
 /src/utils/LogCompilation/target/
 /.project/
 /.settings/
+commitId.txt
 /compile_commands.json
 /.cache
 /.gdbinit
 /.lldbinit
 **/core.[0-9]*
diff a/CHANGELOG.md b/CHANGELOG.md
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,89 @@
+# Change Log for Amazon Corretto 25
+
+The following sections describe the changes for each release of Amazon Corretto 25.
+## Corretto version: 25.0.0.36.2
+Release Date: September 16, 2025
+ 
+**Target Platforms <sup>1</sup>**
+ 
++ RPM-based Linux using glibc 2.17 or later, x86_64
++ Debian-based Linux using glibc 2.17 or later, x86_64
++ RPM-based Linux using glibc 2.17 or later, aarch64
++ Debian-based Linux using glibc 2.17 or later, aarch64
++ Alpine-based Linux, x86_64
++ Alpine-based Linux, aarch64
++ Windows 10 or later, x86_64
++ macos 13.0 and later, x86_64
++ macos 13.0 and later, aarch64
+ 
+ 
+**1.** This is the platform targeted by the build. See [Using Amazon Corretto](https://aws.amazon.com/corretto/faqs/#Using_Amazon_Corretto)
+in the Amazon Corretto FAQ for supported platforms
+ 
+The following issues are addressed in 25.0.0.36.2:
+ 
+| Issue Name       | Platform | Description                                | Link                                                               |
+|------------------|----------|--------------------------------------------|--------------------------------------------------------------------|
+| JDK-8364159 | All | Shenandoah assertions after JDK-8361712 | [JDK-8364159](https://bugs.openjdk.org/browse/JDK-8364159) |
+| JDK-8365571 | All | GenShen: PLAB promotions may remain disabled for evacuation threads | [JDK-8365571](https://bugs.openjdk.org/browse/JDK-8365571) |
+| JDK-8364183 | All | Shenandoah: Improve commit/uncommit handling | [JDK-8364183](https://bugs.openjdk.org/browse/JDK-8364183) |
+| JDK-8361712 | All | Improve ShenandoahAsserts printing | [JDK-8361712](https://bugs.openjdk.org/browse/JDK-8361712) |
+| JDK-8357818 | All | Shenandoah doesn't use shared API for printing heap before/after GC | [JDK-8357818](https://bugs.openjdk.org/browse/JDK-8357818) |
+| JDK-8361948 | All | Shenandoah: region free capacity unit mismatch | [JDK-8361948](https://bugs.openjdk.org/browse/JDK-8361948) |
+| JDK-8361342 | All | Shenandoah: Evacuation may assert on invalid mirror object after JDK-8340297 | [JDK-8361342](https://bugs.openjdk.org/browse/JDK-8361342) |
+| JDK-8361363 | All | ShenandoahAsserts::print_obj() does not work for forwarded objects and UseCompactObjectHeaders | [JDK-8361363](https://bugs.openjdk.org/browse/JDK-8361363) |
+| JDK-8359868 | All | Shenandoah: Free threshold heuristic does not use SoftMaxHeapSize | [JDK-8359868](https://bugs.openjdk.org/browse/JDK-8359868) |
+| JDK-8358529 | All | GenShen: Heuristics do not respond to changes in SoftMaxHeapSize | [JDK-8358529](https://bugs.openjdk.org/browse/JDK-8358529) |
+
+## Corretto version: 25.0.0.36.1
+Release Date: August 21, 2025
+ 
+**Target Platforms <sup>1</sup>**
+ 
++ RPM-based Linux using glibc 2.17 or later, x86_64
++ Debian-based Linux using glibc 2.17 or later, x86_64
++ RPM-based Linux using glibc 2.17 or later, aarch64
++ Debian-based Linux using glibc 2.17 or later, aarch64
++ Alpine-based Linux, x86_64
++ Alpine-based Linux, aarch64
++ Windows 10 or later, x86_64
++ macos 13.0 and later, x86_64
++ macos 13.0 and later, aarch64
+ 
+ 
+**1.** This is the platform targeted by the build. See [Using Amazon Corretto](https://aws.amazon.com/corretto/faqs/#Using_Amazon_Corretto)
+in the Amazon Corretto FAQ for supported platforms
+ 
+The following issues are addressed in 25.0.0.36.1:
+ 
+| Issue Name       | Platform | Description                                | Link                                                               |
+|------------------|----------|--------------------------------------------|--------------------------------------------------------------------|
+| Import jdk-25+36 | All      | Updates Corretto baseline to OpenJDK 25+36 | [jdk-25+36](https://github.com/openjdk/jdk/releases/tag/jdk-25+36) |
+| Turn off interface/abstract class optimization | All | Turn off interface/abstract class optimization for non-class metaspace allocation | [PR-5](https://github.com/corretto/corretto-25/pull/5) |
+| JDK-8343218 | All | Add option to disable allocating interface and abstract classes in non-class metaspace | [PR-3](https://github.com/corretto/corretto-25/pull/3) |
+| Backport: Upgrade to Gradle 8.14.3 | All | Upgrade to Gradle 8.14.3 | [PR-6](https://github.com/corretto/corretto-25/pull/6) |
+
+## Corretto version: 25.0.0.34.1
+Release Date: August 7, 2025
+ 
+**Target Platforms <sup>1</sup>**
+ 
++ RPM-based Linux using glibc 2.17 or later, x86_64
++ Debian-based Linux using glibc 2.17 or later, x86_64
++ RPM-based Linux using glibc 2.17 or later, aarch64
++ Debian-based Linux using glibc 2.17 or later, aarch64
++ Alpine-based Linux, x86_64
++ Alpine-based Linux, aarch64
++ Windows 10 or later, x86_64
++ macos 13.0 and later, x86_64
++ macos 13.0 and later, aarch64
+ 
+ 
+**1.** This is the platform targeted by the build. See [Using Amazon Corretto](https://aws.amazon.com/corretto/faqs/#Using_Amazon_Corretto)
+in the Amazon Corretto FAQ for supported platforms
+ 
+The following issues are addressed in 25.0.0.34.1:
+ 
+| Issue Name       | Platform | Description                                | Link                                                               |
+|------------------|----------|--------------------------------------------|--------------------------------------------------------------------|
+| Import jdk-25+34 | All      | Updates Corretto baseline to OpenJDK 25+34 | [jdk-25+34](https://github.com/openjdk/jdk/releases/tag/jdk-25+34) |
diff a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,4 @@
+## Code of Conduct
+This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
+For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
+opensource-codeofconduct@amazon.com with any additional questions or comments.
diff a/CONTRIBUTING.md b/CONTRIBUTING.md
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,3 +1,61 @@
-# Contributing to the JDK
+# Contributing Guidelines
 
-Please see the [OpenJDK Developers' Guide](https://openjdk.org/guide/).
+Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
+documentation, we greatly value feedback and contributions from our community.
+
+Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
+information to effectively respond to your bug report or contribution.
+
+
+## Reporting Bugs/Feature Requests
+
+We welcome you to use the GitHub issue tracker to report bugs or suggest features.
+
+When filing an issue, please check [existing open](https://github.com/corretto/corretto-25/issues), or [recently closed](https://github.com/corretto/corretto-25/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
+reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
+
+* A reproducible test case or series of steps
+* The version of our code being used
+* Any modifications you've made relevant to the bug
+* Anything unusual about your environment or deployment
+
+
+## Contributing via Pull Requests
+Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
+
+1. You are working against the latest source on the *develop* branch.
+2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
+3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
+
+To send us a pull request, please:
+
+1. Fork the repository.
+2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
+3. Ensure local tests pass.
+4. Commit to your fork using clear commit messages.
+5. Send us a pull request, answering any default questions in the pull request interface.
+6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
+
+GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
+[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
+
+
+## Finding contributions to work on
+Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/corretto/corretto-25/labels/help%20wanted) issues is a great place to start.
+
+
+## Code of Conduct
+This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
+For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
+opensource-codeofconduct@amazon.com with any additional questions or comments.
+
+
+## Security issue notifications
+If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
+
+
+## Licensing
+
+See the [LICENSE](https://github.com/corretto/corretto-25/blob/develop/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
+
+We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
diff a/README.JAVASE b/README.JAVASE
--- /dev/null
+++ b/README.JAVASE
@@ -0,0 +1,4 @@
+This is an intermediate build made available for testing purposes only.
+The code is untested and presumed incompatible with the Java SE Specification.
+You should not deploy or write to this code, but instead use a tested and certified Java SE compatible version of the code.
+Redistribution of this build must retain this notice.
diff a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,12 +1,36 @@
-# Welcome to the JDK!
+## Corretto 25
 
-For build instructions please see the
-[online documentation](https://openjdk.org/groups/build/doc/building.html),
-or either of these files:
+Amazon Corretto is a no-cost, multiplatform,
+production-ready distribution of the Open Java Development Kit (OpenJDK).
+Corretto is used internally at Amazon for production services.
+With Corretto, you can develop and run Java applications
+on operating systems such as Linux, Windows, and macOS.
 
-- [doc/building.html](doc/building.html) (html version)
-- [doc/building.md](doc/building.md) (markdown version)
+This repository is used to track [OpenJDK 25](https://github.com/openjdk/jdk/tree/jdk25).
+Please look at the branches section for more information on Feature Releases.
+
+Documentation is available at [https://docs.aws.amazon.com/corretto](https://docs.aws.amazon.com/corretto).
+
+### Licenses and Trademarks
+
+Please read these files: "LICENSE", "ADDITIONAL_LICENSE_INFO", "ASSEMBLY_EXCEPTION", "TRADEMARKS.md".
+
+### Branches
+
+_develop_
+: The default branch. The branch that consumes development and patches to upstream [openjdk/jdk:jdk25](https://github.com/openjdk/jdk). Corretto builds are generated from this branch.
+
+### OpenJDK Readme
+```
+
+Welcome to the JDK!
+===================
+
+For build instructions, please see either of these files:
+
+  * doc/building.html   (html version)
+  * doc/building.md     (markdown version)
 
 See <https://openjdk.org/> for more information about the OpenJDK
 Community and the JDK and see <https://bugs.openjdk.org> for JDK issue
 tracking.
diff a/TRADEMARKS.md b/TRADEMARKS.md
--- /dev/null
+++ b/TRADEMARKS.md
@@ -0,0 +1,37 @@
+# TRADEMARK POLICY
+
+This policy of Amazon.com, Inc. or its affiliates ("Amazon") provides guidelines for use of the "Corretto" and “Amazon Corretto” trademarks (“Corretto Trademarks") to identify Amazon's Corretto software. Use of the Corretto Trademarks must be in accordance with this policy. Our goal is to ensure that Amazon’s trademarks remain reliable indicators of quality and security while also permitting community members, software distributors and others we work with to discuss Amazon's products and to accurately describe such products’ affiliation with Amazon. Note that this policy only applies to use of the Corretto Trademarks. Use of any other Amazon trademarks is not included or covered by this policy.
+
+## OVERALL GUIDELINES
+
+You may use the Corretto and Amazon Corretto word marks in plain text to refer to Amazon’s Corretto software in compliance with this policy. Any other use of our trademarks, including any logos, requires prior written permission.
+
+Overall, your use of the Corretto Trademarks must not be confusing or damaging to Amazon or to the Corretto Trademarks themselves. 
+
+People should always know who they are dealing with, and where the software they are downloading came from. You may not use the Corretto Trademarks in any manner that implies approval or endorsement by or association with Amazon. You may not use the Corretto Trademarks to refer to a product other than Amazon’s Corretto software. Following the guidelines below for modifications will help avoid confusion.
+
+You may not use the Corretto Trademarks as a vehicle to damage the reputation of Amazon or our Corretto software or to make any false or misleading statements. You may not use the Corretto Trademarks in a manner that may diminish or otherwise damage Amazon's goodwill in the trademarks. The Corretto Trademarks should be used in their exact form and not abbreviated or combined with any other word or words (e.g., "Corretto" software rather than "CRTO" or "Correttofied"). 
+
+Amazon owns all rights in the Corretto Trademarks, and your use of them does not transfer rights to you. Any goodwill generated by your use of our Corretto Trademarks will belong to Amazon.
+
+## MODIFICATIONS
+
+Those taking full advantage of the open source nature of the Amazon Corretto code and making modifications may not redistribute the modified software under the Corretto Trademarks. Additionally, to avoid misleading a user into believing the modified software is a native Amazon product, if you modify any file where the file name contains a Corretto Trademark or the Amazon name, you must rename that file (except files that contain only an Amazon copyright that is part of an open source license header).
+
+## RELATED SOFTWARE
+
+Amazon recognizes that community members writing related software need some way to identify the Amazon product to which that software pertains. Users should not be confused as to whether the related software is an official Amazon product or otherwise approved by Amazon. The name of such software may not include, in whole or in part, the Corretto Trademarks in a way that suggests a connection between Amazon and the extension.
+
+## QUESTIONS
+
+If you are unsure whether your use of the Corretto Trademarks would run afoul of this policy, feel free to contact us and ask. If you have questions about these guidelines or use of any other Amazon trademark, please contact trademarks@amazon.com for assistance, or write to us at:
+
+**Amazon.com, Inc., Attention: Trademarks,
+PO Box 81226 Seattle, WA 98108-1226**
+
+This policy is based in part on the open source trademark policy defined by the Mozilla organization, available [here](https://www.mozilla.org/en-US/foundation/trademarks/policy/), as adapted to Amazon’s Carbonado policy, available [here](http://carbonado.sourceforge.net/trademark.html). Thus, the text of this policy (and not the Corretto Trademarks themselves) is licensed under the Creative Commons "Attribution-ShareAlike 2.0" license.
+
+### FAQ:
+
+**1. Can I create and redistribute my own builds of Amazon Corretto?**
+: If you build Amazon Corretto from source and redistribute the results, you may use the Corretto Trademarks only if it is clear in both the name of your distribution and the content associated with it that your distribution is your build of Amazon Corretto and not the official build, and you must identify the commit from which it is built, including the commit date.
diff a/amazon-cacerts b/amazon-cacerts
Binary files /dev/null and amazon-cacerts differ
diff a/build.gradle b/build.gradle
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,323 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+// Tasks can refer to version information using the project.version
+// property. For an example of its usage, see ':installers:linux:rpm:buildLogic'
+// where the version numbers are used to populate a templated RPM spec file.
+
+import org.apache.tools.ant.taskdefs.condition.Os
+
+allprojects {
+    apply plugin: 'base'
+
+    configurations {
+        compile {
+            transitive = false
+        }
+    }
+
+    version = {
+        def full = file('version.txt').text.trim()
+        def tokens = full.tokenize(".")
+        [full    : full,
+         major   : tokens[0],
+         minor   : tokens[1],
+         security: tokens[2],
+         build   : tokens[3],
+         revision: tokens[4],
+         upstream: "${tokens[0]}.${tokens[1]}.${tokens[2]}.${tokens[3]}".toString()]
+    }.call()
+    buildDir = 'corretto-build'
+
+    ext {
+        buildRoot = file("$buildDir/buildRoot")
+        distributionDir = file("$buildDir/distributions")
+        packageInfo = [
+                url       : "https://github.com/corretto/corretto-${project.version.major}",
+                vendor    : 'Amazon',
+                packager  : 'Amazon',
+                description  : 'Amazon Corretto\'s packaging of the runtime core elements of the OpenJDK code.',
+                license   : 'ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with ' +
+                        'exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ' +
+                        'ISC and FTL and RSA.',
+                maintainer: 'Amazon Corretto Team <corretto-team@amazon.com>',
+                buildHost : 'build.amazon.com'
+        ]
+        jdkTools = ['java', 'keytool', 'rmid', 'rmiregistry', 'jjs', 'pack200', 'unpack200', 'javac', 'jaotc', 'jlink',
+            'jmod', 'jhsdb', 'jar', 'jarsigner', 'javadoc', 'javap', 'jcmd', 'jconsole', 'jdb', 'jdeps', 'jdeprscan',
+            'jimage', 'jinfo', 'jmap', 'jps', 'jrunscript', 'jshell', 'jstack', 'jstat', 'jstatd', 'rmic', 'serialver']
+        // artifact names
+        caCerts = "cacerts"
+        sourceTar = "amazon-corretto-source-${project.version.full}.tar.gz"
+
+        configurationFiles = [
+            'conf/logging.properties',
+            'conf/net.properties',
+            'conf/sound.properties',
+            'conf/security/policy/limited/default_local.policy',
+            'conf/security/policy/limited/exempt_local.policy',
+            'conf/security/policy/limited/default_US_export.policy',
+            'conf/security/policy/unlimited/default_local.policy',
+            'conf/security/policy/unlimited/default_US_export.policy',
+            'conf/security/java.security',
+            'conf/management/jmxremote.access',
+            'conf/management/management.properties',
+            'lib/security/blocked.certs',
+            'lib/security/public_suffix_list.dat'
+            ];
+
+        correttoCommonFlags = [
+                "--with-freetype=bundled",
+                '--with-jvm-features=zgc',
+                "--with-version-build=${project.version.build}",
+                '--with-version-pre=',
+                "--with-vendor-bug-url=https://github.com/corretto/corretto-${project.version.major}/issues/",
+                "--with-vendor-vm-bug-url=https://github.com/corretto/corretto-${project.version.major}/issues/",
+                '--with-vendor-name=Amazon.com Inc.',
+                '--with-vendor-url=https://aws.amazon.com/corretto/',
+                "--with-vendor-version-string=Corretto-${project.version.full}"
+        ]
+
+        // If this is a certified release build, exclude the README.JAVASE file
+        excludeReadmeJavaSE = Boolean.parseBoolean(project.findProperty("corretto.excludeReadmeJavaSE"))
+        rootFiles = ['ADDITIONAL_LICENSE_INFO', 'ASSEMBLY_EXCEPTION', 'LICENSE', 'README.md', 'commitId.txt', 'version.txt']
+        if (!excludeReadmeJavaSE) {
+            rootFiles += 'README.JAVASE'
+        }
+
+        // If the version opt is empty, then the JDK will set to  'adhoc.<username>.<base dir name>'
+        versionOpt = project.findProperty("corretto.versionOpt") ?: "LTS" // Set the LTS when needed
+        correttoCommonFlags += ["--with-version-opt=${versionOpt}"]
+
+        def versionDate = project.findProperty("corretto.versionDate")
+        if (versionDate) {
+            correttoCommonFlags += ["--with-version-date=${versionDate}"]
+        }
+
+        def gtest = project.findProperty("corretto.gtest")
+        if (gtest) {
+            correttoCommonFlags += ["--with-gtest=${gtest}"]
+        }
+
+        // This should be public so we can know if we should build the micro-benchmarks
+        jmh = project.findProperty("corretto.jmh")
+        if (jmh) {
+            correttoCommonFlags += ["--with-jmh=${jmh}"]
+        }
+
+        // If asyncProfilerBinariesPath provided, store for easy reference when bundling
+        asyncProfilerBinariesPath = project.findProperty("asyncProfilerBinariesPath") ?: ""
+        asyncProfilerLegal = "${rootDir}/installers/legal/async-profiler.md"
+
+        // Valid value: null, release, debug, fastdebug, slowdebug
+        correttoDebugLevel = "release" // Default: release
+        switch(project.findProperty("corretto.debug_level")) {
+            case null:
+            case "release":
+                correttoCommonFlags += ['--with-debug-level=release', '--with-native-debug-symbols=zipped']
+                break
+            case "fastdebug":
+                correttoDebugLevel = "fastdebug"
+                correttoCommonFlags += ['--with-debug-level=fastdebug', '--with-native-debug-symbols=zipped']
+                break
+            case "debug":
+            case "slowdebug":
+                correttoDebugLevel = "slowdebug"
+                correttoCommonFlags += ['--with-debug-level=slowdebug', '--with-native-debug-symbols=external']
+                break
+            default:
+                throw new RuntimeException("Invalid corretto.debug_level")
+        }
+
+        // customized flags. Identify the index of double dashes as the start of a flag
+        String extraConfig = project.findProperty("corretto.extra_config")
+        def lastIndex = -1
+        if (extraConfig != null) {
+            for (int index = extraConfig.indexOf("--"); index >= 0; index = extraConfig.indexOf("--", index + 1)) {
+                if (lastIndex != -1) {
+                    correttoCommonFlags += extraConfig.substring(lastIndex, index).trim()
+                }
+                lastIndex = index
+            }
+            if (lastIndex != -1) {
+                correttoCommonFlags += extraConfig.substring(lastIndex).trim()
+            }
+        }
+
+        // Determine the system architecture
+        def jdkArch = ""
+        def os = ""
+        if (Os.isFamily(Os.FAMILY_MAC)) {
+            os = 'macosx'
+            nativeArch = ['uname', '-m'].execute().text.trim()
+            if (nativeArch == "arm64") {
+                jdkArch = "aarch64"
+            } else {
+                jdkArch = "x86_64"
+            }
+        } else if (Os.isFamily(Os.FAMILY_UNIX)) {
+            os = 'linux'
+            jdkArch = ['uname', '-m'].execute().text.trim()
+            // `uname -m` returns the host arch in a linux x86 docker instance. Pass a flag
+            // to enable
+            if (project.hasProperty("x86") && Boolean.parseBoolean(project.getProperty('x86'))) {
+                jdkArch = "x86"
+            }
+        } else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
+            os = 'windows'
+            def arch = System.getenv('PROCESSOR_ARCHITECTURE')
+            if (arch == 'AMD64') {
+                jdkArch = "x86_64"
+            } else { //x86
+                throw new GradleException("${arch} is not suported")
+            }
+        } else {
+            throw new GradleException("OS is not supported")
+        }
+
+        // Ext property: correttoArch
+        switch (jdkArch) {
+            case 'x86':
+            case 'aarch64':
+                correttoArch = jdkArch
+                break
+            case 'x86_64':
+                correttoArch = 'x64'
+                break
+            default:
+                throw new GradleException("${jdkArch} is not supported")
+        }
+
+        // Call toString explicitly to avoid lazy evaluation
+        jdkImageName = "${os}-${jdkArch}-server-${correttoDebugLevel}".toString()
+        // no debug level suffix for release build
+        if (correttoDebugLevel == "release") {
+            correttoJdkArchiveName = "amazon-corretto-${project.version.full}-${os}-${correttoArch}".toString()
+        } else {
+            correttoJdkArchiveName =
+                    "amazon-corretto-${project.version.full}-${os}-${correttoArch}-${correttoDebugLevel}".toString()
+        }
+        correttoDebugSymbolsArchiveName = "amazon-corretto-debugsymbols-${project.version.full}-${os}-${correttoArch}".toString()
+        correttoTestImageArchiveName = "amazon-corretto-testimage-${project.version.full}-${os}-${correttoArch}".toString()
+    }
+}
+
+project(':prebuild') {
+    apply plugin: 'java'
+
+    configurations {
+        cacerts
+    }
+
+    ext {
+        cacertDir = "$distributionDir/${project.caCerts}"
+    }
+
+    def preBuildSrc = "src"
+    def classPath = "classes"
+    def generateToolMain = "build.tools.generatecacerts.GenerateCacerts"
+
+    task copyToolSrc(type: Copy) {
+        description = 'Copy utility tool source to the project root'
+        from fileTree("$rootDir/make/jdk/src/classes") {
+            include 'build/tools/generatecacerts/*'
+        }
+        into preBuildSrc
+    }
+
+    task buildTool(type: JavaCompile) {
+        dependsOn copyToolSrc
+        source = fileTree(dir: preBuildSrc, include: '**/*.java')
+        destinationDirectory = file(classPath)
+        classpath = files(classPath)
+    }
+
+    task generateJdkCacerts(type: JavaExec) {
+        dependsOn buildTool
+        def jdkCaDir = "$rootDir/src/java.base/share/data/cacerts"
+
+        description = 'Generate Cacerts from JDK source'
+        classpath = files(classPath)
+
+        // See commit for [JDK-8275252](https://github.com/corretto/corretto-jdk/commit/bd2b41dd7062c50f3aaebec2137d5fdd9546c120)
+        jvmArgs = ['-Dkeystore.pkcs12.certProtectionAlgorithm=NONE', '-Dkeystore.pkcs12.macAlgorithm=NONE']
+        mainClass = generateToolMain
+        args = [jdkCaDir, project.caCerts]
+    }
+
+    task importAmazonCacerts(type: Exec) {
+        dependsOn generateJdkCacerts
+        // Default password for JSSE key store
+        def keystore_password = "changeit"
+        commandLine 'keytool', '-importkeystore', '-noprompt',
+                '-srckeystore', "$rootDir/amazon-cacerts",
+                '-srcstorepass', keystore_password,
+                '-destkeystore', caCerts,
+                '-deststorepass', ''
+    }
+
+    task copyCacerts(type: Copy) {
+        dependsOn importAmazonCacerts
+        from caCerts
+        into distributionDir
+    }
+
+    artifacts {
+        cacerts file: file("$distributionDir/${caCerts}"), builtBy: copyCacerts
+    }
+}
+
+project(':openjdksrc') {
+    /**
+     * Compresses a snapshot of the source code used to perform the build.
+     */
+    task sourceDistributionTarball(type: Tar) {
+        description = 'Assemble source files required for building and distributing Corretto.'
+        compression = Compression.GZIP
+        archiveFileName = sourceTar
+        def sourceTarRootFiles = ['LICENSE',
+                    'ADDITIONAL_LICENSE_INFO',
+                    'README',
+                    'README.md',
+                    'ASSEMBLY_EXCEPTION',
+                    'commitId.txt',
+                    'version.txt',
+                    'amazon-cacerts',
+                    'configure',
+                    'Makefile',
+                    'bin/**',
+                    'doc/**',
+                    'make/**',
+                    'src/**',
+                    'test/**']
+        if (!excludeReadmeJavaSE) {
+            sourceTarRootFiles += 'README.JAVASE'
+        }
+
+        from fileTree(rootDir) {
+            include sourceTarRootFiles
+        }
+    }
+
+    artifacts {
+        archives sourceDistributionTarball
+    }
+}
diff a/gradle.properties b/gradle.properties
--- /dev/null
+++ b/gradle.properties
@@ -0,0 +1,2 @@
+org.gradle.parallel=true
+org.gradle.vfs.watch=false
diff a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
Binary files /dev/null and gradle/wrapper/gradle-wrapper.jar differ
diff a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,7 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
+networkTimeout=10000
+validateDistributionUrl=true
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff a/gradlew b/gradlew
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,251 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+##############################################################################
+#
+#   Gradle start up script for POSIX generated by Gradle.
+#
+#   Important for running:
+#
+#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
+#       noncompliant, but you have some other compliant shell such as ksh or
+#       bash, then to run this script, type that shell name before the whole
+#       command line, like:
+#
+#           ksh Gradle
+#
+#       Busybox and similar reduced shells will NOT work, because this script
+#       requires all of these POSIX shell features:
+#         * functions;
+#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
+#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
+#         * compound commands having a testable exit status, especially «case»;
+#         * various built-in commands including «command», «set», and «ulimit».
+#
+#   Important for patching:
+#
+#   (2) This script targets any POSIX shell, so it avoids extensions provided
+#       by Bash, Ksh, etc; in particular arrays are avoided.
+#
+#       The "traditional" practice of packing multiple parameters into a
+#       space-separated string is a well documented source of bugs and security
+#       problems, so this is (mostly) avoided, by progressively accumulating
+#       options in "$@", and eventually passing that to Java.
+#
+#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
+#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
+#       see the in-line comments for details.
+#
+#       There are tweaks for specific operating systems such as AIX, CygWin,
+#       Darwin, MinGW, and NonStop.
+#
+#   (3) This script is generated from the Groovy template
+#       https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+#       within the Gradle project.
+#
+#       You can find Gradle at https://github.com/gradle/gradle/.
+#
+##############################################################################
+
+# Attempt to set APP_HOME
+
+# Resolve links: $0 may be a link
+app_path=$0
+
+# Need this for daisy-chained symlinks.
+while
+    APP_HOME=${app_path%"${app_path##*/}"}  # leaves a trailing /; empty if no leading path
+    [ -h "$app_path" ]
+do
+    ls=$( ls -ld "$app_path" )
+    link=${ls#*' -> '}
+    case $link in             #(
+      /*)   app_path=$link ;; #(
+      *)    app_path=$APP_HOME$link ;;
+    esac
+done
+
+# This is normally unused
+# shellcheck disable=SC2034
+APP_BASE_NAME=${0##*/}
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+    echo "$*"
+} >&2
+
+die () {
+    echo
+    echo "$*"
+    echo
+    exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in                #(
+  CYGWIN* )         cygwin=true  ;; #(
+  Darwin* )         darwin=true  ;; #(
+  MSYS* | MINGW* )  msys=true    ;; #(
+  NONSTOP* )        nonstop=true ;;
+esac
+
+CLASSPATH="\\\"\\\""
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+        # IBM's JDK on AIX uses strange locations for the executables
+        JAVACMD=$JAVA_HOME/jre/sh/java
+    else
+        JAVACMD=$JAVA_HOME/bin/java
+    fi
+    if [ ! -x "$JAVACMD" ] ; then
+        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+else
+    JAVACMD=java
+    if ! command -v java >/dev/null 2>&1
+    then
+        die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+    fi
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+    case $MAX_FD in #(
+      max*)
+        # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+        # shellcheck disable=SC2039,SC3045
+        MAX_FD=$( ulimit -H -n ) ||
+            warn "Could not query maximum file descriptor limit"
+    esac
+    case $MAX_FD in  #(
+      '' | soft) :;; #(
+      *)
+        # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+        # shellcheck disable=SC2039,SC3045
+        ulimit -n "$MAX_FD" ||
+            warn "Could not set maximum file descriptor limit to $MAX_FD"
+    esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+#   * args from the command line
+#   * the main class name
+#   * -classpath
+#   * -D...appname settings
+#   * --module-path (only if needed)
+#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if "$cygwin" || "$msys" ; then
+    APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
+    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
+
+    JAVACMD=$( cygpath --unix "$JAVACMD" )
+
+    # Now convert the arguments - kludge to limit ourselves to /bin/sh
+    for arg do
+        if
+            case $arg in                                #(
+              -*)   false ;;                            # don't mess with options #(
+              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath
+                    [ -e "$t" ] ;;                      #(
+              *)    false ;;
+            esac
+        then
+            arg=$( cygpath --path --ignore --mixed "$arg" )
+        fi
+        # Roll the args list around exactly as many times as the number of
+        # args, so each arg winds up back in the position where it started, but
+        # possibly modified.
+        #
+        # NB: a `for` loop captures its iteration list before it begins, so
+        # changing the positional parameters here affects neither the number of
+        # iterations, nor the values presented in `arg`.
+        shift                   # remove old arg
+        set -- "$@" "$arg"      # push replacement arg
+    done
+fi
+
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Collect all arguments for the java command:
+#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+#     and any embedded shellness will be escaped.
+#   * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+#     treated as '${Hostname}' itself on the command line.
+
+set -- \
+        "-Dorg.gradle.appname=$APP_BASE_NAME" \
+        -classpath "$CLASSPATH" \
+        -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
+        "$@"
+
+# Stop when "xargs" is not available.
+if ! command -v xargs >/dev/null 2>&1
+then
+    die "xargs is not available"
+fi
+
+# Use "xargs" to parse quoted args.
+#
+# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
+#
+# In Bash we could simply go:
+#
+#   readarray ARGS < <( xargs -n1 <<<"$var" ) &&
+#   set -- "${ARGS[@]}" "$@"
+#
+# but POSIX shell has neither arrays nor command substitution, so instead we
+# post-process each arg (as a line of input to sed) to backslash-escape any
+# character that might be a shell metacharacter, then use eval to reverse
+# that process (while maintaining the separation between arguments), and wrap
+# the whole thing up as a single "set" statement.
+#
+# This will of course break if any of these variables contains a newline or
+# an unmatched quote.
+#
+
+eval "set -- $(
+        printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
+        xargs -n1 |
+        sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
+        tr '\n' ' '
+    )" '"$@"'
+
+exec "$JAVACMD" "$@"
diff a/gradlew.bat b/gradlew.bat
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,94 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@rem Licensed under the Apache License, Version 2.0 (the "License");
+@rem you may not use this file except in compliance with the License.
+@rem You may obtain a copy of the License at
+@rem
+@rem      https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@rem Unless required by applicable law or agreed to in writing, software
+@rem distributed under the License is distributed on an "AS IS" BASIS,
+@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+@rem SPDX-License-Identifier: Apache-2.0
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem  Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff a/installers/legal/async-profiler.md b/installers/legal/async-profiler.md
--- /dev/null
+++ b/installers/legal/async-profiler.md
@@ -0,0 +1,215 @@
+DO NOT TRANSLATE OR LOCALIZE.
+-----------------------------
+
+%% This notice is provided with respect to Async-Profiler, which is licensed under Apache 2.0
+and may be included as a separate work from the JDK.
+
+
+--- begin of LICENSE ---
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+--- end of LICENSE ---
+
+-------------------------------------------------------------------------------
+
diff a/installers/linux/al2/spec/build.gradle b/installers/linux/al2/spec/build.gradle
--- /dev/null
+++ b/installers/linux/al2/spec/build.gradle
@@ -0,0 +1,98 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+import groovy.text.GStringTemplateEngine
+
+dependencies {
+    compile project(path: ':openjdksrc', configuration: 'archives')
+}
+
+def tarName = "java-${version.major}-amazon-corretto"
+def tarVersion = "${version.major}.${version.minor}.${version.security}+${version.build}"
+
+def javaVersion = "${version.major}.${version.minor}.${version.security}"
+def buildId = "${version.build}"
+def releaseId = "${version.revision}"
+/**
+ * Apply version numbers to the RPM spec file template and copy
+ * to the build root.
+ */
+task inflateRpmSpec {
+    inputs.file 'java-amazon-corretto.spec.template'
+    outputs.file "$buildDir/java-${version.major}-amazon-corretto.spec"
+    doLast {
+        def renderedTemplate = new GStringTemplateEngine()
+                .createTemplate(file('java-amazon-corretto.spec.template'))
+                .make(
+                [
+                    java_spec_version   : version.major,
+                    java_major_version   : version.major,
+                    java_security_version   : version.security,
+                    java_version        : javaVersion,
+                    build_id            : buildId,
+                    release_id          : releaseId,
+                    version_opt         : versionOpt,
+                    debug_level         : correttoDebugLevel,
+                    boot_jdk_major_version : version.major.toInteger() - 1,
+                    boot_jdk_major_v_backup : version.major.toInteger() - 2,
+                    experimental_feature: project.findProperty("corretto.experimental_feature") ?: "%{nil}",
+                    additional_configure_options: project.findProperty("corretto.additional_configure_options") ?: "%{nil}",
+                    zlib_option: project.findProperty("corretto.zlib_option") ?: "system",
+                    use_gcc_ver: project.findProperty("corretto.use_gcc_ver") ?: "%{nil}"
+                ])
+        outputs.files.singleFile.text = renderedTemplate
+    }
+}
+
+task copySourceTar(type: Tar) {
+    dependsOn project.configurations.compile, inflateRpmSpec
+    compression = Compression.GZIP
+    archiveFileName = project.configurations.compile.singleFile.name
+    from("$buildDir") {
+        include "java-${project.version.major}-amazon-corretto.spec"
+        into 'rpm'
+    }
+    from(tarTree(project.configurations.compile.singleFile)) {
+        into '/'
+    }
+    // Include the man pages tarball if it exists
+    from(file("${buildDir}/distributions/jdk${project.version.major}-manpages.tar.gz")) {
+        into '/'
+    }
+}
+
+task rpmBuild(type: Exec) {
+    dependsOn copySourceTar
+    workingDir "$buildDir"
+    executable = '/usr/bin/rpmbuild'
+    args  = ['-vv',
+        '-bs',
+        '--define',
+        "dist .${project.findProperty('corretto.amzn_dist') ?: 'amzn2'}",
+        '--define',
+        "_topdir ${buildDir}/rpmbuild",
+        '--define',
+        "_sourcedir ${buildDir}/distributions",
+        '--define',
+        "_srcrpmdir ${buildDir}/distributions",
+        "java-${version.major}-amazon-corretto.spec"]
+
+}
diff a/installers/linux/al2/spec/java-amazon-corretto.spec.template b/installers/linux/al2/spec/java-amazon-corretto.spec.template
--- /dev/null
+++ b/installers/linux/al2/spec/java-amazon-corretto.spec.template
@@ -0,0 +1,556 @@
+# Copyright Amazon.com Inc. 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
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation. Amazon designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# The Corretto github project provides tarfiles with five dotted
+# version parts.  The first four are the typical Java version + build,
+# and the last one is the release ID.
+%global java_version    $java_version
+%global java_major_version    $java_spec_version
+%global java_security_version    $java_security_version
+%global build_id        $build_id
+%global release_id      $release_id
+%global version_opt     $version_opt
+%global experimental_feature     $experimental_feature
+%global additional_configure_options     $additional_configure_options
+%global zlib_option $zlib_option
+%global use_gcc_ver $use_gcc_ver
+
+# Disable build_id links as they can collide between versions of Corretto
+%global _build_id_links none
+
+# The experimental_feature macro gets set to %nil by the template, but that is still defined and
+# the spec doesn't have a quick is not nil check, just define/not defined, this makes it easier to
+# work with
+%if 0%{?experimental_feature:1} && "%{experimental_feature}" == "%{nil}"
+%undefine experimental_feature
+%endif
+
+%if 0%{?additional_configure_options:1} == 1 && "%{additional_configure_options}" == "%{nil}"
+%undefine additional_configure_options
+%endif
+
+%if 0%{?use_gcc_ver:1} == 1 && "%{use_gcc_ver}" == "%{nil}"
+%undefine use_gcc_ver
+%endif
+# If we need to rev the package for something outside of what the
+# Corretto team is doing, we can define release_ext.
+# %global release_ext  1
+
+%global boot_jdk_major_version    $boot_jdk_major_version
+%global boot_jdk_major_v_backup    $boot_jdk_major_v_backup
+
+%global java_home %{_jvmdir}/%{name}.%{_arch}
+%global java_lib  %{java_home}/lib
+%global java_inc  %{java_home}/include
+
+# Where the make targets actually get written out
+%global java_imgdir build/linux-%{_arch}-server-$debug_level/images/
+
+# Higher numbers win for the alternatives program.
+%global alternatives_priority %( printf '%02d%02d%02d%02d' %{java_major_version} %{java_security_version} %{build_id} %{release_id} )
+
+# Instruct rpmbuild to copy jars rather than de-compress and re-compress.
+%global __jar_repack 0
+
+# Don't create a separate debug package. Specifically disables running
+# this script:
+# https://github.com/rpm-software-management/rpm/blob/master/scripts/find-debuginfo.sh
+%define debug_package %{nil}
+
+# abs2rel: A macro to convert an absolute path to a relative path.
+# When making a symlink in an RPM, prefer a symbolic link to ensure
+# the link will work in a chroot environment.
+%global script 'use File::Spec; print File::Spec->abs2rel(\$ARGV[0], \$ARGV[1])'
+%global abs2rel %{__perl} -e %{script}
+
+# Filter out private libraries so RPM does not list them as provided/required
+%global _privatelibs libjli[.]so.*|libattach[.]so.*|libawt_headless[.]so.*|libawt[.]so.*|libdt_socket[.]so.*|libextnet[.]so.*|libfontmanager[.]so.*|libinstrument[.]so.*|libj2gss[.]so.*|libj2pcsc[.]so.*|libj2pkcs11[.]so.*|libjaas[.]so.*|libjavajpeg[.]so.*|libjdwp[.]so.*|libjimage[.]so.*|libjsound[.]so.*|libjsvml[.]so.*|liblcms[.]so.*|libmanagement[.]so.*|libmanagement_agent[.]so.*|libmanagement_ext[.]so.*|libmlib_image[.]so.*|libnet[.]so.*|libnio[.]so.*|libprefs[.]so.*|librmi[.]so.*|libsaproc[.]so.*|libsctp[.]so.*|libsyslookup[.]so.*|libzip[.]so.*|libsplashscreen[.]so.*|libawt_xawt[.]so.*
+%global _publiclibs libjawt[.]so.*|libjava.so.*|libjsig.so.*|libjvm.so.*|libverify.so.*
+
+%if "%{dist}" == ".amzn2" || "%{dist}" == ".amzn2int"
+# On AL2 we don't want to list any libraries as Provides to keep existing functionality
+%global __provides_exclude ^(%{_privatelibs}|%{_publiclibs})\$
+%global __requires_exclude ^(%{_privatelibs}|%{_publiclibs})\$
+%else
+# On newer AL versions, we will want only the latest LTS at release time to provide the public libs.
+# Having multiple versions of Java providing the libs will cause problems. (https://bugzilla.redhat.com/show_bug.cgi?id=1702356)
+%global __provides_exclude ^(%{_privatelibs})\$
+%global __requires_exclude ^(%{_privatelibs})\$
+%endif
+
+# By default install a bootstrap jdk. If one is already available,
+# this can be skipped using --without bootjdk
+%bcond_without bootjdk
+
+Summary: Amazon Corretto development environment
+Name: java-${java_spec_version}-amazon-corretto%{?experimental_feature:-%{experimental_feature}}
+# Matches the 'full version' from Java's release notes:
+# https://www.oracle.com/technetwork/java/javase/11-0-2-relnotes-5188746.html
+# Eg: 11.0.2+7
+Version: %{java_version}+%{build_id}
+Release: %{release_id}%{?dist}%{?release_ext:.%{release_ext}}
+
+Epoch: 1
+Group: Development/Languages
+AutoProv: 1
+AutoReq: 0
+License: ASL 1.1 and ASL 2.0 and BSD and BSD with advertising and GPL+ and GPLv2 and GPLv2 with exceptions and IJG and LGPLv2+ and MIT and MPLv2.0 and Public Domain and W3C and zlib and ISC and FTL and RSA.
+Vendor: Amazon
+Url: https://github.com/corretto/corretto-${java_spec_version}
+Source0: amazon-corretto-source-%{java_version}.%{build_id}.%{release_id}.tar.gz
+Source1: jdk%{java_major_version}-manpages.tar.gz
+
+# jpackage-utils/javapackages-filesystem is required for both build and runtime.
+# For build, it provides the jvmdir macro. For runtime,
+# it provides the /usr/lib/jvm directory.
+%if "%{dist}" == ".amzn2" || "%{dist}" == ".amzn2int"
+BuildRequires: jpackage-utils
+%else
+BuildRequires: javapackages-filesystem
+%endif
+BuildRequires: autoconf
+BuildRequires: make
+BuildRequires: alsa-lib-devel
+BuildRequires: binutils
+BuildRequires: which
+BuildRequires: cups-devel
+BuildRequires: fontconfig-devel
+BuildRequires: freetype-devel
+BuildRequires: giflib-devel
+BuildRequires: gcc%{?use_gcc_ver}-c++
+BuildRequires: libjpeg-devel
+BuildRequires: libpng-devel
+BuildRequires: libxslt
+BuildRequires: libX11-devel
+BuildRequires: libXi-devel
+BuildRequires: libXinerama-devel
+BuildRequires: libXt-devel
+BuildRequires: libXrender-devel
+BuildRequires: libXrandr-devel
+BuildRequires: libXtst-devel
+BuildRequires: pkgconfig
+BuildRequires: xorg-x11-proto-devel
+
+%if %{with bootjdk}
+BuildRequires: (java-${boot_jdk_major_version}-devel or java-${boot_jdk_major_v_backup}-devel)
+%endif
+
+Requires: libX11
+Requires: libXi
+Requires: libXinerama
+Requires: libXt
+Requires: libXrender
+Requires: libXrandr
+Requires: libXtst
+Requires: giflib
+Requires: libpng
+# Require headless package.
+Requires: %{name}-headless%{?_isa} = %{epoch}:%{version}-%{release}
+
+Provides: java = %{epoch}:%{java_version}
+Provides: java-${java_spec_version} = %{epoch}:%{java_version}
+Provides: java-${java_spec_version} = %{epoch}:%{version}-%{release}
+Provides: jre = %{java_version}
+Provides: jre-${java_spec_version} = %{epoch}:%{version}-%{release}
+Provides: jre-${java_spec_version}-amazon-corretto = %{epoch}:%{version}-%{release}
+
+%description
+Amazon Corretto's packaging of the runtime core elements of the
+OpenJDK ${java_spec_version} code.
+
+%package headless
+Summary: Amazon Corretto headless development environment
+Group:   Development/Tools
+AutoProv: 1
+AutoReq: 0
+
+%if "%{dist}" == ".amzn2" || "%{dist}" == ".amzn2int"
+Requires: jpackage-utils
+%else
+Requires: javapackages-filesystem
+%endif
+Requires: zlib
+Requires: fontconfig
+Requires: freetype
+Requires: dejavu-sans-fonts
+Requires: dejavu-serif-fonts
+Requires: dejavu-sans-mono-fonts
+Requires: alsa-lib
+Requires: libjpeg
+Requires: ca-certificates
+%if "%{dist}" == ".amzn2"
+Requires: log4j-cve-2021-44228-cve-mitigations
+%endif
+Requires(post): chkconfig
+Requires(postun): chkconfig
+
+Provides: java-headless = %{epoch}:%{java_version}
+Provides: java-${java_spec_version}-headless = %{epoch}:%{version}-%{release}
+Provides: jre-headless = %{epoch}:%{java_version}
+Provides: jre-${java_spec_version}-headless = %{epoch}:%{version}-%{release}
+Provides: jre-${java_spec_version}-amazon-corretto-headless = %{epoch}:%{version}-%{release}
+
+
+%description headless
+Amazon Corretto's packaging of the runtime core elements of the
+OpenJDK ${java_spec_version} code. (Headless environment)
+
+%package javadoc
+Summary: Amazon Corretto ${java_spec_version} API documentation
+Group: Documentation
+
+Provides: java-javadoc = %{epoch}:%{version}-%{release}
+Provides: java-${java_spec_version}-javadoc = %{epoch}:%{version}-%{release}
+
+%description javadoc
+Amazon Corretto's packaging of the OpenJDK ${java_spec_version} API documentation.
+
+%package devel
+Summary: Amazon Corretto ${java_spec_version} development tools
+Group: Development
+AutoProv: 1
+AutoReq: 0
+
+Provides: java-devel = %{epoch}:%{java_version}
+Provides: java-${java_spec_version}-devel = %{epoch}:%{java_version}
+Provides: java-${java_spec_version}-devel = %{epoch}:%{version}-%{release}
+Requires: %{name}-headless%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
+
+%description devel
+Amazon Corretto's packaging of the OpenJDK ${java_spec_version} development tools.
+
+%package jmods
+Summary: Amazon Corretto ${java_spec_version} jmods
+Group: Development
+
+Provides: java-${java_spec_version}-jmods = %{epoch}:%{java_version}
+Provides: java-${java_spec_version}-jmods = %{epoch}:%{version}-%{release}
+# Require devel package.
+Requires: %{name}-devel%{?1}%{?_isa} = %{epoch}:%{version}-%{release}
+
+%description jmods
+Amazon Corretto's packaging of the OpenJDK ${java_spec_version} jmods.
+
+%package debugsymbols
+Summary: Amazon Corretto ${java_spec_version} zipped debug symbols
+Group: Development
+
+%description debugsymbols
+Amazon Corretto's packaging of the OpenJDK ${java_spec_version} debug symbols.
+
+%prep
+%setup -q -n src -c
+
+# Extract pre-generated man pages
+mkdir -p manpages
+tar -xzf %{SOURCE1} -C manpages
+
+%build
+
+%if "%{dist}" == ".amzn2" || "%{dist}" == ".amzn2int"
+# AmazonLinux ships with GifLib 4.x which does not define GIFLIB_MAJOR. This must be defined
+# because -Werror=undef is enabled.
+%define GIFLIB_DEFINE "-DGIFLIB_MAJOR=4"
+%endif
+
+bash ./configure \\
+%ifarch aarch64
+        --with-extra-cflags="-moutline-atomics%{?GIFLIB_DEFINE: %{GIFLIB_DEFINE}}" \\
+        --with-extra-cxxflags="-moutline-atomics" \\
+%else
+%if "%{?GIFLIB_DEFINE:1}" == "1"
+        --with-extra-cflags="%{GIFLIB_DEFINE}" \\
+%endif
+%endif
+%if 0%{?additional_configure_options:1}
+        %{additional_configure_options} \\
+%endif
+        --with-jvm-features="zgc shenandoahgc" \\
+        --with-version-feature="${java_spec_version}" \\
+        --with-freetype=system \\
+        --with-libjpeg=system \\
+        --with-giflib=system \\
+        --with-libpng=system \\
+        --with-zlib="%{zlib_option}" \\
+        --with-version-opt="%{version_opt}" \\
+        --with-version-build="%{build_id}" \\
+        --with-vendor-version-string="Corretto%{?experimental_feature:-%{experimental_feature}}-%{java_version}.%{build_id}.%{release_id}" \\
+        --with-version-pre= \\
+        --with-vendor-name="Amazon.com Inc." \\
+        --with-vendor-url="https://aws.amazon.com/corretto/" \\
+        --with-vendor-bug-url="https://github.com/corretto/corretto-${java_spec_version}/issues/" \\
+        --with-vendor-vm-bug-url="https://github.com/corretto/corretto-${java_spec_version}/issues/" \\
+        --with-debug-level=$debug_level \\
+        --with-native-debug-symbols=zipped
+
+make images
+make LOG=debug docs
+
+%install
+rm -rf %{buildroot}
+install -d -m 755 %{buildroot}%{java_home}
+cp -a %{java_imgdir}/jdk/* %{buildroot}%{java_home}
+rm -rf %{buildroot}%{java_home}/demo
+
+# Properly set permissions for executables and libs to enable auto-provides scanning
+find %{buildroot}%{java_home}/ -name "*.so" -exec chmod 755 \\{\\} \\; ;
+find %{buildroot}%{java_home} -type d -exec chmod 755 \\{\\} \\; ;
+# Set legal to read-only.
+find %{buildroot}%{java_home}/legal -type f -exec chmod 644 \\{\\} \\; ;
+
+# Install pre-generated man pages
+mkdir -p %{buildroot}%{java_home}/man/man1
+cp -p manpages/*.1 %{buildroot}%{java_home}/man/man1/
+
+# Make a *relative* symlink pointing to the cacerts file from ca-certificates.
+rm -f %{buildroot}%{java_home}/lib/security/cacerts
+pushd %{buildroot}%{java_home}/lib/security
+  RELATIVE=\$(%{abs2rel} %{_sysconfdir}/pki/java %{buildroot}%{java_home}/lib/security)
+  ln -sf \$RELATIVE/cacerts .
+popd
+
+%post headless
+if [ \$1 -eq 1 ] ; then
+  alternatives --install %{_bindir}/java java %{java_home}/bin/java %{alternatives_priority} \\
+               --slave %{_jvmdir}/%{name} %{name} %{java_home} \\
+               --slave %{_jvmdir}/jre jre %{java_home} \\
+               --slave %{_jvmdir}/jre-openjdk jre_openjdk %{java_home} \\
+               --slave %{_bindir}/keytool keytool %{java_home}/bin/keytool \\
+               --slave %{_bindir}/rmiregistry rmiregistry %{java_home}/bin/rmiregistry \\
+               --slave %{_mandir}/man1/java.1 java.1 %{java_home}/man/man1/java.1 \\
+               --slave %{_mandir}/man1/keytool.1 keytool.1 %{java_home}/man/man1/keytool.1 \\
+               --slave %{_mandir}/man1/rmiregistry.1 rmiregistry.1 %{java_home}/man/man1/rmiregistry.1
+
+  # Need to setup the jre alternatives separately when there is a higher priority jre java these don't get created above.
+  alternatives --install %{_jvmdir}/jre-%{java_major_version} jre_%{java_major_version} %{java_home} %{alternatives_priority} \
+               --slave %{_jvmdir}/jre-%{java_major_version}-openjdk jre_%{java_major_version}_openjdk %{java_home}
+fi
+
+%post devel
+if [ \$1 -eq 1 ] ; then
+  alternatives --install %{_bindir}/javac javac %{java_home}/bin/javac %{alternatives_priority} \\
+               --slave %{_jvmdir}/java java_sdk %{java_home} \\
+               --slave %{_bindir}/jar jar %{java_home}/bin/jar \\
+               --slave %{_bindir}/jarsigner jarsigner %{java_home}/bin/jarsigner \\
+               --slave %{_bindir}/javadoc javadoc %{java_home}/bin/javadoc \\
+               --slave %{_bindir}/javap javap %{java_home}/bin/javap \\
+               --slave %{_bindir}/jcmd jcmd %{java_home}/bin/jcmd \\
+               --slave %{_bindir}/jconsole jconsole %{java_home}/bin/jconsole \\
+               --slave %{_bindir}/jdb jdb %{java_home}/bin/jdb \\
+               --slave %{_bindir}/jdeprscan jdeprscan %{java_home}/bin/jdeprscan \\
+               --slave %{_bindir}/jdeps jdeps %{java_home}/bin/jdeps \\
+               --slave %{_bindir}/jfr jfr %{java_home}/bin/jfr \\
+               --slave %{_bindir}/jhsdb jhsdb %{java_home}/bin/jhsdb \\
+               --slave %{_bindir}/jimage jimage %{java_home}/bin/jimage \\
+               --slave %{_bindir}/jinfo jinfo %{java_home}/bin/jinfo \\
+               --slave %{_bindir}/jlink jlink %{java_home}/bin/jlink \\
+               --slave %{_bindir}/jmap jmap %{java_home}/bin/jmap \\
+               --slave %{_bindir}/jmod jmod %{java_home}/bin/jmod \\
+               --slave %{_bindir}/jpackage jpackage %{java_home}/bin/jpackage \\
+               --slave %{_bindir}/jps jps %{java_home}/bin/jps \\
+               --slave %{_bindir}/jrunscript jrunscript %{java_home}/bin/jrunscript \\
+               --slave %{_bindir}/jshell jshell %{java_home}/bin/jshell \\
+               --slave %{_bindir}/jstack jstack %{java_home}/bin/jstack \\
+               --slave %{_bindir}/jstat jstat %{java_home}/bin/jstat \\
+               --slave %{_bindir}/jstatd jstatd %{java_home}/bin/jstatd \\
+               --slave %{_bindir}/jwebserver jwebserver %{java_home}/bin/jwebserver \\
+               --slave %{_bindir}/serialver serialver %{java_home}/bin/serialver \\
+               --slave %{_mandir}/man1/jar.1 jar.1 %{java_home}/man/man1/jar.1 \\
+               --slave %{_mandir}/man1/jarsigner.1 jarsigner.1 %{java_home}/man/man1/jarsigner.1 \\
+               --slave %{_mandir}/man1/javac.1 javac.1 %{java_home}/man/man1/javac.1 \\
+               --slave %{_mandir}/man1/javadoc.1 javadoc.1 %{java_home}/man/man1/javadoc.1 \\
+               --slave %{_mandir}/man1/javap.1 javap.1 %{java_home}/man/man1/javap.1 \\
+               --slave %{_mandir}/man1/jcmd.1 jcmd.1 %{java_home}/man/man1/jcmd.1 \\
+               --slave %{_mandir}/man1/jconsole.1 jconsole.1 %{java_home}/man/man1/jconsole.1 \\
+               --slave %{_mandir}/man1/jdb.1 jdb.1 %{java_home}/man/man1/jdb.1 \\
+               --slave %{_mandir}/man1/jdeps.1 jdeps.1 %{java_home}/man/man1/jdeps.1 \\
+               --slave %{_mandir}/man1/jinfo.1 jinfo.1 %{java_home}/man/man1/jinfo.1 \\
+               --slave %{_mandir}/man1/jjs.1 jjs.1 %{java_home}/man/man1/jjs.1 \\
+               --slave %{_mandir}/man1/jmap.1 jmap.1 %{java_home}/man/man1/jmap.1 \\
+               --slave %{_mandir}/man1/jps.1 jps.1 %{java_home}/man/man1/jps.1 \\
+               --slave %{_mandir}/man1/jrunscript.1 jrunscript.1 %{java_home}/man/man1/jrunscript.1 \\
+               --slave %{_mandir}/man1/jstack.1 jstack.1 %{java_home}/man/man1/jstack.1 \\
+               --slave %{_mandir}/man1/jstat.1 jstat.1 %{java_home}/man/man1/jstat.1 \\
+               --slave %{_mandir}/man1/jstatd.1 jstatd.1 %{java_home}/man/man1/jstatd.1 \\
+               --slave %{_mandir}/man1/jwebserver.1 jwebserver.1 %{java_home}/man/man1/jwebserver.1 \\
+               --slave %{_mandir}/man1/rmic.1 rmic.1 %{java_home}/man/man1/rmic.1 \\
+               --slave %{_mandir}/man1/serialver.1 serialver.1 %{java_home}/man/man1/serialver.1
+
+  alternatives --install %{_jvmdir}/java-%{java_major_version} java_sdk_%{java_major_version} %{java_home} %{alternatives_priority} \\
+               --slave %{_jvmdir}/java-%{java_major_version}-openjdk java_sdk_%{java_major_version}_openjdk %{java_home}
+fi
+
+%postun headless
+if [ \$1 -eq 0 ] ; then
+  alternatives --remove java %{java_home}/bin/java
+  alternatives --remove jre_%{java_major_version} %{java_home}/jre
+fi
+
+%postun devel
+if [ \$1 -eq 0 ] ; then
+  alternatives --remove javac %{java_home}/bin/javac
+  alternatives --remove java_sdk_%{java_major_version} %{java_home}
+fi
+
+%files
+%{java_lib}/libawt_xawt.so
+%{java_lib}/libjawt.so
+%{java_lib}/libsplashscreen.so
+
+%files headless
+%config(noreplace) %{java_home}/conf/logging.properties
+%config(noreplace) %{java_home}/conf/net.properties
+%config(noreplace) %{java_home}/conf/sound.properties
+%config(noreplace) %{java_home}/conf/management/jmxremote.access
+%config(noreplace) %{java_home}/conf/management/management.properties
+%config(noreplace) %{java_home}/conf/security/java.security
+%config(noreplace) %{java_home}/conf/security/policy/limited/exempt_local.policy
+%config(noreplace) %{java_home}/conf/security/policy/limited/default_local.policy
+%config(noreplace) %{java_home}/conf/security/policy/limited/default_US_export.policy
+%config(noreplace) %{java_home}/conf/security/policy/unlimited/default_local.policy
+%config(noreplace) %{java_home}/conf/security/policy/unlimited/default_US_export.policy
+%config(noreplace) %{java_home}/lib/security/blocked.certs
+%config(noreplace) %{java_home}/lib/security/public_suffix_list.dat
+%dir %{java_home}
+%dir %{java_home}/bin
+%{java_home}/bin/java
+%{java_home}/bin/keytool
+%{java_home}/bin/rmiregistry
+%{java_home}/conf
+%{java_home}/legal
+%{java_home}/lib
+%dir %{java_home}/man
+%dir %{java_home}/man/man1
+%{java_home}/man/man1/java.1
+%{java_home}/man/man1/keytool.1
+%{java_home}/man/man1/rmiregistry.1
+%{java_home}/release
+
+# Keep the libs and includes that need X11 in the main package
+%exclude %{java_lib}/libawt_xawt.so
+%exclude %{java_lib}/libjawt.so
+%exclude %{java_lib}/libsplashscreen.so
+# Exclude debug symbol files
+%exclude %{java_home}/lib/*.diz
+%exclude %{java_home}/lib/server/*.diz
+
+%files devel
+%{java_home}/bin/jar
+%{java_home}/bin/jarsigner
+%{java_home}/bin/javac
+%{java_home}/bin/javadoc
+%{java_home}/bin/javap
+%{java_home}/bin/jcmd
+%{java_home}/bin/jconsole
+%{java_home}/bin/jdb
+%{java_home}/bin/jdeprscan
+%{java_home}/bin/jdeps
+%{java_home}/bin/jfr
+%{java_home}/bin/jhsdb
+%{java_home}/bin/jimage
+%{java_home}/bin/jinfo
+%{java_home}/bin/jlink
+%{java_home}/bin/jmap
+%{java_home}/bin/jmod
+%{java_home}/bin/jnativescan
+%{java_home}/bin/jpackage
+%{java_home}/bin/jps
+%{java_home}/bin/jrunscript
+%{java_home}/bin/jshell
+%{java_home}/bin/jstack
+%{java_home}/bin/jstat
+%{java_home}/bin/jstatd
+%{java_home}/bin/jwebserver
+%{java_home}/bin/serialver
+%{java_inc}
+%{java_home}/man/man1/jar.1
+%{java_home}/man/man1/jarsigner.1
+%{java_home}/man/man1/javac.1
+%{java_home}/man/man1/javadoc.1
+%{java_home}/man/man1/javap.1
+%{java_home}/man/man1/jcmd.1
+%{java_home}/man/man1/jconsole.1
+%{java_home}/man/man1/jdb.1
+%{java_home}/man/man1/jdeprscan.1
+%{java_home}/man/man1/jdeps.1
+%{java_home}/man/man1/jfr.1
+%{java_home}/man/man1/jhsdb.1
+%{java_home}/man/man1/jinfo.1
+%{java_home}/man/man1/jlink.1
+%{java_home}/man/man1/jmap.1
+%{java_home}/man/man1/jmod.1
+%{java_home}/man/man1/jnativescan.1
+%{java_home}/man/man1/jpackage.1
+%{java_home}/man/man1/jps.1
+%{java_home}/man/man1/jrunscript.1
+%{java_home}/man/man1/jshell.1
+%{java_home}/man/man1/jstack.1
+%{java_home}/man/man1/jstat.1
+%{java_home}/man/man1/jstatd.1
+%{java_home}/man/man1/jwebserver.1
+%{java_home}/man/man1/serialver.1
+
+%files jmods
+%{java_home}/jmods
+
+%files javadoc
+%doc %{java_imgdir}/docs/index.html
+%doc %{java_imgdir}/docs/api
+%doc %{java_imgdir}/docs/resources
+%doc %{java_imgdir}/docs/specs
+%license %{java_imgdir}/docs/legal
+
+%files debugsymbols
+%{java_home}/bin/*.diz
+%{java_home}/lib/*.diz
+%{java_home}/lib/server/*.diz
+
+%changelog
+* Mon Aug 5 2024 Daniel Hu <costmuch@amazon.com>
+- Add package debug symbols
+
+* Mon Oct 10 2022 Dan Lutker <lutkerd@amazon.com>
+- Fix provides to include public shared libs
+
+* Mon Aug 29 2022 Dan Lutker <lutkerd@amazon.com>
+- Move requires for jpeg, alsa and fonts to headless package
+
+* Thu Aug 18 2022 Dan Lutker <lutkerd@amazon.com>
+- Add ability to set debug_level
+
+* Fri Jul 22 2022 Dan Lutker <lutkerd@amazon.com>
+- Add provides java-devel
+
+* Thu Jun 30 2022 Dan Lutker <lutkerd@amazon.com>
+- Fixup java/jre symlinks
+
+* Tue Mar 15 2022 Dan Lutker <lutkerd@amazon.com>
+- Add config files as config(noreplace)
+
+* Fri Feb 18 2022 Dan Lutker <lutkerd@amazon.com>
+- Fix alternatives for devel package
+
+* Fri Feb 18 2022 Dan Lutker <lutkerd@amazon.com>
+- Add jwebserver to devel package
+
+* Thu Dec 16 2021 Clive Verghese <verghese@amazon.com>
+- Add requires for log4j CVE-2021-44228 static mitigation
+
+* Mon Nov 22 2021 Dan Lutker <lutkerd@amazon.com>
+- Setup AL2 package for CorrettoJdk
diff a/installers/linux/alpine/tar/build.gradle b/installers/linux/alpine/tar/build.gradle
--- /dev/null
+++ b/installers/linux/alpine/tar/build.gradle
@@ -0,0 +1,188 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+dependencies {
+    compile project(path: ':openjdksrc', configuration: 'archives')
+    compile project(path: ':prebuild', configuration: 'cacerts')
+}
+
+ext {
+    // all linux distros and macos support 'uname -m'
+    arch = ['uname', '-m'].execute().text.trim()
+
+	switch (arch) {
+	case 'aarch64':
+		arch_alias = arch
+		break;
+	case 'x86_64':
+		arch_alias = 'x64'
+		break;
+	default:
+		throw new GradleException("${arch} is not suported")
+    }
+}
+def jdkResultingImage = "$buildRoot/build/linux-${arch}-server-${correttoDebugLevel}/images/jdk"
+def testResultingImage = "$buildRoot/build/linux-${arch}-server-${correttoDebugLevel}/images/test"
+
+// deps
+def depsMap = [:]
+project.configurations.compile.getFiles().each { depsMap[it.getName()] = it }
+/**
+ * Create a local copy of the source tree in our
+ * build root -- this is required since OpenJDK's
+ * build wants to occur inside the source tree,
+ * and we don't want to tamper with someone
+ * else's tree.
+ */
+task copySource(type: Exec) {
+    if (!file(buildRoot).exists()) {
+        file(buildRoot).mkdirs()
+    }
+    workingDir '/usr/bin'
+    commandLine 'rsync', '-am',
+            '--exclude=pre-build',
+            '--exclude=installers',
+            '--exclude=corretto-build',
+            "${project.rootDir}/", buildRoot
+}
+
+/**
+ * Scan the patches folder for any .patch that needs
+ * to be applied before start building.
+ */
+task applyPatches() {
+    dependsOn copySource
+    doLast {
+        fileTree('patches').matching {
+            include '*.patch'
+        }.each { f ->
+            ant.patch(patchfile: f, dir: "$buildRoot", strip: 0)
+        }
+    }
+}
+
+task configureBuild(type: Exec) {
+
+    dependsOn project.configurations.compile
+    dependsOn applyPatches
+    workingDir "$buildRoot"
+
+    // Platform specific flags
+    def command = ['bash', 'configure']
+    // Common flags
+    command += project.correttoCommonFlags
+    command += ["--with-cacerts-file=${depsMap[caCerts]}",
+                "--with-zlib=system"
+    ]
+   commandLine command.flatten()
+}
+
+task executeBuild(type: Exec) {
+    dependsOn configureBuild
+    workingDir "$buildRoot"
+    commandLine 'make', 'images'
+    outputs.dir jdkResultingImage
+}
+
+task createTestImage(type: Exec) {
+    dependsOn executeBuild
+    workingDir "$buildRoot"
+    commandLine 'make','test-image'
+}
+
+task bundleThirdPartyBinaries {
+    dependsOn executeBuild
+    doLast {
+        // If property set, copy async profiler binaries to bundle
+        if (project.asyncProfilerBinariesPath != "") {
+            if (!file(project.asyncProfilerBinariesPath).isDirectory()) {
+                throw new GradleException("asyncProfilerBinariesPath is not a valid directory: ${project.asyncProfilerBinariesPath}")
+            }
+            copy {
+                from project.asyncProfilerBinariesPath
+                include 'bin/**', 'lib/**'
+                into jdkResultingImage
+            }
+            copy {
+                from project.asyncProfilerLegal
+                into "${jdkResultingImage}/legal"
+            }
+        }
+    }
+}
+
+task packageTestImage(type: Tar) {
+    dependsOn createTestImage
+    description = 'Package test results'
+    archiveFileName = "amazon-corretto-testimage-${project.version.full}-alpine-linux-${arch_alias}.tar.gz"
+    compression = Compression.GZIP
+    from(testResultingImage) {
+        include '**'
+    }
+    into "amazon-corretto-testimage-${project.version.full}-alpine-linux-${arch_alias}"
+}
+
+task packageDebugSymbols(type: Tar) {
+    dependsOn packageTestImage
+    description = 'Package debug symbols'
+    archiveFileName = "amazon-corretto-debugsymbols-${project.version.full}-alpine-linux-${arch_alias}.tar.gz"
+    compression = Compression.GZIP
+    from(jdkResultingImage) {
+        include 'bin/*.diz'
+        include 'lib/*.diz'
+        include 'lib/server/*.diz'
+        into "amazon-corretto-debugsymbols-${project.version.full}-alpine-linux-${arch_alias}"
+    }
+}
+
+task packageBuildResults(type: Tar) {
+    description = 'Compresses the JDK image and puts the results in build/distributions.'
+    dependsOn packageDebugSymbols
+    dependsOn executeBuild
+    dependsOn bundleThirdPartyBinaries
+    archiveFileName = "amazon-corretto-${project.version.full}-alpine-linux-${arch_alias}.tar.gz"
+    compression = Compression.GZIP
+    from(buildRoot) {
+        include project.rootFiles
+    }
+    from(jdkResultingImage) {
+        include 'bin/**'
+        include 'conf/**'
+        include 'include/**'
+        include 'jmods/**'
+        include 'lib/**'
+        include 'man/man1/**'
+        include 'release'
+        exclude '**/*.diz'
+    }
+
+    // Copy legal directory specifically to set permission correctly.
+    // See https://github.com/corretto/corretto-11/issues/129
+    from(jdkResultingImage) {
+        include 'legal/**'
+        fileMode = 0444
+    }
+    into "amazon-corretto-${project.version.full}-alpine-linux-${arch_alias}"
+}
+
+artifacts {
+    archives packageBuildResults
+}
diff a/installers/linux/alpine/tar/patches/zlib.patch b/installers/linux/alpine/tar/patches/zlib.patch
--- /dev/null
+++ b/installers/linux/alpine/tar/patches/zlib.patch
@@ -0,0 +1,149 @@
+This patch is applied to disable implicit-fallthrough warnings on gcc7 or
+higher when building the bundled version of zlib.
+
+diff --git src/java.base/share/native/libzip/zlib/infback.c src/java.base/share/native/libzip/zlib/infback.c
+index 4c8283909..1a9cc6b60 100644
+--- src/java.base/share/native/libzip/zlib/infback.c
++++ src/java.base/share/native/libzip/zlib/infback.c
+@@ -501,7 +501,7 @@ void FAR *out_desc;
+             }
+             Tracev((stderr, "inflate:       codes ok\n"));
+             state->mode = LEN;
+-
++            /* FALLTHROUGH */
+         case LEN:
+             /* use inflate_fast() if we have enough input and output */
+             if (have >= 6 && left >= 258) {
+diff --git src/java.base/share/native/libzip/zlib/inflate.c src/java.base/share/native/libzip/zlib/inflate.c
+index ca904e744..4abfe84a5 100644
+--- src/java.base/share/native/libzip/zlib/inflate.c
++++ src/java.base/share/native/libzip/zlib/inflate.c
+@@ -764,6 +764,7 @@ int flush;
+                 CRC2(state->check, hold);
+             INITBITS();
+             state->mode = EXLEN;
++            /* FALLTHROUGH */
+         case EXLEN:
+             if (state->flags & 0x0400) {
+                 NEEDBITS(16);
+@@ -777,6 +778,7 @@ int flush;
+             else if (state->head != Z_NULL)
+                 state->head->extra = Z_NULL;
+             state->mode = EXTRA;
++            /* FALLTHROUGH */
+         case EXTRA:
+             if (state->flags & 0x0400) {
+                 copy = state->length;
+@@ -799,6 +801,7 @@ int flush;
+             }
+             state->length = 0;
+             state->mode = NAME;
++            /* FALLTHROUGH */
+         case NAME:
+             if (state->flags & 0x0800) {
+                 if (have == 0) goto inf_leave;
+@@ -820,6 +823,7 @@ int flush;
+                 state->head->name = Z_NULL;
+             state->length = 0;
+             state->mode = COMMENT;
++            /* FALLTHROUGH */
+         case COMMENT:
+             if (state->flags & 0x1000) {
+                 if (have == 0) goto inf_leave;
+@@ -840,6 +844,7 @@ int flush;
+             else if (state->head != Z_NULL)
+                 state->head->comment = Z_NULL;
+             state->mode = HCRC;
++            /* FALLTHROUGH */
+         case HCRC:
+             if (state->flags & 0x0200) {
+                 NEEDBITS(16);
+@@ -863,6 +868,7 @@ int flush;
+             strm->adler = state->check = ZSWAP32(hold);
+             INITBITS();
+             state->mode = DICT;
++            /* FALLTHROUGH */
+         case DICT:
+             if (state->havedict == 0) {
+                 RESTORE();
+@@ -870,8 +876,10 @@ int flush;
+             }
+             strm->adler = state->check = adler32(0L, Z_NULL, 0);
+             state->mode = TYPE;
++            /* FALLTHROUGH */
+         case TYPE:
+             if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
++            /* FALLTHROUGH */
+         case TYPEDO:
+             if (state->last) {
+                 BYTEBITS();
+@@ -922,8 +930,10 @@ int flush;
+             INITBITS();
+             state->mode = COPY_;
+             if (flush == Z_TREES) goto inf_leave;
++            /* FALLTHROUGH */
+         case COPY_:
+             state->mode = COPY;
++            /* FALLTHROUGH */
+         case COPY:
+             copy = state->length;
+             if (copy) {
+@@ -1063,8 +1073,10 @@ int flush;
+             Tracev((stderr, "inflate:       codes ok\n"));
+             state->mode = LEN_;
+             if (flush == Z_TREES) goto inf_leave;
++            /* FALLTHROUGH */
+         case LEN_:
+             state->mode = LEN;
++            /* FALLTHROUGH */
+         case LEN:
+             if (have >= 6 && left >= 258) {
+                 RESTORE();
+@@ -1114,6 +1126,7 @@ int flush;
+             }
+             state->extra = (unsigned)(here.op) & 15;
+             state->mode = LENEXT;
++            /* FALLTHROUGH */
+         case LENEXT:
+             if (state->extra) {
+                 NEEDBITS(state->extra);
+@@ -1124,6 +1137,7 @@ int flush;
+             Tracevv((stderr, "inflate:         length %u\n", state->length));
+             state->was = state->length;
+             state->mode = DIST;
++            /* FALLTHROUGH */
+         case DIST:
+             for (;;) {
+                 here = state->distcode[BITS(state->distbits)];
+@@ -1151,6 +1165,7 @@ int flush;
+             state->offset = (unsigned)here.val;
+             state->extra = (unsigned)(here.op) & 15;
+             state->mode = DISTEXT;
++            /* FALLTHROUGH */
+         case DISTEXT:
+             if (state->extra) {
+                 NEEDBITS(state->extra);
+@@ -1167,6 +1182,7 @@ int flush;
+ #endif
+             Tracevv((stderr, "inflate:         distance %u\n", state->offset));
+             state->mode = MATCH;
++            /* FALLTHROUGH */
+         case MATCH:
+             if (left == 0) goto inf_leave;
+             copy = out - left;
+@@ -1242,6 +1258,7 @@ int flush;
+             }
+ #ifdef GUNZIP
+             state->mode = LENGTH;
++            /* FALLTHROUGH */
+         case LENGTH:
+             if (state->wrap && state->flags) {
+                 NEEDBITS(32);
+@@ -1255,6 +1272,7 @@ int flush;
+             }
+ #endif
+             state->mode = DONE;
++            /* FALLTHROUGH */
+         case DONE:
+             ret = Z_STREAM_END;
+             goto inf_leave;
diff a/installers/linux/universal/deb/build.gradle b/installers/linux/universal/deb/build.gradle
--- /dev/null
+++ b/installers/linux/universal/deb/build.gradle
@@ -0,0 +1,209 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+plugins {
+    id 'com.netflix.nebula.ospackage' version 'latest.release'
+}
+
+dependencies {
+    compile project(path: ':installers:linux:universal:tar', configuration: 'archives')
+}
+
+ext {
+    switch (project.correttoArch) {
+        case 'aarch64':
+            arch_deb = 'arm64'
+            break;
+        case 'x86':
+            arch_deb = "i386"
+            break
+        case 'x64':
+            arch_deb = 'amd64'
+            break
+    }
+}
+
+def jvmDir = '/usr/lib/jvm'
+def jdkInstallationDirName = "java-${project.version.major}-amazon-corretto"
+def jdkHome = "${jvmDir}/${jdkInstallationDirName}".toString()
+def jdkBinaryDir = "${buildRoot}/${project.correttoJdkArchiveName}"
+def jdkPackageName = "java-${project.version.major}-amazon-corretto-jdk"
+
+def alternativesPriority = String.format("1%2s%2s%3s", project.version.major, project.version.minor, project.version.security).replace(' ', '0')
+
+def jinfoName = ".${jdkInstallationDirName}.jinfo"
+
+ospackage {
+    // Valid version must start with a digit and only contain [A-Za-z0-9.+:~-]
+    // See http://manpages.ubuntu.com/manpages/artful/en/man5/deb-version.5.html
+    version = project.version.upstream
+    release = project.version.revision
+
+    url = "${packageInfo.url}"
+    vendor = "${packageInfo.vendor}"
+    packager = "${packageInfo.packager}"
+    license = "${packageInfo.license}"
+    buildHost = "${packageInfo.buildHost}"
+    maintainer = "${packageInfo.maintainer}"
+    packageGroup = 'java'
+    priority = 'optional'
+    user = 'root'
+    permissionGroup = 'root'
+    epoch = 1
+    arch = arch_deb
+    multiArch = SAME
+}
+
+/**
+ * Uncompress and copy the universal Corretto artifact
+ * tar for DEB packaging.
+ */
+task extractUniversalTar(type: Copy) {
+    dependsOn project.configurations.compile
+    from tarTree(project.configurations.compile.singleFile)
+    into buildRoot
+}
+
+/**
+ * Populate version numbers, java home and alternatives
+ * priority to postin_jdk.sh.template and preun_jdk.sh.template.
+ * Create script copies under build root scripts folder.
+ */
+task inflateDebScriptTemplate(type: Copy) {
+    dependsOn extractUniversalTar
+    // In trusty repo, openjdk7 has priority 1071 and openjdk6 has 1061
+    // Corretto uses the same priority in both rpm and deb
+    def priority =
+            from('scripts') {
+                include '**/*.template'
+                rename { file -> file.replace('.template', '') }
+                filter(org.apache.tools.ant.filters.ReplaceTokens,
+                        tokens: project.version + [java_home: jdkHome, alternatives_priority: alternativesPriority,
+                                                   jdk_tools: jdkTools.join(' ')])
+            }
+    into "${buildRoot}/scripts"
+}
+
+/**
+ * Inflate jinfo file used by update-java-alternatives command.
+ * Create script copy under buildRoot/jinfo folder. See
+ * http://manpages.ubuntu.com/manpages/xenial/man8/update-java-alternatives.8.html#files
+ */
+task inflateJinfoTemplate(type: Copy) {
+    from('jinfo') {
+        include '**/*.template'
+        rename('jinfo.template', jinfoName)
+        filter(org.apache.tools.ant.filters.ReplaceTokens,
+                tokens: project.version + [java_home     : jdkHome, alternatives_priority: alternativesPriority,
+                                           directory_name: jdkInstallationDirName.toString()])
+        expand(jdk_tools: jdkTools)
+    }
+    into "${buildRoot}/jinfo"
+}
+
+/**
+ * Generate DEB for JDK, with package published under
+ * distributions folder.
+ */
+task generateJdkDeb(type: Deb) {
+    description = 'Create the DEB package for Corretto JDK'
+    dependsOn inflateDebScriptTemplate
+    dependsOn inflateJinfoTemplate
+
+    packageName = jdkPackageName
+    packageDescription = "Amazon Corretto\'s packaging of the OpenJDK ${project.version.major} code."
+    summary = "Amazon Corretto ${project.version.major} development environment"
+
+    postInstall file("$buildRoot/scripts/postin_jdk.sh")
+    preUninstall file("$buildRoot/scripts/preun_jdk.sh")
+
+    requires('java-common')
+    requires('zlib1g')
+    // jdk
+    provides('java-compiler')
+    provides('java-sdk')
+    provides('java5-sdk')
+    provides('java6-sdk')
+    provides('java7-sdk')
+    provides('java7-jdk')
+    provides('java8-jdk')
+    provides('java11-sdk')
+    17.upto(project.version.major.toInteger()) {
+      provides("java${it}-sdk")
+    }
+    // TODO: Move this to the jre when splitting the fat deb
+    provides('java-runtime')
+    provides('java5-runtime')
+    provides('java6-runtime')
+    provides('java7-runtime')
+    provides('java8-runtime')
+    provides('java11-runtime')
+    17.upto(project.version.major.toInteger()) {
+      provides("java${it}-runtime")
+    }
+    // TODO: Move this to the headless jre when splitting the fat deb
+    provides('java-runtime-headless')
+    provides('java5-runtime-headless')
+    provides('java6-runtime-headless')
+    provides('java7-runtime-headless')
+    provides('java8-runtime-headless')
+    provides('java11-runtime-headless')
+    17.upto(project.version.major.toInteger()) {
+      provides("java${it}-runtime-headless")
+    }
+
+    from(jdkBinaryDir) {
+        include(project.configurationFiles)
+        // Deb actually uses configuationFile and not fileType see https://github.com/nebula-plugins/gradle-ospackage-plugin/issues/118#issuecomment-656004360
+        // Path must be the fully qualified install path
+        configurationFile = project.configurationFiles.collect{ "${jdkHome}/${it}" }.join("\n")
+        into jdkHome
+    }
+
+    from(jdkBinaryDir) {
+        into jdkHome
+        exclude 'legal'
+        exclude(project.configurationFiles)
+    }
+
+    // Copy legal directory specifically to set permission correctly.
+    // See https://github.com/corretto/corretto-11/issues/129
+    from("${jdkBinaryDir}/legal") {
+        into "${jdkHome}/legal"
+        fileMode = 0444
+    }
+
+    if (!project.excludeReadmeJavaSE) {
+        from("${jdkBinaryDir}/README.JAVASE") {
+            into jdkHome
+            fileMode = 0444
+        }
+    }
+
+    from("${buildRoot}/jinfo") {
+        include '**/*.jinfo'
+        into jvmDir
+    }
+}
+
+artifacts {
+    archives generateJdkDeb
+}
diff a/installers/linux/universal/deb/jinfo/jinfo.template b/installers/linux/universal/deb/jinfo/jinfo.template
--- /dev/null
+++ b/installers/linux/universal/deb/jinfo/jinfo.template
@@ -0,0 +1,7 @@
+name=@directory_name@
+alias=@directory_name@
+priority=@alternatives_priority@
+section=main
+
+<% jdk_tools.each {%>jdk ${it} @java_home@/bin/${it}
+<%}%>
diff a/installers/linux/universal/deb/scripts/postin_jdk.sh.template b/installers/linux/universal/deb/scripts/postin_jdk.sh.template
--- /dev/null
+++ b/installers/linux/universal/deb/scripts/postin_jdk.sh.template
@@ -0,0 +1,19 @@
+# postinst script for Corretto
+#
+# summary of how this script can be called:
+#        * <postinst> `configure' <most-recently-configured-version>
+# for details, see https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html or
+# the debian-policy package
+
+
+# Note that Nebula gradle-ospackage-plugin default and only support `configure` option for post installation script.
+
+for i in @jdk_tools@; do
+    if [ -e @java_home@/bin/$i ]; then
+        cmd="update-alternatives --install /usr/bin/$i $i @java_home@/bin/$i @alternatives_priority@"
+        if [ -e @java_home@/man/man1/$i.1 ]; then
+            cmd="$cmd --slave /usr/share/man/man1/$i.1 $i.1 @java_home@/man/man1/$i.1"
+        fi
+        $cmd
+    fi
+done
diff a/installers/linux/universal/deb/scripts/preun_jdk.sh.template b/installers/linux/universal/deb/scripts/preun_jdk.sh.template
--- /dev/null
+++ b/installers/linux/universal/deb/scripts/preun_jdk.sh.template
@@ -0,0 +1,18 @@
+# postrm script for Corretto
+#
+# summary of how this script can be called:
+#        * <postrm> `remove'
+# for details, see https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html or
+# the debian-policy package
+
+case "$1" in
+    remove | deconfigure)
+        for i in @jdk_tools@; do
+            if [ -e @java_home@/bin/$i ]; then
+                update-alternatives --remove $i @java_home@/bin/$i
+            fi
+        done
+    ;;
+esac
+
+exit 0
diff a/installers/linux/universal/rpm/build.gradle b/installers/linux/universal/rpm/build.gradle
--- /dev/null
+++ b/installers/linux/universal/rpm/build.gradle
@@ -0,0 +1,159 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+plugins {
+    id 'com.netflix.nebula.ospackage' version 'latest.release'
+}
+
+dependencies {
+    compile project(path: ':installers:linux:universal:tar', configuration: 'archives')
+}
+
+ext {
+    switch (project.correttoArch) {
+        case 'aarch64':
+            arch_redline = 'AARCH64'
+            break;
+        case 'x86':
+            arch_redline = "i386"
+            break
+        case 'x64':
+            arch_redline = 'x86_64'
+            break
+    }
+}
+
+def jvmDir = '/usr/lib/jvm'
+def jdkInstallationDirName = "java-${project.version.major}-amazon-corretto"
+def jdkHome = "${jvmDir}/${jdkInstallationDirName}"
+def jdkBinaryDir = "${buildRoot}/${project.correttoJdkArchiveName}"
+def jdkPackageName = "java-${project.version.major}-amazon-corretto-devel"
+
+ospackage {
+    version = project.version.upstream
+    release = project.version.revision
+
+    url = "${packageInfo.url}"
+    vendor = "${packageInfo.vendor}"
+    packager = "${packageInfo.packager}"
+    license = "${packageInfo.license}"
+    buildHost = "${packageInfo.buildHost}"
+    user = 'root'
+    permissionGroup = 'root'
+    epoch = 1
+    arch = arch_redline
+    os = LINUX
+    type = BINARY
+}
+
+/**
+ * Uncompress and copy the universal Corretto artifact
+ * tar for RPM packaging.
+ */
+task extractUniversalTar(type: Copy) {
+    dependsOn project.configurations.compile
+    from tarTree(project.configurations.compile.singleFile)
+    into buildRoot
+}
+
+/**
+ * Populate version numbers, java home and alternatives
+ * priority to postin_javac.sh.template and preun_javac.sh.template.
+ * Create script copies under build root scripts folder.
+ */
+task inflateRpmScriptTemplate(type: Copy) {
+    dependsOn extractUniversalTar
+    // Use the same priority as IcedTea JDK RPM distribution, based on java version
+    def priority = String.format("1%2s%2s%3s", project.version.major, project.version.minor, project.version.security).replace(' ', '0')
+    from('scripts') {
+        include '**/*.template'
+        rename { file -> file.replace('.template', '') }
+        filter(org.apache.tools.ant.filters.ReplaceTokens,
+                tokens: project.version + [alternatives_priority: priority])
+    }
+    into "${buildRoot}/scripts"
+}
+
+/**
+ * Generate RPM for JDK, with package published under
+ * distributions folder.
+ */
+task generateJdkRpm(type: Rpm) {
+    description = 'Create the RPM package for Corretto JDK'
+    dependsOn inflateRpmScriptTemplate
+    packageName = jdkPackageName
+    packageDescription = packageInfo.description
+    summary = "Amazon Corretto ${project.version.major} development environment"
+    packageGroup = 'Development/Tools'
+    // Remove after https://github.com/nebula-plugins/gradle-ospackage-plugin/issues/401 is merged and released
+    sourcePackage = "${jdkPackageName}-${project.version.major}.${project.version.minor}.${project.version.security}.${project.version.build}-${project.version.revision}.src.rpm"
+
+    prefix(jdkHome)
+    postInstall file("$buildRoot/scripts/postin_java.sh")
+    postInstall file("$buildRoot/scripts/postin_javac.sh")
+    preUninstall file("$buildRoot/scripts/preun_java.sh")
+    preUninstall file("$buildRoot/scripts/preun_javac.sh")
+
+    requires('zlib')
+
+    provides(jdkPackageName, "${epoch}:${version}-${release}", EQUAL)
+    provides("java", "${epoch}:${version}-${release}", EQUAL)
+    provides("java-${project.version.major}-devel", "${epoch}:${version}", EQUAL)
+    provides("java-${project.version.major}-openjdk-devel", "${epoch}:${version}", EQUAL)
+    provides("java-${project.version.major}-openjdk-devel", "${epoch}:${version}-${release}", EQUAL)
+    provides("java-sdk-${project.version.major}", "${epoch}:${version}", EQUAL)
+    provides("java-sdk-${project.version.major}-openjdk", "${epoch}:${version}-${release}", EQUAL)
+    provides("java-${project.version.major}", "${epoch}:${version}", EQUAL)
+    provides("java-${project.version.major}-openjdk", "${epoch}:${version}", EQUAL)
+    provides("jre", "${epoch}:${version}", EQUAL)
+    provides("jre-${project.version.major}", "${epoch}:${version}", EQUAL)
+    provides("jre-${project.version.major}-openjdk", "${epoch}:${version}", EQUAL)
+
+    from(jdkBinaryDir) {
+        include(project.configurationFiles)
+        fileType CONFIG | NOREPLACE
+        into jdkHome
+    }
+
+    from(jdkBinaryDir) {
+        into jdkHome
+        exclude 'legal'
+        exclude(project.configurationFiles)
+    }
+
+    // Copy legal directory specifically to set permission correctly.
+    // See https://github.com/corretto/corretto-11/issues/129
+    from("${jdkBinaryDir}/legal") {
+        into "${jdkHome}/legal"
+        fileMode = 0444
+    }
+
+    if (!project.excludeReadmeJavaSE) {
+        from("${jdkBinaryDir}/README.JAVASE") {
+            into jdkHome
+            fileMode = 0444
+        }
+    }   
+}
+
+artifacts {
+    archives generateJdkRpm
+}
diff a/installers/linux/universal/rpm/scripts/postin_java.sh.template b/installers/linux/universal/rpm/scripts/postin_java.sh.template
--- /dev/null
+++ b/installers/linux/universal/rpm/scripts/postin_java.sh.template
@@ -0,0 +1,17 @@
+if [ $1 -eq 1 ] ; then
+     alternatives --install /usr/bin/java java ${RPM_INSTALL_PREFIX}/bin/java @alternatives_priority@ \
+                  --slave /usr/lib/jvm/jre jre ${RPM_INSTALL_PREFIX} \
+                  --slave /usr/bin/jjs jjs ${RPM_INSTALL_PREFIX}/bin/jjs \
+                  --slave /usr/bin/keytool keytool ${RPM_INSTALL_PREFIX}/bin/keytool \
+                  --slave /usr/bin/pack200 pack200 ${RPM_INSTALL_PREFIX}/bin/pack200 \
+                  --slave /usr/bin/rmid rmid ${RPM_INSTALL_PREFIX}/bin/rmid \
+                  --slave /usr/bin/rmiregistry rmiregistry ${RPM_INSTALL_PREFIX}/bin/rmiregistry \
+                  --slave /usr/bin/unpack200 unpack200 ${RPM_INSTALL_PREFIX}/bin/unpack200 \
+                  --slave /usr/share/man/man1/java.1 java.1 ${RPM_INSTALL_PREFIX}/man/man1/java.1 \
+                  --slave /usr/share/man/man1/jjs.1 jjs.1 ${RPM_INSTALL_PREFIX}/man/man1/jjs.1 \
+                  --slave /usr/share/man/man1/keytool.1 keytool.1 ${RPM_INSTALL_PREFIX}/man/man1/keytool.1 \
+                  --slave /usr/share/man/man1/pack200.1 pack200.1 ${RPM_INSTALL_PREFIX}/man/man1/pack200.1 \
+                  --slave /usr/share/man/man1/rmid.1 rmid.1 ${RPM_INSTALL_PREFIX}/man/man1/rmid.1 \
+                  --slave /usr/share/man/man1/rmiregistry.1 rmiregistry.1 ${RPM_INSTALL_PREFIX}/man/man1/rmiregistry.1 \
+                  --slave /usr/share/man/man1/unpack200.1 unpack200.1 ${RPM_INSTALL_PREFIX}/man/man1/unpack200.1
+fi
diff a/installers/linux/universal/rpm/scripts/postin_javac.sh.template b/installers/linux/universal/rpm/scripts/postin_javac.sh.template
--- /dev/null
+++ b/installers/linux/universal/rpm/scripts/postin_javac.sh.template
@@ -0,0 +1,46 @@
+if [ $1 -eq 1 ] ; then
+    alternatives --install /usr/bin/javac javac ${RPM_INSTALL_PREFIX}/bin/javac @alternatives_priority@ \
+                 --slave /usr/lib/jvm/java java_sdk ${RPM_INSTALL_PREFIX} \
+                 --slave /usr/bin/jaotc jaotc ${RPM_INSTALL_PREFIX}/bin/jaotc \
+                 --slave /usr/bin/jlink jlink ${RPM_INSTALL_PREFIX}/bin/jlink \
+                 --slave /usr/bin/jmod jmod ${RPM_INSTALL_PREFIX}/bin/jmod \
+                 --slave /usr/bin/jhsdb jhsdb ${RPM_INSTALL_PREFIX}/bin/jhsdb \
+                 --slave /usr/bin/jar jar ${RPM_INSTALL_PREFIX}/bin/jar \
+                 --slave /usr/bin/jarsigner jarsigner ${RPM_INSTALL_PREFIX}/bin/jarsigner \
+                 --slave /usr/bin/javadoc javadoc ${RPM_INSTALL_PREFIX}/bin/javadoc \
+                 --slave /usr/bin/javap javap ${RPM_INSTALL_PREFIX}/bin/javap \
+                 --slave /usr/bin/jcmd jcmd ${RPM_INSTALL_PREFIX}/bin/jcmd \
+                 --slave /usr/bin/jconsole jconsole ${RPM_INSTALL_PREFIX}/bin/jconsole \
+                 --slave /usr/bin/jdb jdb ${RPM_INSTALL_PREFIX}/bin/jdb \
+                 --slave /usr/bin/jdeps jdeps ${RPM_INSTALL_PREFIX}/bin/jdeps \
+                 --slave /usr/bin/jdeprscan jdeprscan ${RPM_INSTALL_PREFIX}/bin/jdeprscan \
+                 --slave /usr/bin/jimage jimage ${RPM_INSTALL_PREFIX}/bin/jimage \
+                 --slave /usr/bin/jinfo jinfo ${RPM_INSTALL_PREFIX}/bin/jinfo \
+                 --slave /usr/bin/jmap jmap ${RPM_INSTALL_PREFIX}/bin/jmap \
+                 --slave /usr/bin/jps jps ${RPM_INSTALL_PREFIX}/bin/jps \
+                 --slave /usr/bin/jrunscript jrunscript ${RPM_INSTALL_PREFIX}/bin/jrunscript \
+                 --slave /usr/bin/jshell jshell ${RPM_INSTALL_PREFIX}/bin/jshell \
+                 --slave /usr/bin/jstack jstack ${RPM_INSTALL_PREFIX}/bin/jstack \
+                 --slave /usr/bin/jstat jstat ${RPM_INSTALL_PREFIX}/bin/jstat \
+                 --slave /usr/bin/jstatd jstatd ${RPM_INSTALL_PREFIX}/bin/jstatd \
+                 --slave /usr/bin/rmic rmic ${RPM_INSTALL_PREFIX}/bin/rmic \
+                 --slave /usr/bin/serialver serialver ${RPM_INSTALL_PREFIX}/bin/serialver \
+                 --slave /usr/share/man/man1/jar.1 jar.1 ${RPM_INSTALL_PREFIX}/man/man1/jar.1 \
+                 --slave /usr/share/man/man1/jarsigner.1 jarsigner.1 ${RPM_INSTALL_PREFIX}/man/man1/jarsigner.1 \
+                 --slave /usr/share/man/man1/javac.1 javac.1 ${RPM_INSTALL_PREFIX}/man/man1/javac.1 \
+                 --slave /usr/share/man/man1/javadoc.1 javadoc.1 ${RPM_INSTALL_PREFIX}/man/man1/javadoc.1 \
+                 --slave /usr/share/man/man1/javap.1 javap.1 ${RPM_INSTALL_PREFIX}/man/man1/javap.1 \
+                 --slave /usr/share/man/man1/jcmd.1 jcmd.1 ${RPM_INSTALL_PREFIX}/man/man1/jcmd.1 \
+                 --slave /usr/share/man/man1/jconsole.1 jconsole.1 ${RPM_INSTALL_PREFIX}/man/man1/jconsole.1 \
+                 --slave /usr/share/man/man1/jdb.1 jdb.1 ${RPM_INSTALL_PREFIX}/man/man1/jdb.1 \
+                 --slave /usr/share/man/man1/jdeps.1 jdeps.1 ${RPM_INSTALL_PREFIX}/man/man1/jdeps.1 \
+                 --slave /usr/share/man/man1/jinfo.1 jinfo.1 ${RPM_INSTALL_PREFIX}/man/man1/jinfo.1 \
+                 --slave /usr/share/man/man1/jmap.1 jmap.1 ${RPM_INSTALL_PREFIX}/man/man1/jmap.1 \
+                 --slave /usr/share/man/man1/jps.1 jps.1 ${RPM_INSTALL_PREFIX}/man/man1/jps.1 \
+                 --slave /usr/share/man/man1/jrunscript.1 jrunscript.1 ${RPM_INSTALL_PREFIX}/man/man1/jrunscript.1 \
+                 --slave /usr/share/man/man1/jstack.1 jstack.1 ${RPM_INSTALL_PREFIX}/man/man1/jstack.1 \
+                 --slave /usr/share/man/man1/jstat.1 jstat.1 ${RPM_INSTALL_PREFIX}/man/man1/jstat.1 \
+                 --slave /usr/share/man/man1/jstatd.1 jstatd.1 ${RPM_INSTALL_PREFIX}/man/man1/jstatd.1 \
+                 --slave /usr/share/man/man1/rmic.1 rmic.1 ${RPM_INSTALL_PREFIX}/man/man1/rmic.1 \
+                 --slave /usr/share/man/man1/serialver.1 serialver.1 ${RPM_INSTALL_PREFIX}/man/man1/serialver.1 
+fi
diff a/installers/linux/universal/rpm/scripts/preun_java.sh.template b/installers/linux/universal/rpm/scripts/preun_java.sh.template
--- /dev/null
+++ b/installers/linux/universal/rpm/scripts/preun_java.sh.template
@@ -0,0 +1,3 @@
+if [ $1 -eq 0 ] ; then
+    alternatives --remove java ${RPM_INSTALL_PREFIX}/bin/java
+fi
diff a/installers/linux/universal/rpm/scripts/preun_javac.sh.template b/installers/linux/universal/rpm/scripts/preun_javac.sh.template
--- /dev/null
+++ b/installers/linux/universal/rpm/scripts/preun_javac.sh.template
@@ -0,0 +1,3 @@
+if [ $1 -eq 0 ] ; then
+    alternatives --remove javac ${RPM_INSTALL_PREFIX}/bin/javac
+fi
diff a/installers/linux/universal/tar/build.gradle b/installers/linux/universal/tar/build.gradle
--- /dev/null
+++ b/installers/linux/universal/tar/build.gradle
@@ -0,0 +1,201 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+dependencies {
+    compile project(path: ':openjdksrc', configuration: 'archives')
+    compile project(path: ':prebuild', configuration: 'cacerts')
+}
+
+if (project.correttoArch == 'x86') {
+    project.correttoCommonFlags += '--with-target-bits=32'
+}
+
+def imageDir = "$buildRoot/build/${project.jdkImageName}/images"
+def jdkResultingImage = "${imageDir}/jdk"
+def testResultingImage = "${imageDir}/test"
+
+// deps
+def depsMap = [:]
+project.configurations.compile.getFiles().each { depsMap[it.getName()] = it }
+/**
+ * Create a local copy of the source tree in our
+ * build root -- this is required since OpenJDK's
+ * build wants to occur inside the source tree,
+ * and we don't want to tamper with someone
+ * else's tree.
+ */
+task copySource(type: Exec) {
+    if (!file(buildRoot).exists()) {
+        file(buildRoot).mkdirs()
+    }
+    workingDir '/usr/bin'
+    commandLine 'rsync', '-am',
+            '--exclude=pre-build',
+            '--exclude=installers',
+            '--exclude=corretto-build',
+            "${project.rootDir}/", buildRoot
+}
+
+/**
+ * Scan the patches folder for any .patch that needs
+ * to be applied before start building.
+ */
+task applyPatches() {
+    dependsOn copySource
+    doLast {
+        fileTree('patches').matching {
+            include '*.patch'
+        }.each { f ->
+            ant.patch(patchfile: f, dir: "$buildRoot", strip: 0)
+        }
+    }
+}
+
+task configureBuild(type: Exec) {
+    dependsOn project.configurations.compile
+    dependsOn applyPatches
+    workingDir "$buildRoot"
+
+    // Platform specific flags
+    def command = ['bash', 'configure',
+            "--with-cacerts-file=${depsMap[caCerts]}",
+            "--with-zlib=system"
+    ]
+    // Common flags
+    command += project.correttoCommonFlags
+    commandLine command.flatten()
+
+}
+
+task executeBuild(type: Exec) {
+    dependsOn configureBuild
+    workingDir "$buildRoot"
+    commandLine 'make', 'images'
+    outputs.dir jdkResultingImage
+}
+
+task createTestImage(type: Exec) {
+    dependsOn executeBuild
+    workingDir "$buildRoot"
+    commandLine 'make','test-image'
+}
+
+task bundleThirdPartyBinaries {
+    dependsOn executeBuild
+    doLast {
+        // If property set, copy async profiler binaries to bundle
+        if (project.asyncProfilerBinariesPath != "") {
+            if (!file(project.asyncProfilerBinariesPath).isDirectory()) {
+                throw new GradleException("asyncProfilerBinariesPath is not a valid directory: ${project.asyncProfilerBinariesPath}")
+            }
+            copy {
+                from project.asyncProfilerBinariesPath
+                include 'bin/**', 'lib/**'
+                into jdkResultingImage
+            }
+            copy {
+                from project.asyncProfilerLegal
+                into "${jdkResultingImage}/legal"
+            }
+        }
+    }
+}
+
+task fixCrossCompileLinking(type: Exec) {
+    dependsOn createTestImage
+    /* When cross-compiling for aarch64, gcc incorrectly links against
+     * libz.so, provided by the -devel packages, instead of libz.so.1
+     * This can lead to runtime errors of the form
+     * javac: error while loading shared libraries: libz.so: cannot open shared object file: No such file or directory
+     * As a workaround, use patchelf to update all references to libz.so to the expected libz.so.1
+     *
+     * See also:
+     * - https://github.com/AppImage/AppImageKit/issues/964
+     * - https://github.com/AppImage/AppImageKit/issues/1092
+     * - https://github.com/electron-userland/electron-builder/issues/7835
+     * - https://github.com/CollaboraOnline/richdocumentscode/issues/68
+     * - https://github.com/Sienci-Labs/gsender/issues/420
+     */
+    if (project.hasProperty("corretto.crossCompile")) {
+        commandLine 'bash', '-c', "find ${imageDir} -type f -exec patchelf --replace-needed libz.so libz.so.1 {} \\; 2>/dev/null"
+    } else {
+        commandLine 'bash', '-c', "echo 'Not a cross-compiled build, no linker fixup required'"
+    }
+}
+
+task packageTestImage(type: Tar) {
+    dependsOn fixCrossCompileLinking
+    description = 'Package test results'
+    archiveFileName = "${project.correttoTestImageArchiveName}.tar.gz"
+    compression = Compression.GZIP
+    from(testResultingImage) {
+        include '**'
+    }
+    into project.correttoTestImageArchiveName
+}
+
+task packageDebugSymbols(type: Tar) {
+    description = 'Package debug results'
+    dependsOn packageTestImage
+    archiveFileName = "${project.correttoDebugSymbolsArchiveName}.tar.gz"
+    compression = Compression.GZIP
+    from(jdkResultingImage) {
+        include 'bin/*.diz'
+        include 'lib/*.diz'
+        include 'lib/server/*.diz'
+        into project.correttoDebugSymbolsArchiveName
+    }
+}
+
+task packageBuildResults(type: Tar) {
+    description = 'Compresses the JDK image and puts the results in build/distributions.'
+    dependsOn packageDebugSymbols
+    dependsOn bundleThirdPartyBinaries
+    archiveFileName = "${project.correttoJdkArchiveName}.tar.gz"
+    compression = Compression.GZIP
+    from(buildRoot) {
+        include project.rootFiles
+        into project.correttoJdkArchiveName
+    }
+    from(jdkResultingImage) {
+        include 'bin/**'
+        include 'conf/**'
+        include 'include/**'
+        include 'jmods/**'
+        include 'lib/**'
+        include 'man/man1/**'
+        include 'release'
+        exclude '**/*.diz'
+        into project.correttoJdkArchiveName
+    }
+
+    // Copy legal directory specifically to set permission correctly.
+    // See https://github.com/corretto/corretto-11/issues/129
+    from("${jdkResultingImage}/legal") {
+        include '**'
+        fileMode = 0444
+        into "${project.correttoJdkArchiveName}/legal"
+    }
+}
+
+artifacts {
+    archives packageBuildResults
+}
diff a/installers/linux/universal/tar/patches/zlib.patch b/installers/linux/universal/tar/patches/zlib.patch
--- /dev/null
+++ b/installers/linux/universal/tar/patches/zlib.patch
@@ -0,0 +1,149 @@
+This patch is applied to disable implicit-fallthrough warnings on gcc7 or
+higher when building the bundled version of zlib.
+
+diff --git src/java.base/share/native/libzip/zlib/infback.c src/java.base/share/native/libzip/zlib/infback.c
+index 4c8283909..1a9cc6b60 100644
+--- src/java.base/share/native/libzip/zlib/infback.c
++++ src/java.base/share/native/libzip/zlib/infback.c
+@@ -501,7 +501,7 @@ void FAR *out_desc;
+             }
+             Tracev((stderr, "inflate:       codes ok\n"));
+             state->mode = LEN;
+-
++            /* FALLTHROUGH */
+         case LEN:
+             /* use inflate_fast() if we have enough input and output */
+             if (have >= 6 && left >= 258) {
+diff --git src/java.base/share/native/libzip/zlib/inflate.c src/java.base/share/native/libzip/zlib/inflate.c
+index ca904e744..4abfe84a5 100644
+--- src/java.base/share/native/libzip/zlib/inflate.c
++++ src/java.base/share/native/libzip/zlib/inflate.c
+@@ -764,6 +764,7 @@ int flush;
+                 CRC2(state->check, hold);
+             INITBITS();
+             state->mode = EXLEN;
++            /* FALLTHROUGH */
+         case EXLEN:
+             if (state->flags & 0x0400) {
+                 NEEDBITS(16);
+@@ -777,6 +778,7 @@ int flush;
+             else if (state->head != Z_NULL)
+                 state->head->extra = Z_NULL;
+             state->mode = EXTRA;
++            /* FALLTHROUGH */
+         case EXTRA:
+             if (state->flags & 0x0400) {
+                 copy = state->length;
+@@ -799,6 +801,7 @@ int flush;
+             }
+             state->length = 0;
+             state->mode = NAME;
++            /* FALLTHROUGH */
+         case NAME:
+             if (state->flags & 0x0800) {
+                 if (have == 0) goto inf_leave;
+@@ -820,6 +823,7 @@ int flush;
+                 state->head->name = Z_NULL;
+             state->length = 0;
+             state->mode = COMMENT;
++            /* FALLTHROUGH */
+         case COMMENT:
+             if (state->flags & 0x1000) {
+                 if (have == 0) goto inf_leave;
+@@ -840,6 +844,7 @@ int flush;
+             else if (state->head != Z_NULL)
+                 state->head->comment = Z_NULL;
+             state->mode = HCRC;
++            /* FALLTHROUGH */
+         case HCRC:
+             if (state->flags & 0x0200) {
+                 NEEDBITS(16);
+@@ -863,6 +868,7 @@ int flush;
+             strm->adler = state->check = ZSWAP32(hold);
+             INITBITS();
+             state->mode = DICT;
++            /* FALLTHROUGH */
+         case DICT:
+             if (state->havedict == 0) {
+                 RESTORE();
+@@ -870,8 +876,10 @@ int flush;
+             }
+             strm->adler = state->check = adler32(0L, Z_NULL, 0);
+             state->mode = TYPE;
++            /* FALLTHROUGH */
+         case TYPE:
+             if (flush == Z_BLOCK || flush == Z_TREES) goto inf_leave;
++            /* FALLTHROUGH */
+         case TYPEDO:
+             if (state->last) {
+                 BYTEBITS();
+@@ -922,8 +930,10 @@ int flush;
+             INITBITS();
+             state->mode = COPY_;
+             if (flush == Z_TREES) goto inf_leave;
++            /* FALLTHROUGH */
+         case COPY_:
+             state->mode = COPY;
++            /* FALLTHROUGH */
+         case COPY:
+             copy = state->length;
+             if (copy) {
+@@ -1063,8 +1073,10 @@ int flush;
+             Tracev((stderr, "inflate:       codes ok\n"));
+             state->mode = LEN_;
+             if (flush == Z_TREES) goto inf_leave;
++            /* FALLTHROUGH */
+         case LEN_:
+             state->mode = LEN;
++            /* FALLTHROUGH */
+         case LEN:
+             if (have >= 6 && left >= 258) {
+                 RESTORE();
+@@ -1114,6 +1126,7 @@ int flush;
+             }
+             state->extra = (unsigned)(here.op) & 15;
+             state->mode = LENEXT;
++            /* FALLTHROUGH */
+         case LENEXT:
+             if (state->extra) {
+                 NEEDBITS(state->extra);
+@@ -1124,6 +1137,7 @@ int flush;
+             Tracevv((stderr, "inflate:         length %u\n", state->length));
+             state->was = state->length;
+             state->mode = DIST;
++            /* FALLTHROUGH */
+         case DIST:
+             for (;;) {
+                 here = state->distcode[BITS(state->distbits)];
+@@ -1151,6 +1165,7 @@ int flush;
+             state->offset = (unsigned)here.val;
+             state->extra = (unsigned)(here.op) & 15;
+             state->mode = DISTEXT;
++            /* FALLTHROUGH */
+         case DISTEXT:
+             if (state->extra) {
+                 NEEDBITS(state->extra);
+@@ -1167,6 +1182,7 @@ int flush;
+ #endif
+             Tracevv((stderr, "inflate:         distance %u\n", state->offset));
+             state->mode = MATCH;
++            /* FALLTHROUGH */
+         case MATCH:
+             if (left == 0) goto inf_leave;
+             copy = out - left;
+@@ -1242,6 +1258,7 @@ int flush;
+             }
+ #ifdef GUNZIP
+             state->mode = LENGTH;
++            /* FALLTHROUGH */
+         case LENGTH:
+             if (state->wrap && state->flags) {
+                 NEEDBITS(32);
+@@ -1255,6 +1272,7 @@ int flush;
+             }
+ #endif
+             state->mode = DONE;
++            /* FALLTHROUGH */
+         case DONE:
+             ret = Z_STREAM_END;
+             goto inf_leave;
diff a/installers/mac/pkg/README.md b/installers/mac/pkg/README.md
--- /dev/null
+++ b/installers/mac/pkg/README.md
@@ -0,0 +1,26 @@
+### Instruction for generating Amazon Corretto installer
+
+#### Prerequisites
+
+The generation of the Corretto installer depends on an open-source utility tool [Packages](http://s.sudre.free.fr/Software/Packages/about.html).
+The application must be installed before running the installer generation task.
+
+There are two options to generate a Corretto installer.
+
+#### Option 1: Build Corretto
+* Under the root directory of the repository, run
+```
+./gradlew :installers:mac:pkg:generateInstaller
+```
+
+#### Option 2: Use pre-built Corretto artifacts
+* Set the environment variable "CORRETTO_ARTIFACTS_PATH" to the path of the pre-built Corretto artifacts.
+```
+export CORRETTO_ARTIFACTS_PATH=.../path/to/amazon-corretto-<version>.jdk
+```
+* Under the root directory of the repository, run
+```
+./gradlew :installers:mac:pkg:generateInstaller
+```
+
+The installer will be generated under "<repo-root>/installers/mac/pkg/corretto-build/distributions".
diff a/installers/mac/pkg/build.gradle b/installers/mac/pkg/build.gradle
--- /dev/null
+++ b/installers/mac/pkg/build.gradle
@@ -0,0 +1,122 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+dependencies {
+    compile project(path: ':installers:mac:tar', configuration: 'buildTar')
+}
+
+// Copy task cannot be used here because Gradle does not preserve the symlink
+task retrieveArtifacts(type: Exec) {
+    // Set environment variable CORRETTO_ARTIFACTS_PATH to the path of "amazon-corretto-<version>.jdk" to be packaged
+    def artifactsPath = System.getenv("CORRETTO_ARTIFACTS_PATH")
+    workingDir buildRoot
+    if (artifactsPath == null) {
+        dependsOn project.configurations.compile
+        commandLine "tar", "xf", project.configurations.compile.singleFile
+    } else {
+        commandLine "cp", "-Rf", "${artifactsPath}", buildRoot
+    }
+}
+
+task copyResources(type: Copy) {
+    from "."
+    include 'resources/**'
+    into buildRoot
+}
+
+task inflatePkgTemplate {
+    dependsOn copyResources
+    doLast {
+        copy {
+            from('templates/distribution.xml.template') {
+                rename { file -> file.replace('.template', '') }
+                filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: ["full": project.version.full, "major": project.version.major, "macos-arch": (correttoArch == "aarch64" ? "arm64" : "x86_64")])
+            }
+            into "${buildRoot}/resources"
+        }
+
+        copy {
+            from('templates/introduction.html.template') {
+                rename { file -> file.replace('.template', '') }
+                filter(org.apache.tools.ant.filters.ReplaceTokens, tokens: project.version)
+            }
+            into "${buildRoot}/resources"
+        }
+    }
+}
+
+task setupDirectories {
+    dependsOn retrieveArtifacts
+    doLast {
+        exec {
+            workingDir buildRoot
+            commandLine "mkdir", "-p", "pkgroot/"
+        }
+
+        exec {
+            workingDir buildRoot
+            commandLine "cp", "-Rf", "amazon-corretto-${project.version.major}.jdk", "pkgroot/"
+        }
+
+        exec {
+            workingDir buildRoot
+            commandLine "mkdir", "-p", "build/components"
+        }
+    }
+}
+
+task generateInstaller {
+    dependsOn retrieveArtifacts
+    dependsOn copyResources
+    dependsOn inflatePkgTemplate
+    dependsOn setupDirectories
+    outputs.dir distributionDir
+
+    doLast {
+        exec {
+            workingDir buildRoot
+            commandLine "pkgbuild",
+                "--root", "pkgroot",
+                "--identifier", "com.amazon.corretto.${project.version.major}",
+                "--version", project.version.full,
+                "--ownership", "recommended",
+                "--scripts", "resources",
+                "--install-location", "/Library/Java/JavaVirtualMachines/",
+                "build/components/amazon-corretto-${project.version.major}.jdk.pkg"
+        }
+
+        exec {
+            workingDir buildRoot
+            commandLine "productbuild",
+            "--distribution", "resources/distribution.xml",
+            "--resources", "resources",
+            "--package-path", "build/components",
+            "--version", project.version.full,
+            "${distributionDir}/amazon-corretto-${project.version.full}-macosx-${correttoArch}.pkg"
+        }
+    }
+}
+
+build.dependsOn generateInstaller
+
+artifacts {
+    archives file: generateInstaller.outputs.getFiles().getSingleFile(), builtBy: generateInstaller
+}
diff a/installers/mac/pkg/resources/amazon.png b/installers/mac/pkg/resources/amazon.png
Binary files /dev/null and installers/mac/pkg/resources/amazon.png differ
diff a/installers/mac/pkg/resources/preinstall b/installers/mac/pkg/resources/preinstall
--- /dev/null
+++ b/installers/mac/pkg/resources/preinstall
@@ -0,0 +1,9 @@
+#!/bin/bash
+JDK_INSTALL_PATH="/Library/Java/JavaVirtualMachines"
+MKDIR=`which mkdir`
+
+if [[ ! -d ${JDK_INSTALL_PATH} ]]; then
+	${MKDIR} -p ${JDK_INSTALL_PATH}
+fi
+
+exit 0
diff a/installers/mac/pkg/templates/distribution.xml.template b/installers/mac/pkg/templates/distribution.xml.template
--- /dev/null
+++ b/installers/mac/pkg/templates/distribution.xml.template
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<installer-gui-script minSpecVersion="1.0">
+    <options rootVolumeOnly="true" hostArchitectures="@macos-arch@"/>
+    <!--+==========================+
+        |       Presentation       |
+        +==========================+-->
+    <title>Amazon Corretto @major@</title>
+    <background file="amazon.png" scaling="proportional" alignment="bottomleft"/>
+    <background-darkAqua file="amazon.png" scaling="proportional" alignment="bottomleft"/>
+    <welcome file="introduction.html"/>
+    <!--+==========================+
+        |         Installer        |
+        +==========================+-->
+    <choices-outline>
+        <line choice="installer_choice_1"/>
+    </choices-outline>
+    <choice id="installer_choice_1" title="amazon-corretto-@major@.jdk" description="">
+        <pkg-ref id="com.amazon.corretto.@major@"/>
+    </choice>
+    <!--+==========================+
+        |    Package References    |
+        +==========================+-->
+    <pkg-ref id="com.amazon.corretto.@major@" version="@full@" auth="root" customLocation="/Library/Java/JavaVirtualMachines/amazon-corretto-@major@.jdk">amazon-corretto-@major@.jdk.pkg</pkg-ref>
+</installer-gui-script>
diff a/installers/mac/pkg/templates/introduction.html.template b/installers/mac/pkg/templates/introduction.html.template
--- /dev/null
+++ b/installers/mac/pkg/templates/introduction.html.template
@@ -0,0 +1,86 @@
+<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><style>@font-face {
+  font-family: octicons-anchor;
+  src: url(https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/font/octicons.woff) format('woff');
+}
+
+body {
+    width: 980px;
+    margin-right: auto;
+    margin-left: auto;
+}
+
+body .markdown-body {
+    padding: 45px;
+    border: 1px solid #ddd;
+    border-radius: 3px;
+    word-wrap: break-word;
+}
+
+
+.markdown-body {
+  -webkit-text-size-adjust: 100%;
+  text-size-adjust: 100%;
+  color: #333;
+  font-family: "Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
+  font-size: 16px;
+  line-height: 1.6;
+  word-wrap: break-word;
+}
+
+.markdown-body .octicon {
+  font: normal normal normal 16px/1 octicons-anchor;
+  display: inline-block;
+  text-decoration: none;
+  text-rendering: auto;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+
+.markdown-body .octicon-link:before {
+  content: '\f05c';
+}
+
+.markdown-body>*:first-child {
+  margin-top: 0 !important;
+}
+
+.markdown-body .anchor {
+  display: inline-block;
+  padding-right: 2px;
+  margin-left: -18px;
+}
+
+.markdown-body .anchor:focus {
+  outline: none;
+}
+
+.markdown-body h3 {
+  margin-top: 1em;
+  margin-bottom: 16px;
+  font-weight: bold;
+  line-height: 1.4;
+}
+
+.markdown-body h3 .octicon-link {
+  color: #000;
+  vertical-align: middle;
+  visibility: hidden;
+}
+
+.markdown-body h3 {
+  font-size: 1.5em;
+  line-height: 1.43;
+}
+
+.markdown-body h3 .anchor {
+  line-height: 1.2;
+}
+
+</style><title>introduction</title></head><body><article class="markdown-body"><h3>
+<a class="anchor" aria-hidden="true"><span aria-hidden="true" class="octicon octicon-link"></span></a>Amazon Corretto @major@ Installer</h3>
+<p>You will be guided through the steps necessary to install Amazon Corretto @full@.</p>
+</article></body></html>
diff a/installers/mac/tar/build.gradle b/installers/mac/tar/build.gradle
--- /dev/null
+++ b/installers/mac/tar/build.gradle
@@ -0,0 +1,208 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+dependencies {
+    compile project(path: ':openjdksrc', configuration: 'archives')
+    compile project(path: ':prebuild', configuration: 'cacerts')
+}
+
+// Two configurations for tgz & Jtreg native library respectively.
+// Separate artifacts to simplify the artifacts fetching in :mac:pkg.
+configurations {
+    buildTar
+    testLib
+}
+// consts
+def imageDir= "$buildRoot/build/${project.jdkImageName}/images"
+def jdkResultingImage = "${imageDir}/jdk-bundle"
+def testResultingImage = "${imageDir}/test"
+def correttoMacDir = "amazon-corretto-${project.version.major}.jdk"
+
+// deps
+def depsMap = [:]
+project.configurations.compile.getFiles().each { depsMap[it.getName()] = it }
+
+/**
+ * Create a local copy of the source tree in our
+ * build root -- this is required since OpenJDK's
+ * build wants to occur inside the source tree,
+ * and we don't want to tamper with someone
+ * else's tree.
+ */
+task copySource(type: Exec) {
+    if (!file(buildRoot).exists()) {
+        file(buildRoot).mkdirs()
+    }
+    workingDir '/usr/bin'
+    commandLine 'rsync', '-am',
+            '--exclude=pre-build',
+            '--exclude=installers',
+            '--exclude=corretto-build',
+            "${project.rootDir}/", buildRoot
+}
+
+task configureBuild(type: Exec) {
+    dependsOn project.configurations.compile
+    dependsOn copySource
+    workingDir "$buildRoot"
+
+    // Platform specific flags
+    def command = ['bash', 'configure',
+            "--with-cacerts-file=${depsMap[caCerts]}"
+    ]
+    if (project.correttoArch == "aarch64") {
+        command += "--with-zlib=bundled"
+    }
+    // Common flags
+    command += project.correttoCommonFlags
+    commandLine command.flatten()
+}
+
+task executeBuild(type: Exec) {
+    dependsOn configureBuild
+    workingDir "$buildRoot"
+    commandLine 'make', 'images'
+}
+
+task executeTestBuild(type: Exec) {
+    dependsOn executeBuild
+    workingDir "$buildRoot"
+    commandLine 'make','test-image'
+}
+
+task prepareArtifacts {
+    dependsOn executeBuild
+    doLast {
+        if(file("${jdkResultingImage}/${correttoMacDir}").exists()) {
+            delete "${jdkResultingImage}/${correttoMacDir}"
+        }
+        // Rename bundle
+        exec {
+            workingDir jdkResultingImage
+            commandLine 'bash', '-c', "\"\"mv jdk-${version.major}*.jdk ${correttoMacDir}\"\""
+        }
+
+        // Replace Info.plist
+        def plistTokens = new Properties()
+        plistTokens["INFO"] = "Amazon Corretto ${project.version.full}-${versionOpt}".toString()
+        plistTokens["ID"] = "com.amazon.corretto.${project.version.major}".toString()
+        plistTokens["NAME"] = "Amazon Corretto ${project.version.major}".toString()
+        plistTokens["VERSION"] = "${project.version.major}.${project.version.minor}.${project.version.security}".toString()
+        plistTokens["BUILD_VERSION"] = "${project.version.full}".toString()
+        plistTokens["MACOSX_VERSION_MIN"] = (correttoArch == "x64" ? "10.12" : "11.0")
+        plistTokens["VENDOR"] = "Amazon.com Inc."
+
+        copy {
+            from("${rootDir}/make/data/bundle/JDK-Info.plist.template") {
+                rename { file -> 'Info.plist' }
+                filter(org.apache.tools.ant.filters.ReplaceTokens, beginToken: "@@", endToken: "@@", tokens: plistTokens)
+            }
+            into "${jdkResultingImage}/${correttoMacDir}/Contents"
+        }
+
+        // If property set, copy async profiler binaries to bundle
+        if (project.asyncProfilerBinariesPath != "") {
+            if (!file(project.asyncProfilerBinariesPath).isDirectory()) {
+                throw new GradleException("asyncProfilerBinariesPath is not a valid directory: ${project.asyncProfilerBinariesPath}")
+            }
+            copy {
+                from project.asyncProfilerBinariesPath
+                include 'bin/**', 'lib/**'
+                into "${jdkResultingImage}/${correttoMacDir}/Contents/Home"
+            }
+            copy {
+                from project.asyncProfilerLegal
+                into "${jdkResultingImage}/${correttoMacDir}/Contents/Home/legal"
+            }
+        }
+
+        // Filter files
+        if(file("${buildDir}/${correttoMacDir}").exists()) {
+            delete "${buildDir}/${correttoMacDir}"
+        }
+        copy {
+            from("${jdkResultingImage}/${correttoMacDir}") {
+                include "Contents/Home/bin/**"
+                include "Contents/Home/conf/**"
+                include "Contents/Home/include/**"
+                include "Contents/Home/jmods/**"
+                include "Contents/Home/legal/**"
+                include "Contents/Home/lib/**"
+                include "Contents/Home/man/man1/**"
+                include "Contents/Home/release"
+                include "Contents/Info.plist"
+                include "Contents/MacOS/**"
+                exclude "Contents/Home/**/*.diz"
+            }
+            from(buildRoot) {
+                include project.rootFiles
+                into "Contents/Home"
+            }
+            into "${buildDir}/${correttoMacDir}"
+        }
+        // Set the directory as bundle
+        exec {
+            commandLine "SetFile", "-a", "B", "${buildDir}/${correttoMacDir}"
+        }
+    }
+}
+
+task packaging(type: Exec) {
+    dependsOn prepareArtifacts
+    String tarDir = "${distributionDir}/${project.correttoJdkArchiveName}.tar.gz"
+    workingDir buildDir
+    commandLine "tar", "czf", tarDir, correttoMacDir
+    outputs.file tarDir
+}
+
+task packageDebugSymbols(type: Tar) {
+    dependsOn prepareArtifacts
+    description 'Package debug symbols'
+    archiveFileName = "${project.correttoDebugSymbolsArchiveName}.tar.gz"
+    compression Compression.GZIP
+    from("${jdkResultingImage}/${correttoMacDir}") {
+        include "Contents/Home/bin/*.diz"
+        include "Contents/Home/lib/*.diz"
+        include "Contents/Home/lib/server/*.diz"
+    }
+    into "${buildDir}/${correttoMacDir}"
+    into project.correttoDebugSymbolsArchiveName
+}
+
+task packageTestResults(type: Tar) {
+    dependsOn executeTestBuild
+    description 'Package test results'
+    archiveFileName = "${project.correttoTestImageArchiveName}.tar.gz"
+    compression Compression.GZIP
+    from(testResultingImage) {
+        include '**'
+    }
+    into project.correttoTestImageArchiveName
+}
+
+build.dependsOn packaging
+build.dependsOn packageDebugSymbols
+build.dependsOn packageTestResults
+
+artifacts {
+    buildTar file: packaging.outputs.getFiles().getSingleFile(), builtBy: packaging
+    testLib packageTestResults
+}
diff a/installers/mac/tar/templates/Info.plist.template b/installers/mac/tar/templates/Info.plist.template
--- /dev/null
+++ b/installers/mac/tar/templates/Info.plist.template
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+        <key>CFBundleDevelopmentRegion</key>
+        <string>English</string>
+        <key>CFBundleExecutable</key>
+        <string>libjli.dylib</string>
+        <key>CFBundleGetInfoString</key>
+        <string>Amazon Corretto @full@-LTS</string>
+        <key>CFBundleIdentifier</key>
+        <string>com.amazon.corretto.@major@</string>
+        <key>CFBundleInfoDictionaryVersion</key>
+        <string>7.0</string>
+        <key>CFBundleName</key>
+        <string>Amazon Corretto @major@</string>
+        <key>CFBundlePackageType</key>
+        <string>BNDL</string>
+        <key>CFBundleShortVersionString</key>
+        <string>1.0</string>
+        <key>CFBundleSignature</key>
+        <string>????</string>
+        <key>CFBundleVersion</key>
+        <string>@full@</string>
+        <key>JavaVM</key>
+        <dict>
+                <key>JVMCapabilities</key>
+                <array>
+                        <string>CommandLine</string>
+                </array>
+                <key>JVMMinimumFrameworkVersion</key>
+                <string>13.2.9</string>
+                <key>JVMMinimumSystemVersion</key>
+                <string>10.6.0</string>
+                <key>JVMPlatformVersion</key>
+                <string>@major@.@minor@</string>
+                <key>JVMVendor</key>
+                <string>Amazon.com Inc.</string>
+                <key>JVMVersion</key>
+                <string>@major@.@minor@.@security@</string>
+        </dict>
+</dict>
+</plist>
diff a/installers/windows/README.md b/installers/windows/README.md
--- /dev/null
+++ b/installers/windows/README.md
@@ -0,0 +1,30 @@
+## Instruction of Building Corretto on Windows
+
+Corretto on Windows includes one subproject.
+
+The `:zip` project builds and packages Corretto archive as zip file. Before executing
+this project, you need to provide the following parameters:
+
+```$xslt
+bootjdk_dir         # Path of bootstrap JDK. To build Corretto, a JDK of the same or previous version is required.
+
+ucrt_dll_dir        # Path of ucrt library directory.
+
+jtreg_dir           # Path of Jtreg.
+
+vcruntime_dir       # Path of the latest vcruntime140.dll
+```
+
+To execute this, run: `./gradlew :installers:windows:zip:build` at `corretto-<version>` root directory.
+The zip archive is located at `/installers/windows/zip/corretto-build/distributions`
+
+```$xslt
+➜ ./gradlew :installers:windows:zip:build \
+            -Pbootjdk_dir=... \
+            -Pucrt_dll_dir=... \
+            -Pjtreg_dir=... \
+            -Pvcruntime_dir=...
+➜ tree installers/windows/zip/corretto-build/distributions
+   installers/windows/zip/corretto-build/distributions
+   └── unsigned-jdk-image.zip
+```
diff a/installers/windows/zip/build.gradle b/installers/windows/zip/build.gradle
--- /dev/null
+++ b/installers/windows/zip/build.gradle
@@ -0,0 +1,109 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Amazon designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+dependencies {
+    compile project(path: ':openjdksrc', configuration: 'archives')
+    compile project(path: ':prebuild', configuration: 'cacerts')
+}
+
+def imageDir = "$buildRoot/build/${project.jdkImageName}/images"
+def jdkResultingImage = "${imageDir}/jdk"
+def testResultingImage = "${imageDir}/test"
+
+// deps
+def depsMap = [:]
+project.configurations.compile.getFiles().each { depsMap[it.getName()] = it }
+
+task copySource(type: Copy) {
+    dependsOn project.configurations.compile
+    from tarTree(depsMap[sourceTar])
+    into buildRoot
+}
+
+
+task configureBuild(type: Exec) {
+    dependsOn copySource
+    workingDir buildRoot
+
+    // Platform specific flags
+    def command = ['bash', 'configure',
+           "--with-cacerts-file=${depsMap[caCerts]}",
+           "--with-boot-jdk=${project.getProperty('bootjdk_dir')}",
+           "--with-zlib=bundled"
+    ]
+    // Common flags
+    command += project.correttoCommonFlags
+    commandLine command.flatten()
+}
+
+task executeBuild(type: Exec) {
+    dependsOn configureBuild
+    workingDir buildRoot
+    commandLine 'make', 'images'
+    outputs.dir jdkResultingImage
+}
+
+task createTestImage(type: Exec) {
+    dependsOn executeBuild
+    workingDir "$buildRoot"
+    commandLine 'make','test-image'
+}
+
+task packageTestImage(type: Zip) {
+    dependsOn createTestImage
+    archiveFileName = "${project.correttoTestImageArchiveName}.zip"
+    from(testResultingImage) {
+        include '**'
+    }
+    into project.correttoTestImageArchiveName
+}
+
+task packageDebugSymbols(type: Zip) {
+    dependsOn packageTestImage
+    archiveFileName = "${project.correttoDebugSymbolsArchiveName}.zip"
+
+    from(jdkResultingImage) {
+        include 'bin/*.diz'
+        include 'lib/*.diz'
+        include 'lib/server/*.diz'
+        into project.correttoDebugSymbolsArchiveName
+    }
+}
+
+task packageBuildResults(type: Zip) {
+    dependsOn packageDebugSymbols
+    archiveFileName = "unsigned-jdk-image.zip"
+
+    from(jdkResultingImage) {
+        exclude 'demo'
+        exclude '**/*.diz'
+    }
+
+    from(buildRoot) {
+        include project.rootFiles
+    }
+}
+
+build.dependsOn packageBuildResults
+
+artifacts {
+    archives packageBuildResults
+}
diff a/settings.gradle b/settings.gradle
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,23 @@
+rootProject.name = 'corretto-25'
+
+import org.apache.tools.ant.taskdefs.condition.Os
+
+def subProjects = [':openjdksrc', ':prebuild']
+
+if (Os.isFamily(Os.FAMILY_MAC)) {
+    subProjects += [':installers:mac:pkg',
+                    ':installers:mac:tar']
+} else if (Os.isFamily(Os.FAMILY_UNIX)) {
+    subProjects += [':installers:linux:universal:tar',
+                    ':installers:linux:universal:rpm',
+                    ':installers:linux:universal:deb',
+                    ':installers:linux:al2:spec',
+                    ':installers:linux:alpine:tar']
+} else if (Os.isFamily(Os.FAMILY_WINDOWS)) {
+    subProjects += [':installers:windows:zip']
+}
+
+include subProjects as String[]
+
+project(':openjdksrc').projectDir = file('source')
+project(':prebuild').projectDir = file('pre-build')
diff a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
--- a/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/assembler_aarch64.hpp
@@ -1134,10 +1134,14 @@
 
   void isb() {
     system(0b00, 0b011, 0b00011, SY, 0b110);
   }
 
+  void sb() {
+    system(0b00, 0b011, 0b00011, 0b0000, 0b111);
+  }
+
   void sys(int op1, int CRn, int CRm, int op2,
            Register rt = as_Register(0b11111)) {
     system(0b01, op1, CRn, CRm, op2, rt);
   }
 
diff a/src/hotspot/cpu/aarch64/globals_aarch64.hpp b/src/hotspot/cpu/aarch64/globals_aarch64.hpp
--- a/src/hotspot/cpu/aarch64/globals_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/globals_aarch64.hpp
@@ -115,11 +115,12 @@
           "Value -1 means off.")                                        \
           range(-1, 4096)                                               \
   product(ccstr, OnSpinWaitInst, "yield", DIAGNOSTIC,                   \
           "The instruction to use to implement "                        \
           "java.lang.Thread.onSpinWait()."                              \
-          "Options: none, nop, isb, yield.")                            \
+          "Valid values are: none, nop, isb, yield, sb.")               \
+          constraint(OnSpinWaitInstNameConstraintFunc, AtParse)         \
   product(uint, OnSpinWaitInstCount, 1, DIAGNOSTIC,                     \
           "The number of OnSpinWaitInst instructions to generate."      \
           "It cannot be used with OnSpinWaitInst=none.")                \
           range(1, 99)                                                  \
   product(ccstr, UseBranchProtection, "none",                           \
diff a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
@@ -6798,10 +6798,11 @@
   }
 }
 #endif
 
 void MacroAssembler::spin_wait() {
+  block_comment("spin_wait {");
   for (int i = 0; i < VM_Version::spin_wait_desc().inst_count(); ++i) {
     switch (VM_Version::spin_wait_desc().inst()) {
       case SpinWait::NOP:
         nop();
         break;
@@ -6809,14 +6810,19 @@
         isb();
         break;
       case SpinWait::YIELD:
         yield();
         break;
+      case SpinWait::SB:
+        assert(VM_Version::supports_sb(), "current CPU does not support SB instruction");
+        sb();
+        break;
       default:
         ShouldNotReachHere();
     }
   }
+  block_comment("}");
 }
 
 // Stack frame creation/removal
 
 void MacroAssembler::enter(bool strip_ret_addr) {
diff a/src/hotspot/cpu/aarch64/spin_wait_aarch64.cpp b/src/hotspot/cpu/aarch64/spin_wait_aarch64.cpp
--- /dev/null
+++ b/src/hotspot/cpu/aarch64/spin_wait_aarch64.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#include "spin_wait_aarch64.hpp"
+#include "utilities/debug.hpp"
+
+#include <string.h>
+
+bool SpinWait::supports(const char *name) {
+  return name != nullptr &&
+         (strcmp(name, "nop")   == 0 ||
+          strcmp(name, "isb")   == 0 ||
+          strcmp(name, "yield") == 0 ||
+          strcmp(name, "sb")    == 0 ||
+          strcmp(name, "none")  == 0);
+}
+
+SpinWait::Inst SpinWait::from_name(const char* name) {
+  assert(supports(name), "checked by OnSpinWaitInstNameConstraintFunc");
+
+  if (strcmp(name, "nop") == 0) {
+    return SpinWait::NOP;
+  } else if (strcmp(name, "isb") == 0) {
+    return SpinWait::ISB;
+  } else if (strcmp(name, "yield") == 0) {
+    return SpinWait::YIELD;
+  } else if (strcmp(name, "sb") == 0) {
+    return SpinWait::SB;
+  }
+
+  return SpinWait::NONE;
+}
diff a/src/hotspot/cpu/aarch64/spin_wait_aarch64.hpp b/src/hotspot/cpu/aarch64/spin_wait_aarch64.hpp
--- a/src/hotspot/cpu/aarch64/spin_wait_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/spin_wait_aarch64.hpp
@@ -17,11 +17,10 @@
  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  *
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
- *
  */
 
 #ifndef CPU_AARCH64_SPIN_WAIT_AARCH64_HPP
 #define CPU_AARCH64_SPIN_WAIT_AARCH64_HPP
 
@@ -29,20 +28,26 @@
 public:
   enum Inst {
     NONE = -1,
     NOP,
     ISB,
-    YIELD
+    YIELD,
+    SB
   };
 
 private:
   Inst _inst;
   int _count;
 
+  Inst from_name(const char *name);
+
 public:
-  SpinWait(Inst inst = NONE, int count = 0) : _inst(inst), _count(count) {}
+  SpinWait(Inst inst = NONE, int count = 0) : _inst(inst), _count(inst == NONE ? 0 : count) {}
+  SpinWait(const char *name, int count) : SpinWait(from_name(name), count) {}
 
   Inst inst() const { return _inst; }
   int inst_count() const { return _count; }
+
+  static bool supports(const char *name);
 };
 
 #endif // CPU_AARCH64_SPIN_WAIT_AARCH64_HPP
diff a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.cpp
@@ -49,25 +49,16 @@
 uintptr_t VM_Version::_pac_mask;
 
 SpinWait VM_Version::_spin_wait;
 
 static SpinWait get_spin_wait_desc() {
-  if (strcmp(OnSpinWaitInst, "nop") == 0) {
-    return SpinWait(SpinWait::NOP, OnSpinWaitInstCount);
-  } else if (strcmp(OnSpinWaitInst, "isb") == 0) {
-    return SpinWait(SpinWait::ISB, OnSpinWaitInstCount);
-  } else if (strcmp(OnSpinWaitInst, "yield") == 0) {
-    return SpinWait(SpinWait::YIELD, OnSpinWaitInstCount);
-  } else if (strcmp(OnSpinWaitInst, "none") != 0) {
-    vm_exit_during_initialization("The options for OnSpinWaitInst are nop, isb, yield, and none", OnSpinWaitInst);
+  SpinWait spin_wait(OnSpinWaitInst, OnSpinWaitInstCount);
+  if (spin_wait.inst() == SpinWait::SB && !VM_Version::supports_sb()) {
+    vm_exit_during_initialization("OnSpinWaitInst is SB but current CPU does not support SB instruction");
   }
 
-  if (!FLAG_IS_DEFAULT(OnSpinWaitInstCount) && OnSpinWaitInstCount > 0) {
-    vm_exit_during_initialization("OnSpinWaitInstCount cannot be used for OnSpinWaitInst 'none'");
-  }
-
-  return SpinWait{};
+  return spin_wait;
 }
 
 void VM_Version::initialize() {
   _supports_atomic_getset4 = true;
   _supports_atomic_getadd4 = true;
@@ -230,11 +221,15 @@
     if (FLAG_IS_DEFAULT(UseSIMDForMemoryOps)) {
       FLAG_SET_DEFAULT(UseSIMDForMemoryOps, true);
     }
 
     if (FLAG_IS_DEFAULT(OnSpinWaitInst)) {
-      FLAG_SET_DEFAULT(OnSpinWaitInst, "isb");
+      if (model_is(0xd4f) && VM_Version::supports_sb()) {
+        FLAG_SET_DEFAULT(OnSpinWaitInst, "sb");
+      } else {
+        FLAG_SET_DEFAULT(OnSpinWaitInst, "isb");
+      }
     }
 
     if (FLAG_IS_DEFAULT(OnSpinWaitInstCount)) {
       FLAG_SET_DEFAULT(OnSpinWaitInstCount, 1);
     }
diff a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
--- a/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
+++ b/src/hotspot/cpu/aarch64/vm_version_aarch64.hpp
@@ -129,10 +129,11 @@
     decl(ASIMDHP,       asimdhp,       10)    \
     decl(DCPOP,         dcpop,         16)    \
     decl(SHA3,          sha3,          17)    \
     decl(SHA512,        sha512,        21)    \
     decl(SVE,           sve,           22)    \
+    decl(SB,            sb,            29)    \
     decl(PACA,          paca,          30)    \
     /* flags above must follow Linux HWCAP */ \
     decl(SVEBITPERM,    svebitperm,    27)    \
     decl(SVE2,          sve2,          28)    \
     decl(A53MAC,        a53mac,        31)
diff a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
--- a/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
+++ b/src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
@@ -47,12 +47,14 @@
 #include "runtime/osThread.hpp"
 #include "runtime/safepointMechanism.hpp"
 #include "runtime/sharedRuntime.hpp"
 #include "runtime/stubRoutines.hpp"
 #include "runtime/timer.hpp"
+#include "runtime/vm_version.hpp"
 #include "signals_posix.hpp"
 #include "utilities/align.hpp"
+#include "utilities/debug.hpp"
 #include "utilities/events.hpp"
 #include "utilities/vmError.hpp"
 
 // put OS-includes here
 # include <sys/types.h>
@@ -504,44 +506,36 @@
 static inline void atomic_copy64(const volatile void *src, volatile void *dst) {
   *(jlong *) dst = *(const jlong *) src;
 }
 
 extern "C" {
-  // needs local assembler label '1:' to avoid trouble when using linktime optimization
   int SpinPause() {
     // We don't use StubRoutines::aarch64::spin_wait stub in order to
     // avoid a costly call to os::current_thread_enable_wx() on MacOS.
     // We should return 1 if SpinPause is implemented, and since there
-    // will be a sequence of 11 instructions for NONE and YIELD and 12
-    // instructions for NOP and ISB, SpinPause will always return 1.
-    uint64_t br_dst;
-    const int instructions_per_case = 2;
-    int64_t off = VM_Version::spin_wait_desc().inst() * instructions_per_case * Assembler::instruction_size;
-
-    assert(VM_Version::spin_wait_desc().inst() >= SpinWait::NONE &&
-           VM_Version::spin_wait_desc().inst() <= SpinWait::YIELD, "must be");
-    assert(-1 == SpinWait::NONE,  "must be");
-    assert( 0 == SpinWait::NOP,   "must be");
-    assert( 1 == SpinWait::ISB,   "must be");
-    assert( 2 == SpinWait::YIELD, "must be");
-
-    asm volatile(
-        "  adr  %[d], 20          \n" // 20 == PC here + 5 instructions => address
-                                      // to entry for case SpinWait::NOP
-        "  add  %[d], %[d], %[o]  \n"
-        "  br   %[d]              \n"
-        "  b    1f                \n" // case SpinWait::NONE  (-1)
-        "  nop                    \n" // padding
-        "  nop                    \n" // case SpinWait::NOP   ( 0)
-        "  b    1f                \n"
-        "  isb                    \n" // case SpinWait::ISB   ( 1)
-        "  b    1f                \n"
-        "  yield                  \n" // case SpinWait::YIELD ( 2)
-        "1:        \n"
-        : [d]"=&r"(br_dst)
-        : [o]"r"(off)
-        : "memory");
+    // will be always a sequence of instructions, SpinPause will always return 1.
+    switch (VM_Version::spin_wait_desc().inst()) {
+    case SpinWait::NONE:
+      break;
+    case SpinWait::NOP:
+      asm volatile("nop" : : : "memory");
+      break;
+    case SpinWait::ISB:
+      asm volatile("isb" : : : "memory");
+      break;
+    case SpinWait::YIELD:
+      asm volatile("yield" : : : "memory");
+      break;
+    case SpinWait::SB:
+      assert(VM_Version::supports_sb(), "current CPU does not support SB instruction");
+      asm volatile(".inst 0xd50330ff" : : : "memory");
+      break;
+#ifdef ASSERT
+    default:
+      ShouldNotReachHere();
+#endif
+    }
     return 1;
   }
 
   void _Copy_conjoint_jshorts_atomic(const jshort* from, jshort* to, size_t count) {
     if (from > to) {
diff a/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp b/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp
--- a/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp
+++ b/src/hotspot/os_cpu/bsd_aarch64/vm_version_bsd_aarch64.cpp
@@ -90,10 +90,13 @@
   }
   if (cpu_has("hw.optional.arm.FEAT_SHA3") ||
       cpu_has("hw.optional.armv8_2_sha3")) {
     _features |= CPU_SHA3;
   }
+  if (cpu_has("hw.optional.arm.FEAT_SB")) {
+    _features |= CPU_SB;
+  }
 
   int cache_line_size;
   int hw_conf_cache_line[] = { CTL_HW, HW_CACHELINE };
   sysctllen = sizeof(cache_line_size);
   if (sysctl(hw_conf_cache_line, 2, &cache_line_size, &sysctllen, nullptr, 0)) {
diff a/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp b/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
--- a/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
+++ b/src/hotspot/os_cpu/linux_aarch64/vm_version_linux_aarch64.cpp
@@ -69,10 +69,14 @@
 
 #ifndef HWCAP_SVE
 #define HWCAP_SVE (1 << 22)
 #endif
 
+#ifndef HWCAP_SB
+#define HWCAP_SB (1 << 29)
+#endif
+
 #ifndef HWCAP_PACA
 #define HWCAP_PACA (1 << 30)
 #endif
 
 #ifndef HWCAP_FPHP
@@ -141,10 +145,11 @@
       HWCAP_ATOMICS |
       HWCAP_DCPOP   |
       HWCAP_SHA3    |
       HWCAP_SHA512  |
       HWCAP_SVE     |
+      HWCAP_SB      |
       HWCAP_PACA    |
       HWCAP_FPHP    |
       HWCAP_ASIMDHP);
 
   if (auxv2 & HWCAP2_SVE2) _features |= CPU_SVE2;
diff a/src/hotspot/share/c1/c1_Runtime1.cpp b/src/hotspot/share/c1/c1_Runtime1.cpp
--- a/src/hotspot/share/c1/c1_Runtime1.cpp
+++ b/src/hotspot/share/c1/c1_Runtime1.cpp
@@ -816,11 +816,11 @@
   assert(nm == CodeCache::find_nmethod(caller_frame.pc()), "Should be the same");
   Deoptimization::DeoptAction action = Deoptimization::trap_request_action(trap_request);
   Deoptimization::DeoptReason reason = Deoptimization::trap_request_reason(trap_request);
 
   if (action == Deoptimization::Action_make_not_entrant) {
-    if (nm->make_not_entrant("C1 deoptimize")) {
+    if (nm->make_not_entrant(nmethod::InvalidationReason::C1_DEOPTIMIZE)) {
       if (reason == Deoptimization::Reason_tenured) {
         MethodData* trap_mdo = Deoptimization::get_method_data(current, method, true /*create_if_missing*/);
         if (trap_mdo != nullptr) {
           trap_mdo->inc_tenure_traps();
         }
@@ -1108,11 +1108,11 @@
 
     // It's possible the nmethod was invalidated in the last
     // safepoint, but if it's still alive then make it not_entrant.
     nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
     if (nm != nullptr) {
-      nm->make_not_entrant("C1 code patch");
+      nm->make_not_entrant(nmethod::InvalidationReason::C1_CODEPATCH);
     }
 
     Deoptimization::deoptimize_frame(current, caller_frame.id());
 
     // Return to the now deoptimized frame.
@@ -1356,11 +1356,11 @@
 
   if (is_patching_needed(current, stub_id)) {
     // Make sure the nmethod is invalidated, i.e. made not entrant.
     nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
     if (nm != nullptr) {
-      nm->make_not_entrant("C1 deoptimize for patching");
+      nm->make_not_entrant(nmethod::InvalidationReason::C1_DEOPTIMIZE_FOR_PATCHING);
     }
   }
 
   Deoptimization::deoptimize_frame(current, caller_frame.id());
   // Return to the now deoptimized frame.
@@ -1484,11 +1484,11 @@
   frame runtime_frame = current->last_frame();
   frame caller_frame = runtime_frame.sender(&reg_map);
 
   nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
   assert (nm != nullptr, "no more nmethod?");
-  nm->make_not_entrant("C1 predicate failed trap");
+  nm->make_not_entrant(nmethod::InvalidationReason::C1_PREDICATE_FAILED_TRAP);
 
   methodHandle m(current, nm->method());
   MethodData* mdo = m->method_data();
 
   if (mdo == nullptr && !HAS_PENDING_EXCEPTION) {
diff a/src/hotspot/share/ci/ciReplay.cpp b/src/hotspot/share/ci/ciReplay.cpp
--- a/src/hotspot/share/ci/ciReplay.cpp
+++ b/src/hotspot/share/ci/ciReplay.cpp
@@ -800,11 +800,11 @@
       }
     }
     // Make sure the existence of a prior compile doesn't stop this one
     nmethod* nm = (entry_bci != InvocationEntryBci) ? method->lookup_osr_nmethod_for(entry_bci, comp_level, true) : method->code();
     if (nm != nullptr) {
-      nm->make_not_entrant("CI replay");
+      nm->make_not_entrant(nmethod::InvalidationReason::CI_REPLAY);
     }
     replay_state = this;
     CompileBroker::compile_method(methodHandle(THREAD, method), entry_bci, comp_level,
                                   0, CompileTask::Reason_Replay, THREAD);
     replay_state = nullptr;
diff a/src/hotspot/share/code/codeCache.cpp b/src/hotspot/share/code/codeCache.cpp
--- a/src/hotspot/share/code/codeCache.cpp
+++ b/src/hotspot/share/code/codeCache.cpp
@@ -1359,11 +1359,11 @@
 void CodeCache::make_marked_nmethods_deoptimized() {
   RelaxedNMethodIterator iter(RelaxedNMethodIterator::not_unloading);
   while(iter.next()) {
     nmethod* nm = iter.method();
     if (nm->is_marked_for_deoptimization() && !nm->has_been_deoptimized() && nm->can_be_deoptimized()) {
-      nm->make_not_entrant("marked for deoptimization");
+      nm->make_not_entrant(nmethod::InvalidationReason::MARKED_FOR_DEOPTIMIZATION);
       nm->make_deoptimized();
     }
   }
 }
 
diff a/src/hotspot/share/code/nmethod.cpp b/src/hotspot/share/code/nmethod.cpp
--- a/src/hotspot/share/code/nmethod.cpp
+++ b/src/hotspot/share/code/nmethod.cpp
@@ -1968,27 +1968,25 @@
   if (method() != nullptr) {
     method()->method_holder()->remove_osr_nmethod(this);
   }
 }
 
-void nmethod::log_state_change(const char* reason) const {
-  assert(reason != nullptr, "Must provide a reason");
-
+void nmethod::log_state_change(InvalidationReason invalidation_reason) const {
   if (LogCompilation) {
     if (xtty != nullptr) {
       ttyLocker ttyl;  // keep the following output all in one block
       xtty->begin_elem("make_not_entrant thread='%zu' reason='%s'",
-                       os::current_thread_id(), reason);
+                       os::current_thread_id(), invalidation_reason_to_string(invalidation_reason));
       log_identity(xtty);
       xtty->stamp();
       xtty->end_elem();
     }
   }
 
   ResourceMark rm;
   stringStream ss(NEW_RESOURCE_ARRAY(char, 256), 256);
-  ss.print("made not entrant: %s", reason);
+  ss.print("made not entrant: %s", invalidation_reason_to_string(invalidation_reason));
 
   CompileTask::print_ul(this, ss.freeze());
   if (PrintCompilation) {
     print_on_with_msg(tty, ss.freeze());
   }
@@ -1999,13 +1997,11 @@
     method()->unlink_code(this);
   }
 }
 
 // Invalidate code
-bool nmethod::make_not_entrant(const char* reason) {
-  assert(reason != nullptr, "Must provide a reason");
-
+bool nmethod::make_not_entrant(InvalidationReason invalidation_reason) {
   // This can be called while the system is already at a safepoint which is ok
   NoSafepointVerifier nsv;
 
   if (is_unloading()) {
     // If the nmethod is unloading, then it is already not entrant through
@@ -2059,22 +2055,22 @@
     // Change state
     bool success = try_transition(not_entrant);
     assert(success, "Transition can't fail");
 
     // Log the transition once
-    log_state_change(reason);
+    log_state_change(invalidation_reason);
 
     // Remove nmethod from method.
     unlink_from_method();
 
   } // leave critical region under NMethodState_lock
 
 #if INCLUDE_JVMCI
   // Invalidate can't occur while holding the NMethodState_lock
   JVMCINMethodData* nmethod_data = jvmci_nmethod_data();
   if (nmethod_data != nullptr) {
-    nmethod_data->invalidate_nmethod_mirror(this);
+    nmethod_data->invalidate_nmethod_mirror(this, invalidation_reason);
   }
 #endif
 
 #ifdef ASSERT
   if (is_osr_method() && method() != nullptr) {
@@ -2108,11 +2104,13 @@
 
 #if INCLUDE_JVMCI
   // Clear the link between this nmethod and a HotSpotNmethod mirror
   JVMCINMethodData* nmethod_data = jvmci_nmethod_data();
   if (nmethod_data != nullptr) {
-    nmethod_data->invalidate_nmethod_mirror(this);
+    nmethod_data->invalidate_nmethod_mirror(this, is_cold() ?
+            nmethod::InvalidationReason::UNLOADING_COLD :
+            nmethod::InvalidationReason::UNLOADING);
   }
 #endif
 
   // Post before flushing as jmethodID is being used
   post_compiled_method_unload();
diff a/src/hotspot/share/code/nmethod.hpp b/src/hotspot/share/code/nmethod.hpp
--- a/src/hotspot/share/code/nmethod.hpp
+++ b/src/hotspot/share/code/nmethod.hpp
@@ -469,10 +469,86 @@
   // Sets this nmethod as strongly claimed (as part of N|SD -> X|SD and N|SR -> X|SD
   // transitions).
   void oops_do_set_strong_done(nmethod* old_head);
 
 public:
+  // If you change anything in this enum please patch
+  // vmStructs_jvmci.cpp accordingly.
+  enum class InvalidationReason : s1 {
+    NOT_INVALIDATED = -1,
+    C1_CODEPATCH,
+    C1_DEOPTIMIZE,
+    C1_DEOPTIMIZE_FOR_PATCHING,
+    C1_PREDICATE_FAILED_TRAP,
+    CI_REPLAY,
+    UNLOADING,
+    UNLOADING_COLD,
+    JVMCI_INVALIDATE,
+    JVMCI_MATERIALIZE_VIRTUAL_OBJECT,
+    JVMCI_REPLACED_WITH_NEW_CODE,
+    JVMCI_REPROFILE,
+    MARKED_FOR_DEOPTIMIZATION,
+    MISSING_EXCEPTION_HANDLER,
+    NOT_USED,
+    OSR_INVALIDATION_BACK_BRANCH,
+    OSR_INVALIDATION_FOR_COMPILING_WITH_C1,
+    OSR_INVALIDATION_OF_LOWER_LEVEL,
+    SET_NATIVE_FUNCTION,
+    UNCOMMON_TRAP,
+    WHITEBOX_DEOPTIMIZATION,
+    ZOMBIE,
+    INVALIDATION_REASONS_COUNT
+  };
+
+
+  static const char* invalidation_reason_to_string(InvalidationReason invalidation_reason) {
+    switch (invalidation_reason) {
+      case InvalidationReason::C1_CODEPATCH:
+        return "C1 code patch";
+      case InvalidationReason::C1_DEOPTIMIZE:
+        return "C1 deoptimized";
+      case InvalidationReason::C1_DEOPTIMIZE_FOR_PATCHING:
+        return "C1 deoptimize for patching";
+      case InvalidationReason::C1_PREDICATE_FAILED_TRAP:
+        return "C1 predicate failed trap";
+      case InvalidationReason::CI_REPLAY:
+        return "CI replay";
+      case InvalidationReason::JVMCI_INVALIDATE:
+        return "JVMCI invalidate";
+      case InvalidationReason::JVMCI_MATERIALIZE_VIRTUAL_OBJECT:
+        return "JVMCI materialize virtual object";
+      case InvalidationReason::JVMCI_REPLACED_WITH_NEW_CODE:
+        return "JVMCI replaced with new code";
+      case InvalidationReason::JVMCI_REPROFILE:
+        return "JVMCI reprofile";
+      case InvalidationReason::MARKED_FOR_DEOPTIMIZATION:
+        return "marked for deoptimization";
+      case InvalidationReason::MISSING_EXCEPTION_HANDLER:
+        return "missing exception handler";
+      case InvalidationReason::NOT_USED:
+        return "not used";
+      case InvalidationReason::OSR_INVALIDATION_BACK_BRANCH:
+        return "OSR invalidation back branch";
+      case InvalidationReason::OSR_INVALIDATION_FOR_COMPILING_WITH_C1:
+        return "OSR invalidation for compiling with C1";
+      case InvalidationReason::OSR_INVALIDATION_OF_LOWER_LEVEL:
+        return "OSR invalidation of lower level";
+      case InvalidationReason::SET_NATIVE_FUNCTION:
+        return "set native function";
+      case InvalidationReason::UNCOMMON_TRAP:
+        return "uncommon trap";
+      case InvalidationReason::WHITEBOX_DEOPTIMIZATION:
+        return "whitebox deoptimization";
+      case InvalidationReason::ZOMBIE:
+        return "zombie";
+      default: {
+        assert(false, "Unhandled reason");
+        return "Unknown";
+      }
+    }
+  }
+
   // create nmethod with entry_bci
   static nmethod* new_nmethod(const methodHandle& method,
                               int compile_id,
                               int entry_bci,
                               CodeOffsets* offsets,
@@ -631,12 +707,12 @@
   }
   // Make the nmethod non entrant. The nmethod will continue to be
   // alive.  It is used when an uncommon trap happens.  Returns true
   // if this thread changed the state of the nmethod or false if
   // another thread performed the transition.
-  bool  make_not_entrant(const char* reason);
-  bool  make_not_used()    { return make_not_entrant("not used"); }
+  bool  make_not_entrant(InvalidationReason invalidation_reason);
+  bool  make_not_used() { return make_not_entrant(InvalidationReason::NOT_USED); }
 
   bool  is_marked_for_deoptimization() const { return deoptimization_status() != not_marked; }
   bool  has_been_deoptimized() const { return deoptimization_status() == deoptimize_done; }
   void  set_deoptimized_done();
 
@@ -945,11 +1021,11 @@
   void print_on_with_msg(outputStream* st, const char* msg) const;
 
   // Logging
   void log_identity(xmlStream* log) const;
   void log_new_nmethod() const;
-  void log_state_change(const char* reason) const;
+  void log_state_change(InvalidationReason invalidation_reason) const;
 
   // Prints block-level comments, including nmethod specific block labels:
   void print_nmethod_labels(outputStream* stream, address block_begin, bool print_section_labels=true) const;
   const char* nmethod_section_label(address pos) const;
 
diff a/src/hotspot/share/compiler/compilationPolicy.cpp b/src/hotspot/share/compiler/compilationPolicy.cpp
--- a/src/hotspot/share/compiler/compilationPolicy.cpp
+++ b/src/hotspot/share/compiler/compilationPolicy.cpp
@@ -922,11 +922,11 @@
     if ((bci != InvocationEntryBci && !can_be_osr_compiled(mh, level))) {
       if (level == CompLevel_full_optimization && can_be_osr_compiled(mh, CompLevel_simple)) {
         nmethod* osr_nm = mh->lookup_osr_nmethod_for(bci, CompLevel_simple, false);
         if (osr_nm != nullptr && osr_nm->comp_level() > CompLevel_simple) {
           // Invalidate the existing OSR nmethod so that a compile at CompLevel_simple is permitted.
-          osr_nm->make_not_entrant("OSR invalidation for compiling with C1");
+          osr_nm->make_not_entrant(nmethod::InvalidationReason::OSR_INVALIDATION_FOR_COMPILING_WITH_C1);
         }
         compile(mh, bci, CompLevel_simple, THREAD);
       }
       return;
     }
@@ -1514,11 +1514,11 @@
           if (make_not_entrant) {
             if (PrintTieredEvents) {
               int osr_bci = nm->is_osr_method() ? nm->osr_entry_bci() : InvocationEntryBci;
               print_event(MAKE_NOT_ENTRANT, mh(), mh(), osr_bci, level);
             }
-            nm->make_not_entrant("OSR invalidation, back branch");
+            nm->make_not_entrant(nmethod::InvalidationReason::OSR_INVALIDATION_BACK_BRANCH);
           }
         }
         // Fix up next_level if necessary to avoid deopts
         if (next_level == CompLevel_limited_profile && max_osr_level == CompLevel_full_profile) {
           next_level = CompLevel_full_profile;
diff a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
@@ -89,11 +89,11 @@
   // Therefore, we start by sorting the regions by garbage. Then we unconditionally add the best candidates
   // before we meet min_garbage. Then we add all candidates that fit with a garbage threshold before
   // we hit max_cset. When max_cset is hit, we terminate the cset selection. Note that in this scheme,
   // ShenandoahGarbageThreshold is the soft threshold which would be ignored until min_garbage is hit.
 
-  size_t capacity    = _space_info->soft_max_capacity();
+  size_t capacity    = ShenandoahHeap::heap()->soft_max_capacity();
   size_t max_cset    = (size_t)((1.0 * capacity / 100 * ShenandoahEvacReserve) / ShenandoahEvacWaste);
   size_t free_target = (capacity / 100 * ShenandoahMinFreeThreshold) + max_cset;
   size_t min_garbage = (free_target > actual_free ? (free_target - actual_free) : 0);
 
   log_info(gc, ergo)("Adaptive CSet Selection. Target Free: %zu%s, Actual Free: "
@@ -231,11 +231,11 @@
 //
 //    For cases 1 and 2, we need to "quickly" recalibrate the average allocation rate whenever we detect a change
 //    in operation mode.  We want some way to decide that the average rate has changed, while keeping average
 //    allocation rate computation independent.
 bool ShenandoahAdaptiveHeuristics::should_start_gc() {
-  size_t capacity = _space_info->soft_max_capacity();
+  size_t capacity = ShenandoahHeap::heap()->soft_max_capacity();
   size_t available = _space_info->soft_available();
   size_t allocated = _space_info->bytes_allocated_since_gc_start();
 
   log_debug(gc)("should_start_gc? available: %zu, soft_max_capacity: %zu"
                 ", allocated: %zu", available, capacity, allocated);
@@ -347,14 +347,11 @@
   _spike_threshold_sd = saturate(_spike_threshold_sd - amount, MINIMUM_CONFIDENCE, MAXIMUM_CONFIDENCE);
   log_debug(gc, ergo)("Spike threshold now: %.2f", _spike_threshold_sd);
 }
 
 size_t ShenandoahAdaptiveHeuristics::min_free_threshold() {
-  // Note that soft_max_capacity() / 100 * min_free_threshold is smaller than max_capacity() / 100 * min_free_threshold.
-  // We want to behave conservatively here, so use max_capacity().  By returning a larger value, we cause the GC to
-  // trigger when the remaining amount of free shrinks below the larger threshold.
-  return _space_info->max_capacity() / 100 * ShenandoahMinFreeThreshold;
+  return ShenandoahHeap::heap()->soft_max_capacity() / 100 * ShenandoahMinFreeThreshold;
 }
 
 ShenandoahAllocationRate::ShenandoahAllocationRate() :
   _last_sample_time(os::elapsedTime()),
   _last_sample_value(0),
diff a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahCompactHeuristics.cpp
@@ -45,11 +45,11 @@
   SHENANDOAH_ERGO_OVERRIDE_DEFAULT(ShenandoahGarbageThreshold,     10);
 }
 
 bool ShenandoahCompactHeuristics::should_start_gc() {
   size_t max_capacity = _space_info->max_capacity();
-  size_t capacity = _space_info->soft_max_capacity();
+  size_t capacity = ShenandoahHeap::heap()->soft_max_capacity();
   size_t available = _space_info->available();
 
   // Make sure the code below treats available without the soft tail.
   size_t soft_tail = max_capacity - capacity;
   available = (available > soft_tail) ? (available - soft_tail) : 0;
diff a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGlobalHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGlobalHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGlobalHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahGlobalHeuristics.cpp
@@ -51,11 +51,11 @@
                                                               const ShenandoahHeuristics::RegionData* data,
                                                               size_t size, size_t actual_free,
                                                               size_t cur_young_garbage) const {
   auto heap = ShenandoahGenerationalHeap::heap();
   size_t region_size_bytes = ShenandoahHeapRegion::region_size_bytes();
-  size_t capacity = heap->young_generation()->max_capacity();
+  size_t capacity = heap->soft_max_capacity();
   size_t garbage_threshold = region_size_bytes * ShenandoahGarbageThreshold / 100;
   size_t ignore_threshold = region_size_bytes * ShenandoahIgnoreGarbageThreshold / 100;
   const uint tenuring_threshold = heap->age_census()->tenuring_threshold();
 
   size_t young_evac_reserve = heap->young_generation()->get_evacuation_reserve();
diff a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahSpaceInfo.hpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahSpaceInfo.hpp
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahSpaceInfo.hpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahSpaceInfo.hpp
@@ -35,11 +35,10 @@
  * into generations.
  */
 class ShenandoahSpaceInfo {
 public:
   virtual const char* name() const = 0;
-  virtual size_t soft_max_capacity() const = 0;
   virtual size_t max_capacity() const = 0;
   virtual size_t soft_available() const = 0;
   virtual size_t available() const = 0;
   virtual size_t used() const = 0;
   virtual size_t bytes_allocated_since_gc_start() const = 0;
diff a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahStaticHeuristics.cpp
@@ -40,11 +40,11 @@
 
 ShenandoahStaticHeuristics::~ShenandoahStaticHeuristics() {}
 
 bool ShenandoahStaticHeuristics::should_start_gc() {
   size_t max_capacity = _space_info->max_capacity();
-  size_t capacity = _space_info->soft_max_capacity();
+  size_t capacity = ShenandoahHeap::heap()->soft_max_capacity();
   size_t available = _space_info->available();
 
   // Make sure the code below treats available without the soft tail.
   size_t soft_tail = max_capacity - capacity;
   available = (available > soft_tail) ? (available - soft_tail) : 0;
diff a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahYoungHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahYoungHeuristics.cpp
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahYoungHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahYoungHeuristics.cpp
@@ -64,11 +64,11 @@
                                                             size_t size, size_t actual_free,
                                                             size_t cur_young_garbage) const {
 
   auto heap = ShenandoahGenerationalHeap::heap();
 
-  size_t capacity = heap->young_generation()->max_capacity();
+  size_t capacity = heap->soft_max_capacity();
   size_t garbage_threshold = ShenandoahHeapRegion::region_size_bytes() * ShenandoahGarbageThreshold / 100;
   size_t ignore_threshold = ShenandoahHeapRegion::region_size_bytes() * ShenandoahIgnoreGarbageThreshold / 100;
   const uint tenuring_threshold = heap->age_census()->tenuring_threshold();
 
   // This is young-gen collection or a mixed evacuation.
diff a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.cpp
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2018, 2020, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2025, Red Hat, Inc. 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.
@@ -27,11 +27,14 @@
 #include "gc/shenandoah/shenandoahForwarding.hpp"
 #include "gc/shenandoah/shenandoahHeap.inline.hpp"
 #include "gc/shenandoah/shenandoahHeapRegionSet.inline.hpp"
 #include "gc/shenandoah/shenandoahMarkingContext.inline.hpp"
 #include "gc/shenandoah/shenandoahUtils.hpp"
+#include "oops/oop.inline.hpp"
 #include "memory/resourceArea.hpp"
+#include "runtime/os.hpp"
+#include "utilities/vmError.hpp"
 
 void print_raw_memory(ShenandoahMessageBuffer &msg, void* loc) {
   // Be extra safe. Only access data that is guaranteed to be safe:
   // should be in heap, in known committed region, within that region.
 
@@ -55,28 +58,46 @@
   ShenandoahHeap* heap = ShenandoahHeap::heap();
   ShenandoahHeapRegion *r = heap->heap_region_containing(obj);
 
   ResourceMark rm;
   stringStream ss;
-  r->print_on(&ss);
-
-  stringStream mw_ss;
-  obj->mark().print_on(&mw_ss);
+  StreamIndentor si(&ss);
 
   ShenandoahMarkingContext* const ctx = heap->marking_context();
 
-  msg.append("  " PTR_FORMAT " - klass " PTR_FORMAT " %s\n", p2i(obj), p2i(obj->klass()), obj->klass()->external_name());
-  msg.append("    %3s allocated after mark start\n", ctx->allocated_after_mark_start(obj) ? "" : "not");
-  msg.append("    %3s after update watermark\n",     cast_from_oop<HeapWord*>(obj) >= r->get_update_watermark() ? "" : "not");
-  msg.append("    %3s marked strong\n",              ctx->is_marked_strong(obj) ? "" : "not");
-  msg.append("    %3s marked weak\n",                ctx->is_marked_weak(obj) ? "" : "not");
-  msg.append("    %3s in collection set\n",          heap->in_collection_set(obj) ? "" : "not");
-  if (heap->mode()->is_generational() && !obj->is_forwarded()) {
-    msg.append("  age: %d\n", obj->age());
-  }
-  msg.append("  mark:%s\n", mw_ss.freeze());
-  msg.append("  region: %s", ss.freeze());
+  narrowKlass nk = 0;
+  const Klass* obj_klass = nullptr;
+  const bool klass_valid = extract_klass_safely(obj, nk, obj_klass);
+  const char* klass_text = "(invalid)";
+  if (klass_valid && os::is_readable_pointer(obj_klass) && Metaspace::contains(obj_klass)) {
+    klass_text = obj_klass->external_name();
+  }
+  ss.print_cr(PTR_FORMAT " - nk %u klass " PTR_FORMAT " %s\n", p2i(obj), nk, p2i(obj_klass), klass_text);
+  {
+    StreamIndentor si(&ss);
+    ss.print_cr("%3s allocated after mark start", ctx->allocated_after_mark_start(obj) ? "" : "not");
+    ss.print_cr("%3s after update watermark",     cast_from_oop<HeapWord*>(obj) >= r->get_update_watermark() ? "" : "not");
+    ss.print_cr("%3s marked strong",              ctx->is_marked_strong(obj) ? "" : "not");
+    ss.print_cr("%3s marked weak",                ctx->is_marked_weak(obj) ? "" : "not");
+    ss.print_cr("%3s in collection set",          heap->in_collection_set(obj) ? "" : "not");
+    if (heap->mode()->is_generational() && !obj->is_forwarded()) {
+      ss.print_cr("age: %d", obj->age());
+    }
+    ss.print_raw("mark: ");
+    obj->mark().print_on(&ss);
+    ss.cr();
+    ss.print_raw("region: ");
+    r->print_on(&ss);
+    ss.cr();
+    if (obj_klass == vmClasses::Class_klass()) {
+      msg.append("  mirrored klass:       " PTR_FORMAT "\n", p2i(obj->metadata_field(java_lang_Class::klass_offset())));
+      msg.append("  mirrored array klass: " PTR_FORMAT "\n", p2i(obj->metadata_field(java_lang_Class::array_klass_offset())));
+    }
+  }
+  const_address loc = cast_from_oop<const_address>(obj);
+  os::print_hex_dump(&ss, loc, loc + 64, 4, true, 32, loc);
+  msg.append("%s", ss.base());
 }
 
 void ShenandoahAsserts::print_non_obj(ShenandoahMessageBuffer& msg, void* loc) {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
   if (heap->is_in_reserved(loc)) {
@@ -113,18 +134,22 @@
                                        const char* phase, const char* label,
                                        const char* file, int line) {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
   ResourceMark rm;
 
+  if (!os::is_readable_pointer(obj)) {
+    level = _safe_unknown;
+  }
+
   bool loc_in_heap = (loc != nullptr && heap->is_in_reserved(loc));
 
   ShenandoahMessageBuffer msg("%s; %s\n\n", phase, label);
 
   msg.append("Referenced from:\n");
   if (interior_loc != nullptr) {
     msg.append("  interior location: " PTR_FORMAT "\n", p2i(interior_loc));
-    if (loc_in_heap) {
+    if (loc_in_heap && os::is_readable_pointer(loc)) {
       print_obj(msg, loc);
     } else {
       print_non_obj(msg, interior_loc);
     }
   } else {
@@ -142,11 +167,11 @@
 
   if (level >= _safe_oop) {
     oop fwd = ShenandoahForwarding::get_forwardee_raw_unchecked(obj);
     msg.append("Forwardee:\n");
     if (obj != fwd) {
-      if (level >= _safe_oop_fwd) {
+      if (level >= _safe_oop_fwd && os::is_readable_pointer(fwd)) {
         print_obj(msg, fwd);
       } else {
         print_obj_safe(msg, fwd);
       }
     } else {
@@ -197,21 +222,14 @@
     print_failure(_safe_unknown, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
                   "oop must be in heap bounds",
                   file, line);
   }
 
-  Klass* obj_klass = ShenandoahForwarding::klass(obj);
-  if (obj_klass == nullptr) {
+  if (!os::is_readable_pointer(obj)) {
     print_failure(_safe_unknown, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
-                  "Object klass pointer should not be null",
-                  file,line);
-  }
-
-  if (!Metaspace::contains(obj_klass)) {
-    print_failure(_safe_unknown, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
-                  "Object klass pointer must go to metaspace",
-                  file,line);
+                  "oop within heap bounds but at unreadable location",
+                  file, line);
   }
 
   if (!heap->is_in(obj)) {
     print_failure(_safe_unknown, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
                   "Object should be in active region area",
@@ -235,13 +253,13 @@
       print_failure(_safe_oop, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
                     "Forwardee must be in heap bounds",
                     file, line);
     }
 
-    if (obj_klass != ShenandoahForwarding::klass(fwd)) {
+    if (!os::is_readable_pointer(fwd)) {
       print_failure(_safe_oop, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
-                    "Forwardee klass disagrees with object class",
+                    "Forwardee within heap bounds but at unreadable location",
                     file, line);
     }
 
     // Step 3. Check that forwardee points to correct region
     if (!heap->is_in(fwd)) {
@@ -263,25 +281,53 @@
                     "Multiple forwardings",
                     file, line);
     }
   }
 
+  const Klass* obj_klass = nullptr;
+  narrowKlass nk = 0;
+  if (!extract_klass_safely(obj, nk, obj_klass)) {
+    print_failure(_safe_oop, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
+                  "Object klass pointer invalid",
+                  file,line);
+  }
+
+  if (obj_klass == nullptr) {
+    print_failure(_safe_oop, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
+                  "Object klass pointer should not be null",
+                  file,line);
+  }
+
+  if (!Metaspace::contains(obj_klass)) {
+    print_failure(_safe_oop, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
+                  "Object klass pointer must go to metaspace",
+                  file,line);
+  }
+
+  if (!UseCompactObjectHeaders && obj_klass != fwd->klass_or_null()) {
+    print_failure(_safe_oop, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
+                  "Forwardee klass disagrees with object class",
+                  file, line);
+  }
+
   // Do additional checks for special objects: their fields can hold metadata as well.
-  // We want to check class loading/unloading did not corrupt them.
+  // We want to check class loading/unloading did not corrupt them. We can only reasonably
+  // trust the forwarded objects, as the from-space object can have the klasses effectively
+  // dead.
 
   if (Universe::is_fully_initialized() && (obj_klass == vmClasses::Class_klass())) {
-    Metadata* klass = obj->metadata_field(java_lang_Class::klass_offset());
+    const Metadata* klass = fwd->metadata_field(java_lang_Class::klass_offset());
     if (klass != nullptr && !Metaspace::contains(klass)) {
       print_failure(_safe_all, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
-                    "Instance class mirror should point to Metaspace",
+                    "Mirrored instance class should point to Metaspace",
                     file, line);
     }
 
-    Metadata* array_klass = obj->metadata_field(java_lang_Class::array_klass_offset());
+    const Metadata* array_klass = fwd->metadata_field(java_lang_Class::array_klass_offset());
     if (array_klass != nullptr && !Metaspace::contains(array_klass)) {
       print_failure(_safe_all, obj, interior_loc, nullptr, "Shenandoah assert_correct failed",
-                    "Array class mirror should point to Metaspace",
+                    "Mirrored array class should point to Metaspace",
                     file, line);
     }
   }
 }
 
@@ -509,5 +555,36 @@
   }
 
   ShenandoahMessageBuffer msg("Active(%d) & GC(%d) Generations aren't reconciled", agen->type(), ggen->type());
   report_vm_error(file, line, msg.buffer());
 }
+
+bool ShenandoahAsserts::extract_klass_safely(oop obj, narrowKlass& nk, const Klass*& k) {
+  nk = 0;
+  k = nullptr;
+
+  if (!os::is_readable_pointer(obj)) {
+    return false;
+  }
+  if (UseCompressedClassPointers) {
+    if (UseCompactObjectHeaders) { // look in forwardee
+      markWord mark = obj->mark();
+      if (mark.is_marked()) {
+        oop fwd = cast_to_oop(mark.clear_lock_bits().to_pointer());
+        if (!os::is_readable_pointer(fwd)) {
+          return false;
+        }
+        mark = fwd->mark();
+      }
+      nk = mark.narrow_klass();
+    } else {
+      nk = obj->narrow_klass();
+    }
+    if (!CompressedKlassPointers::is_valid_narrow_klass_id(nk)) {
+      return false;
+    }
+    k = CompressedKlassPointers::decode_not_null_without_asserts(nk);
+  } else {
+    k = obj->klass();
+  }
+  return k != nullptr;
+}
diff a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahAsserts.hpp
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2018, 2019, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2018, 2025, Red Hat, Inc. All rights reserved.
  * Copyright Amazon.com Inc. 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
  * under the terms of the GNU General Public License version 2 only, as
@@ -25,10 +25,11 @@
 
 #ifndef SHARE_GC_SHENANDOAH_SHENANDOAHASSERTS_HPP
 #define SHARE_GC_SHENANDOAH_SHENANDOAHASSERTS_HPP
 
 #include "memory/iterator.hpp"
+#include "oops/compressedKlass.hpp"
 #include "runtime/mutex.hpp"
 #include "utilities/formatBuffer.hpp"
 
 typedef FormatBuffer<8192> ShenandoahMessageBuffer;
 
@@ -75,10 +76,15 @@
   static void assert_heaplocked_or_safepoint(const char* file, int line);
   static void assert_control_or_vm_thread_at_safepoint(bool at_safepoint, const char* file, int line);
   static void assert_generational(const char* file, int line);
   static void assert_generations_reconciled(const char* file, int line);
 
+  // Given a possibly invalid oop, extract narrowKlass (if UCCP) and Klass*
+  // from it safely.
+  // Note: For -UCCP, returned nk is always 0.
+  static bool extract_klass_safely(oop obj, narrowKlass& nk, const Klass*& k);
+
 #ifdef ASSERT
 #define shenandoah_assert_in_heap_bounds(interior_loc, obj) \
                     ShenandoahAsserts::assert_in_heap_bounds(interior_loc, obj, __FILE__, __LINE__)
 #define shenandoah_assert_in_heap_bounds_or_null(interior_loc, obj) \
                     ShenandoahAsserts::assert_in_heap_bounds_or_null(interior_loc, obj, __FILE__, __LINE__)
diff a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp
@@ -829,27 +829,22 @@
 
 bool ShenandoahConcurrentGC::has_in_place_promotions(ShenandoahHeap* heap) {
   return heap->mode()->is_generational() && heap->old_generation()->has_in_place_promotions();
 }
 
-template<bool GENERATIONAL>
 class ShenandoahConcurrentEvacThreadClosure : public ThreadClosure {
 private:
   OopClosure* const _oops;
 public:
   explicit ShenandoahConcurrentEvacThreadClosure(OopClosure* oops) : _oops(oops) {}
 
   void do_thread(Thread* thread) override {
     JavaThread* const jt = JavaThread::cast(thread);
     StackWatermarkSet::finish_processing(jt, _oops, StackWatermarkKind::gc);
-    if (GENERATIONAL) {
-      ShenandoahThreadLocalData::enable_plab_promotions(thread);
-    }
   }
 };
 
-template<bool GENERATIONAL>
 class ShenandoahConcurrentEvacUpdateThreadTask : public WorkerTask {
 private:
   ShenandoahJavaThreadsIterator _java_threads;
 
 public:
@@ -857,34 +852,24 @@
     WorkerTask("Shenandoah Evacuate/Update Concurrent Thread Roots"),
     _java_threads(ShenandoahPhaseTimings::conc_thread_roots, n_workers) {
   }
 
   void work(uint worker_id) override {
-    if (GENERATIONAL) {
-      Thread* worker_thread = Thread::current();
-      ShenandoahThreadLocalData::enable_plab_promotions(worker_thread);
-    }
-
     // ShenandoahEvacOOMScope has to be setup by ShenandoahContextEvacuateUpdateRootsClosure.
     // Otherwise, may deadlock with watermark lock
     ShenandoahContextEvacuateUpdateRootsClosure oops_cl;
-    ShenandoahConcurrentEvacThreadClosure<GENERATIONAL> thr_cl(&oops_cl);
+    ShenandoahConcurrentEvacThreadClosure thr_cl(&oops_cl);
     _java_threads.threads_do(&thr_cl, worker_id);
   }
 };
 
 void ShenandoahConcurrentGC::op_thread_roots() {
-  ShenandoahHeap* const heap = ShenandoahHeap::heap();
+  const ShenandoahHeap* const heap = ShenandoahHeap::heap();
   assert(heap->is_evacuation_in_progress(), "Checked by caller");
   ShenandoahGCWorkerPhase worker_phase(ShenandoahPhaseTimings::conc_thread_roots);
-  if (heap->mode()->is_generational()) {
-    ShenandoahConcurrentEvacUpdateThreadTask<true> task(heap->workers()->active_workers());
-    heap->workers()->run_task(&task);
-  } else {
-    ShenandoahConcurrentEvacUpdateThreadTask<false> task(heap->workers()->active_workers());
-    heap->workers()->run_task(&task);
-  }
+  ShenandoahConcurrentEvacUpdateThreadTask task(heap->workers()->active_workers());
+  heap->workers()->run_task(&task);
 }
 
 void ShenandoahConcurrentGC::op_weak_refs() {
   ShenandoahHeap* const heap = ShenandoahHeap::heap();
   assert(heap->is_concurrent_weak_root_in_progress(), "Only during this phase");
diff a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahControlThread.cpp
@@ -148,10 +148,11 @@
       heap->set_forced_counters_update(true);
 
       // If GC was requested, we better dump freeset data for performance debugging
       heap->free_set()->log_status_under_lock();
 
+      heap->print_before_gc();
       switch (mode) {
         case concurrent_normal:
           service_concurrent_normal_cycle(cause);
           break;
         case stw_degenerated:
@@ -161,10 +162,11 @@
           service_stw_full_cycle(cause);
           break;
         default:
           ShouldNotReachHere();
       }
+      heap->print_after_gc();
 
       // If this was the requested GC cycle, notify waiters about it
       if (is_gc_requested) {
         notify_gc_waiters();
       }
diff a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahFreeSet.cpp
@@ -878,11 +878,11 @@
 template<typename Iter>
 HeapWord* ShenandoahFreeSet::allocate_from_regions(Iter& iterator, ShenandoahAllocRequest &req, bool &in_new_region) {
   for (idx_t idx = iterator.current(); iterator.has_next(); idx = iterator.next()) {
     ShenandoahHeapRegion* r = _heap->get_region(idx);
     size_t min_size = (req.type() == ShenandoahAllocRequest::_alloc_tlab) ? req.min_size() : req.size();
-    if (alloc_capacity(r) >= min_size) {
+    if (alloc_capacity(r) >= min_size * HeapWordSize) {
       HeapWord* result = try_allocate_in(r, req, in_new_region);
       if (result != nullptr) {
         return result;
       }
     }
diff a/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGeneration.cpp
@@ -181,11 +181,11 @@
 
   // Not under a lock here, so read each of these once to make sure
   // byte size in proper unit and proper unit for byte size are consistent.
   const size_t v_used = used();
   const size_t v_used_regions = used_regions_size();
-  const size_t v_soft_max_capacity = soft_max_capacity();
+  const size_t v_soft_max_capacity = ShenandoahHeap::heap()->soft_max_capacity();
   const size_t v_max_capacity = max_capacity();
   const size_t v_available = available();
   const size_t v_humongous_waste = get_humongous_waste();
 
   const LogGcInfo target;
@@ -797,18 +797,17 @@
   set_concurrent_mark_in_progress(false);
 }
 
 ShenandoahGeneration::ShenandoahGeneration(ShenandoahGenerationType type,
                                            uint max_workers,
-                                           size_t max_capacity,
-                                           size_t soft_max_capacity) :
+                                           size_t max_capacity) :
   _type(type),
   _task_queues(new ShenandoahObjToScanQueueSet(max_workers)),
   _ref_processor(new ShenandoahReferenceProcessor(MAX2(max_workers, 1U))),
   _affiliated_region_count(0), _humongous_waste(0), _evacuation_reserve(0),
   _used(0), _bytes_allocated_since_gc_start(0),
-  _max_capacity(max_capacity), _soft_max_capacity(soft_max_capacity),
+  _max_capacity(max_capacity),
   _heuristics(nullptr)
 {
   _is_marking_complete.set();
   assert(max_workers > 0, "At least one queue");
   for (uint i = 0; i < max_workers; ++i) {
@@ -950,11 +949,11 @@
 size_t ShenandoahGeneration::available_with_reserve() const {
   return available(max_capacity());
 }
 
 size_t ShenandoahGeneration::soft_available() const {
-  return available(soft_max_capacity());
+  return available(ShenandoahHeap::heap()->soft_max_capacity());
 }
 
 size_t ShenandoahGeneration::available(size_t capacity) const {
   size_t in_use = used() + get_humongous_waste();
   return in_use > capacity ? 0 : capacity - in_use;
diff a/src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp b/src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGeneration.hpp
@@ -69,11 +69,10 @@
   // Usage
 
   volatile size_t _used;
   volatile size_t _bytes_allocated_since_gc_start;
   size_t _max_capacity;
-  size_t _soft_max_capacity;
 
   ShenandoahHeuristics* _heuristics;
 
 private:
   // Compute evacuation budgets prior to choosing collection set.
@@ -103,12 +102,11 @@
   size_t available(size_t capacity) const;
 
  public:
   ShenandoahGeneration(ShenandoahGenerationType type,
                        uint max_workers,
-                       size_t max_capacity,
-                       size_t soft_max_capacity);
+                       size_t max_capacity);
   ~ShenandoahGeneration();
 
   bool is_young() const  { return _type == YOUNG; }
   bool is_old() const    { return _type == OLD; }
   bool is_global() const { return _type == GLOBAL || _type == NON_GEN; }
@@ -124,11 +122,10 @@
 
   ShenandoahReferenceProcessor* ref_processor() { return _ref_processor; }
 
   virtual ShenandoahHeuristics* initialize_heuristics(ShenandoahMode* gc_mode);
 
-  size_t soft_max_capacity() const override { return _soft_max_capacity; }
   size_t max_capacity() const override      { return _max_capacity; }
   virtual size_t used_regions() const;
   virtual size_t used_regions_size() const;
   virtual size_t free_unaffiliated_regions() const;
   size_t used() const override { return Atomic::load(&_used); }
diff a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalControlThread.cpp
@@ -248,10 +248,11 @@
 
   {
     // Cannot uncommit bitmap slices during concurrent reset
     ShenandoahNoUncommitMark forbid_region_uncommit(_heap);
 
+    _heap->print_before_gc();
     switch (gc_mode()) {
       case concurrent_normal: {
         service_concurrent_normal_cycle(request);
         break;
       }
@@ -269,10 +270,11 @@
         break;
       }
       default:
         ShouldNotReachHere();
     }
+    _heap->print_after_gc();
   }
 
   // If this cycle completed successfully, notify threads waiting for gc
   if (!_heap->cancelled_gc()) {
     notify_gc_waiters();
diff a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGenerationalHeap.cpp
@@ -51,25 +51,10 @@
 public:
   static void print() {
     ShenandoahGenerationalInitLogger logger;
     logger.print_all();
   }
-
-  void print_heap() override {
-    ShenandoahInitLogger::print_heap();
-
-    ShenandoahGenerationalHeap* heap = ShenandoahGenerationalHeap::heap();
-
-    ShenandoahYoungGeneration* young = heap->young_generation();
-    log_info(gc, init)("Young Generation Soft Size: " EXACTFMT, EXACTFMTARGS(young->soft_max_capacity()));
-    log_info(gc, init)("Young Generation Max: " EXACTFMT, EXACTFMTARGS(young->max_capacity()));
-
-    ShenandoahOldGeneration* old = heap->old_generation();
-    log_info(gc, init)("Old Generation Soft Size: " EXACTFMT, EXACTFMTARGS(old->soft_max_capacity()));
-    log_info(gc, init)("Old Generation Max: " EXACTFMT, EXACTFMTARGS(old->max_capacity()));
-  }
-
 protected:
   void print_gc_specific() override {
     ShenandoahInitLogger::print_gc_specific();
 
     ShenandoahGenerationalHeap* heap = ShenandoahGenerationalHeap::heap();
@@ -139,12 +124,12 @@
   size_t initial_capacity_young = _generation_sizer.max_young_size();
   size_t max_capacity_young = _generation_sizer.max_young_size();
   size_t initial_capacity_old = max_capacity() - max_capacity_young;
   size_t max_capacity_old = max_capacity() - initial_capacity_young;
 
-  _young_generation = new ShenandoahYoungGeneration(max_workers(), max_capacity_young, initial_capacity_young);
-  _old_generation = new ShenandoahOldGeneration(max_workers(), max_capacity_old, initial_capacity_old);
+  _young_generation = new ShenandoahYoungGeneration(max_workers(), max_capacity_young);
+  _old_generation = new ShenandoahOldGeneration(max_workers(), max_capacity_old);
   _young_generation->initialize_heuristics(mode());
   _old_generation->initialize_heuristics(mode());
 }
 
 void ShenandoahGenerationalHeap::initialize_serviceability() {
diff a/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp b/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.cpp
@@ -48,14 +48,10 @@
 
 size_t ShenandoahGlobalGeneration::used_regions_size() const {
   return ShenandoahHeap::heap()->capacity();
 }
 
-size_t ShenandoahGlobalGeneration::soft_max_capacity() const {
-  return ShenandoahHeap::heap()->soft_max_capacity();
-}
-
 size_t ShenandoahGlobalGeneration::available() const {
   // The collector reserve may eat into what the mutator is allowed to use. Make sure we are looking
   // at what is available to the mutator when reporting how much memory is available.
   size_t available = this->ShenandoahGeneration::available();
   return MIN2(available, ShenandoahHeap::heap()->free_set()->available());
@@ -63,12 +59,12 @@
 
 size_t ShenandoahGlobalGeneration::soft_available() const {
   size_t available = this->available();
 
   // Make sure the code below treats available without the soft tail.
-  assert(max_capacity() >= soft_max_capacity(), "Max capacity must be greater than soft max capacity.");
-  size_t soft_tail = max_capacity() - soft_max_capacity();
+  assert(max_capacity() >= ShenandoahHeap::heap()->soft_max_capacity(), "Max capacity must be greater than soft max capacity.");
+  size_t soft_tail = max_capacity() - ShenandoahHeap::heap()->soft_max_capacity();
   return (available > soft_tail) ? (available - soft_tail) : 0;
 }
 
 void ShenandoahGlobalGeneration::set_concurrent_mark_in_progress(bool in_progress) {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
diff a/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.hpp b/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahGlobalGeneration.hpp
@@ -30,18 +30,17 @@
 #include "gc/shenandoah/shenandoahYoungGeneration.hpp"
 
 // A "generation" that represents the whole heap.
 class ShenandoahGlobalGeneration : public ShenandoahGeneration {
 public:
-  ShenandoahGlobalGeneration(bool generational, uint max_queues, size_t max_capacity, size_t soft_max_capacity)
-  : ShenandoahGeneration(generational ? GLOBAL : NON_GEN, max_queues, max_capacity, soft_max_capacity) { }
+  ShenandoahGlobalGeneration(bool generational, uint max_queues, size_t max_capacity)
+  : ShenandoahGeneration(generational ? GLOBAL : NON_GEN, max_queues, max_capacity) { }
 
 public:
   const char* name() const override;
 
   size_t max_capacity() const override;
-  size_t soft_max_capacity() const override;
   size_t used_regions() const override;
   size_t used_regions_size() const override;
   size_t available() const override;
   size_t soft_available() const override;
 
diff a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
@@ -30,10 +30,11 @@
 #include "gc/shared/classUnloadingContext.hpp"
 #include "gc/shared/fullGCForwarding.hpp"
 #include "gc/shared/gcArguments.hpp"
 #include "gc/shared/gcTimer.hpp"
 #include "gc/shared/gcTraceTime.inline.hpp"
+#include "gc/shared/gc_globals.hpp"
 #include "gc/shared/locationPrinter.inline.hpp"
 #include "gc/shared/memAllocator.hpp"
 #include "gc/shared/plab.hpp"
 #include "gc/shared/tlab_globals.hpp"
 #include "gc/shenandoah/heuristics/shenandoahOldHeuristics.hpp"
@@ -199,12 +200,11 @@
   size_t num_min_regions = min_byte_size / reg_size_bytes;
   num_min_regions = MIN2(num_min_regions, _num_regions);
   assert(num_min_regions <= _num_regions, "sanity");
   _minimum_size = num_min_regions * reg_size_bytes;
 
-  // Default to max heap size.
-  _soft_max_size = _num_regions * reg_size_bytes;
+  _soft_max_size = SoftMaxHeapSize;
 
   _committed = _initial_size;
 
   size_t heap_page_size   = UseLargePages ? os::large_page_size() : os::vm_page_size();
   size_t bitmap_page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
@@ -522,11 +522,11 @@
                     _gc_mode->name()));
   }
 }
 
 void ShenandoahHeap::initialize_heuristics() {
-  _global_generation = new ShenandoahGlobalGeneration(mode()->is_generational(), max_workers(), max_capacity(), max_capacity());
+  _global_generation = new ShenandoahGlobalGeneration(mode()->is_generational(), max_workers(), max_capacity());
   _global_generation->initialize_heuristics(mode());
 }
 
 #ifdef _MSC_VER
 #pragma warning( push )
@@ -1236,10 +1236,15 @@
 
       // There are two reasons to retire all plabs between old-gen evacuation passes.
       //  1. We need to make the plab memory parsable by remembered-set scanning.
       //  2. We need to establish a trustworthy UpdateWaterMark value within each old-gen heap region
       ShenandoahGenerationalHeap::heap()->retire_plab(plab, thread);
+
+      // Re-enable promotions for the next evacuation phase.
+      ShenandoahThreadLocalData::enable_plab_promotions(thread);
+
+      // Reset the fill size for next evacuation phase.
       if (_resize && ShenandoahThreadLocalData::plab_size(thread) > 0) {
         ShenandoahThreadLocalData::set_plab_size(thread, 0);
       }
     }
   }
@@ -1777,16 +1782,18 @@
   reclaim_aux_bitmap_for_iteration();
 }
 
 bool ShenandoahHeap::prepare_aux_bitmap_for_iteration() {
   assert(SafepointSynchronize::is_at_safepoint(), "safe iteration is only available during safepoints");
-
-  if (!_aux_bitmap_region_special && !os::commit_memory((char*)_aux_bitmap_region.start(), _aux_bitmap_region.byte_size(), false)) {
-    log_warning(gc)("Could not commit native memory for auxiliary marking bitmap for heap iteration");
-    return false;
+  if (!_aux_bitmap_region_special) {
+    bool success = os::commit_memory((char *) _aux_bitmap_region.start(), _aux_bitmap_region.byte_size(), false);
+    if (!success) {
+      log_warning(gc)("Auxiliary marking bitmap commit failed: " PTR_FORMAT " (%zu bytes)",
+                      p2i(_aux_bitmap_region.start()), _aux_bitmap_region.byte_size());
+      return false;
+    }
   }
-  // Reset bitmap
   _aux_bit_map.clear();
   return true;
 }
 
 void ShenandoahHeap::scan_roots_for_iteration(ShenandoahScanObjectStack* oop_stack, ObjectIterateScanRootClosure* oops) {
@@ -1798,12 +1805,17 @@
   ShenandoahHeapIterationRootScanner rp(n_workers);
   rp.roots_do(oops);
 }
 
 void ShenandoahHeap::reclaim_aux_bitmap_for_iteration() {
-  if (!_aux_bitmap_region_special && !os::uncommit_memory((char*)_aux_bitmap_region.start(), _aux_bitmap_region.byte_size())) {
-    log_warning(gc)("Could not uncommit native memory for auxiliary marking bitmap for heap iteration");
+  if (!_aux_bitmap_region_special) {
+    bool success = os::uncommit_memory((char*)_aux_bitmap_region.start(), _aux_bitmap_region.byte_size());
+    if (!success) {
+      log_warning(gc)("Auxiliary marking bitmap uncommit failed: " PTR_FORMAT " (%zu bytes)",
+                      p2i(_aux_bitmap_region.start()), _aux_bitmap_region.byte_size());
+      assert(false, "Auxiliary marking bitmap uncommit should always succeed");
+    }
   }
 }
 
 // Closure for parallelly iterate objects
 class ShenandoahObjectIterateParScanClosure : public BasicOopIterateClosure {
@@ -2594,63 +2606,54 @@
     }
   }
   return false;
 }
 
-bool ShenandoahHeap::commit_bitmap_slice(ShenandoahHeapRegion* r) {
+void ShenandoahHeap::commit_bitmap_slice(ShenandoahHeapRegion* r) {
   shenandoah_assert_heaplocked();
-
-  // Bitmaps in special regions do not need commits
-  if (_bitmap_region_special) {
-    return true;
-  }
+  assert(!is_bitmap_region_special(), "Not for special memory");
 
   if (is_bitmap_slice_committed(r, true)) {
     // Some other region from the group is already committed, meaning the bitmap
     // slice is already committed, we exit right away.
-    return true;
+    return;
   }
 
   // Commit the bitmap slice:
   size_t slice = r->index() / _bitmap_regions_per_slice;
   size_t off = _bitmap_bytes_per_slice * slice;
   size_t len = _bitmap_bytes_per_slice;
   char* start = (char*) _bitmap_region.start() + off;
 
-  if (!os::commit_memory(start, len, false)) {
-    return false;
-  }
+  os::commit_memory_or_exit(start, len, false, "Unable to commit bitmap slice");
 
   if (AlwaysPreTouch) {
     os::pretouch_memory(start, start + len, _pretouch_bitmap_page_size);
   }
-
-  return true;
 }
 
-bool ShenandoahHeap::uncommit_bitmap_slice(ShenandoahHeapRegion *r) {
+void ShenandoahHeap::uncommit_bitmap_slice(ShenandoahHeapRegion *r) {
   shenandoah_assert_heaplocked();
-
-  // Bitmaps in special regions do not need uncommits
-  if (_bitmap_region_special) {
-    return true;
-  }
+  assert(!is_bitmap_region_special(), "Not for special memory");
 
   if (is_bitmap_slice_committed(r, true)) {
     // Some other region from the group is still committed, meaning the bitmap
     // slice should stay committed, exit right away.
-    return true;
+    return;
   }
 
   // Uncommit the bitmap slice:
   size_t slice = r->index() / _bitmap_regions_per_slice;
   size_t off = _bitmap_bytes_per_slice * slice;
   size_t len = _bitmap_bytes_per_slice;
-  if (!os::uncommit_memory((char*)_bitmap_region.start() + off, len)) {
-    return false;
+
+  char* addr = (char*) _bitmap_region.start() + off;
+  bool success = os::uncommit_memory(addr, len);
+  if (!success) {
+    log_warning(gc)("Bitmap slice uncommit failed: " PTR_FORMAT " (%zu bytes)", p2i(addr), len);
+    assert(false, "Bitmap slice uncommit should always succeed");
   }
-  return true;
 }
 
 void ShenandoahHeap::forbid_uncommit() {
   if (_uncommit_thread != nullptr) {
     _uncommit_thread->forbid_uncommit();
diff a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeap.hpp
@@ -754,12 +754,13 @@
 
   // SATB barriers hooks
   inline bool requires_marking(const void* entry) const;
 
   // Support for bitmap uncommits
-  bool commit_bitmap_slice(ShenandoahHeapRegion *r);
-  bool uncommit_bitmap_slice(ShenandoahHeapRegion *r);
+  void commit_bitmap_slice(ShenandoahHeapRegion *r);
+  void uncommit_bitmap_slice(ShenandoahHeapRegion *r);
+  bool is_bitmap_region_special() { return _bitmap_region_special; }
   bool is_bitmap_slice_committed(ShenandoahHeapRegion* r, bool skip_self = false);
 
   // During concurrent reset, the control thread will zero out the mark bitmaps for committed regions.
   // This cannot happen when the uncommit thread is simultaneously trying to uncommit regions and their bitmaps.
   // To prevent these threads from working at the same time, we provide these methods for the control thread to
diff a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.cpp
@@ -800,29 +800,36 @@
   return max_heap_size;
 }
 
 void ShenandoahHeapRegion::do_commit() {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
-  if (!heap->is_heap_region_special() && !os::commit_memory((char *) bottom(), RegionSizeBytes, false)) {
-    report_java_out_of_memory("Unable to commit region");
+  if (!heap->is_heap_region_special()) {
+    os::commit_memory_or_exit((char*) bottom(), RegionSizeBytes, false, "Unable to commit region");
   }
-  if (!heap->commit_bitmap_slice(this)) {
-    report_java_out_of_memory("Unable to commit bitmaps for region");
+  if (!heap->is_bitmap_region_special()) {
+    heap->commit_bitmap_slice(this);
   }
   if (AlwaysPreTouch) {
     os::pretouch_memory(bottom(), end(), heap->pretouch_heap_page_size());
   }
+  if (ZapUnusedHeapArea) {
+    SpaceMangler::mangle_region(MemRegion(bottom(), end()));
+  }
   heap->increase_committed(ShenandoahHeapRegion::region_size_bytes());
 }
 
 void ShenandoahHeapRegion::do_uncommit() {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
-  if (!heap->is_heap_region_special() && !os::uncommit_memory((char *) bottom(), RegionSizeBytes)) {
-    report_java_out_of_memory("Unable to uncommit region");
+  if (!heap->is_heap_region_special()) {
+    bool success = os::uncommit_memory((char *) bottom(), RegionSizeBytes);
+    if (!success) {
+      log_warning(gc)("Region uncommit failed: " PTR_FORMAT " (%zu bytes)", p2i(bottom()), RegionSizeBytes);
+      assert(false, "Region uncommit should always succeed");
+    }
   }
-  if (!heap->uncommit_bitmap_slice(this)) {
-    report_java_out_of_memory("Unable to uncommit bitmaps for region");
+  if (!heap->is_bitmap_region_special()) {
+    heap->uncommit_bitmap_slice(this);
   }
   heap->decrease_committed(ShenandoahHeapRegion::region_size_bytes());
 }
 
 void ShenandoahHeapRegion::set_state(RegionState to) {
diff a/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp b/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahInitLogger.cpp
@@ -41,10 +41,11 @@
   GCInitLogger::print_heap();
 
   log_info(gc, init)("Heap Region Count: %zu", ShenandoahHeapRegion::region_count());
   log_info(gc, init)("Heap Region Size: " EXACTFMT, EXACTFMTARGS(ShenandoahHeapRegion::region_size_bytes()));
   log_info(gc, init)("TLAB Size Max: " EXACTFMT, EXACTFMTARGS(ShenandoahHeapRegion::max_tlab_size_bytes()));
+  log_info(gc, init)("Soft Max Heap Size: " EXACTFMT, EXACTFMTARGS(ShenandoahHeap::heap()->soft_max_capacity()));
 }
 
 void ShenandoahInitLogger::print_gc_specific() {
   GCInitLogger::print_gc_specific();
 
diff a/src/hotspot/share/gc/shenandoah/shenandoahMetrics.cpp b/src/hotspot/share/gc/shenandoah/shenandoahMetrics.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahMetrics.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahMetrics.cpp
@@ -62,11 +62,11 @@
   assert(free_actual != ShenandoahFreeSet::FreeSetUnderConstruction, "Avoid this race");
 
   // ShenandoahCriticalFreeThreshold is expressed as a percentage.  We multiple this percentage by 1/100th
   // of the generation capacity to determine whether the available memory within the generation exceeds the
   // critical threshold.
-  size_t free_expected = (generation->max_capacity() / 100) * ShenandoahCriticalFreeThreshold;
+  size_t free_expected = (ShenandoahHeap::heap()->soft_max_capacity() / 100) * ShenandoahCriticalFreeThreshold;
 
   bool prog_free = free_actual >= free_expected;
   log_info(gc, ergo)("%s progress for free space: %zu%s, need %zu%s",
                      prog_free ? "Good" : "Bad",
                      byte_size_in_proper_unit(free_actual),   proper_unit_for_byte_size(free_actual),
diff a/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp b/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp
@@ -194,12 +194,12 @@
   bool is_completed() {
     return !Atomic::load(&_is_preempted);
   }
 };
 
-ShenandoahOldGeneration::ShenandoahOldGeneration(uint max_queues, size_t max_capacity, size_t soft_max_capacity)
-  : ShenandoahGeneration(OLD, max_queues, max_capacity, soft_max_capacity),
+ShenandoahOldGeneration::ShenandoahOldGeneration(uint max_queues, size_t max_capacity)
+  : ShenandoahGeneration(OLD, max_queues, max_capacity),
     _coalesce_and_fill_region_array(NEW_C_HEAP_ARRAY(ShenandoahHeapRegion*, ShenandoahHeap::heap()->num_regions(), mtGC)),
     _old_heuristics(nullptr),
     _region_balance(0),
     _promoted_reserve(0),
     _promoted_expended(0),
diff a/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.hpp b/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.hpp
@@ -86,11 +86,11 @@
   bool _is_parsable;
 
   bool coalesce_and_fill();
 
 public:
-  ShenandoahOldGeneration(uint max_queues, size_t max_capacity, size_t soft_max_capacity);
+  ShenandoahOldGeneration(uint max_queues, size_t max_capacity);
 
   ShenandoahHeuristics* initialize_heuristics(ShenandoahMode* gc_mode) override;
 
   const char* name() const override {
     return "Old";
diff a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahVerifier.cpp
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2017, 2021, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2017, 2025, Red Hat, Inc. All rights reserved.
  * Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
  * Copyright (c) 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
@@ -147,19 +147,25 @@
 
     check(ShenandoahAsserts::_safe_unknown, obj, _heap->is_in_reserved(obj),
               "oop must be in heap bounds");
     check(ShenandoahAsserts::_safe_unknown, obj, is_object_aligned(obj),
               "oop must be aligned");
+    check(ShenandoahAsserts::_safe_unknown, obj, os::is_readable_pointer(obj),
+              "oop must be accessible");
 
     ShenandoahHeapRegion *obj_reg = _heap->heap_region_containing(obj);
-    Klass* obj_klass = ShenandoahForwarding::klass(obj);
+
+    narrowKlass nk = 0;
+    const Klass* obj_klass = nullptr;
+    const bool klass_valid = ShenandoahAsserts::extract_klass_safely(obj, nk, obj_klass);
+
+    check(ShenandoahAsserts::_safe_unknown, obj, klass_valid,
+           "Object klass pointer unreadable or invalid");
 
     // Verify that obj is not in dead space:
     {
       // Do this before touching obj->size()
-      check(ShenandoahAsserts::_safe_unknown, obj, obj_klass != nullptr,
-             "Object klass pointer should not be null");
       check(ShenandoahAsserts::_safe_unknown, obj, Metaspace::contains(obj_klass),
              "Object klass pointer must go to metaspace");
 
       HeapWord *obj_addr = cast_from_oop<HeapWord*>(obj);
       check(ShenandoahAsserts::_safe_unknown, obj, obj_addr < obj_reg->top(),
@@ -242,22 +248,24 @@
     } else {
       fwd_reg = obj_reg;
     }
 
     // Do additional checks for special objects: their fields can hold metadata as well.
-    // We want to check class loading/unloading did not corrupt them.
+    // We want to check class loading/unloading did not corrupt them. We can only reasonably
+    // trust the forwarded objects, as the from-space object can have the klasses effectively
+    // dead.
 
     if (obj_klass == vmClasses::Class_klass()) {
-      Metadata* klass = obj->metadata_field(java_lang_Class::klass_offset());
+      const Metadata* klass = fwd->metadata_field(java_lang_Class::klass_offset());
       check(ShenandoahAsserts::_safe_oop, obj,
             klass == nullptr || Metaspace::contains(klass),
-            "Instance class mirror should point to Metaspace");
+            "Mirrored instance class should point to Metaspace");
 
-      Metadata* array_klass = obj->metadata_field(java_lang_Class::array_klass_offset());
+      const Metadata* array_klass = obj->metadata_field(java_lang_Class::array_klass_offset());
       check(ShenandoahAsserts::_safe_oop, obj,
             array_klass == nullptr || Metaspace::contains(array_klass),
-            "Array class mirror should point to Metaspace");
+            "Mirrored array class should point to Metaspace");
     }
 
     // ------------ obj and fwd are safe at this point --------------
     switch (_options._verify_marked) {
       case ShenandoahVerifier::_verify_marked_disable:
diff a/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.cpp b/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.cpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.cpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.cpp
@@ -28,12 +28,12 @@
 #include "gc/shenandoah/shenandoahHeap.hpp"
 #include "gc/shenandoah/shenandoahHeapRegionClosures.hpp"
 #include "gc/shenandoah/shenandoahUtils.hpp"
 #include "gc/shenandoah/shenandoahYoungGeneration.hpp"
 
-ShenandoahYoungGeneration::ShenandoahYoungGeneration(uint max_queues, size_t max_capacity, size_t soft_max_capacity) :
-  ShenandoahGeneration(YOUNG, max_queues, max_capacity, soft_max_capacity),
+ShenandoahYoungGeneration::ShenandoahYoungGeneration(uint max_queues, size_t max_capacity) :
+  ShenandoahGeneration(YOUNG, max_queues, max_capacity),
   _old_gen_task_queues(nullptr) {
 }
 
 void ShenandoahYoungGeneration::set_concurrent_mark_in_progress(bool in_progress) {
   ShenandoahHeap* heap = ShenandoahHeap::heap();
diff a/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.hpp b/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.hpp
--- a/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.hpp
+++ b/src/hotspot/share/gc/shenandoah/shenandoahYoungGeneration.hpp
@@ -32,11 +32,11 @@
 private:
   ShenandoahObjToScanQueueSet* _old_gen_task_queues;
   ShenandoahYoungHeuristics* _young_heuristics;
 
 public:
-  ShenandoahYoungGeneration(uint max_queues, size_t max_capacity, size_t max_soft_capacity);
+  ShenandoahYoungGeneration(uint max_queues, size_t max_capacity);
 
   ShenandoahHeuristics* initialize_heuristics(ShenandoahMode* gc_mode) override;
 
   const char* name() const override {
     return "Young";
diff a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
--- a/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
+++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
@@ -25,10 +25,11 @@
 #include "classfile/javaClasses.inline.hpp"
 #include "classfile/stringTable.hpp"
 #include "classfile/symbolTable.hpp"
 #include "classfile/systemDictionary.hpp"
 #include "classfile/vmClasses.hpp"
+#include "code/nmethod.hpp"
 #include "code/scopeDesc.hpp"
 #include "compiler/compileBroker.hpp"
 #include "compiler/compilerEvent.hpp"
 #include "compiler/compilerOracle.hpp"
 #include "compiler/disassembler.hpp"
@@ -1204,21 +1205,29 @@
     if (installed_code_handle.is_non_null()) {
       if (cb->is_nmethod()) {
         assert(JVMCIENV->isa_HotSpotNmethod(installed_code_handle), "wrong type");
         // Clear the link to an old nmethod first
         JVMCIObject nmethod_mirror = installed_code_handle;
-        JVMCIENV->invalidate_nmethod_mirror(nmethod_mirror, true, JVMCI_CHECK_0);
+        JVMCIENV->invalidate_nmethod_mirror(nmethod_mirror, true, nmethod::InvalidationReason::JVMCI_REPLACED_WITH_NEW_CODE, JVMCI_CHECK_0);
       } else {
         assert(JVMCIENV->isa_InstalledCode(installed_code_handle), "wrong type");
       }
       // Initialize the link to the new code blob
       JVMCIENV->initialize_installed_code(installed_code_handle, cb, JVMCI_CHECK_0);
     }
   }
   return result;
 C2V_END
 
+C2V_VMENTRY_0(jobject, getInvalidationReasonDescription, (JNIEnv *env, jobject, jint invalidation_reason))
+  HandleMark hm(THREAD);
+  JNIHandleMark jni_hm(thread);
+  nmethod::InvalidationReason reason = static_cast<nmethod::InvalidationReason>(invalidation_reason);
+  JVMCIObject desc = JVMCIENV->create_string(nmethod::invalidation_reason_to_string(reason), JVMCI_CHECK_NULL);
+  return JVMCIENV->get_jobject(desc);
+C2V_END
+
 C2V_VMENTRY(void, resetCompilationStatistics, (JNIEnv* env, jobject))
   JVMCICompiler* compiler = JVMCICompiler::instance(true, CHECK);
   CompilerStatistics* stats = compiler->stats();
   stats->_standard.reset();
   stats->_osr.reset();
@@ -1380,11 +1389,11 @@
   }
   NOT_PRODUCT(method->set_compiled_invocation_count(0));
 
   nmethod* code = method->code();
   if (code != nullptr) {
-    code->make_not_entrant("JVMCI reprofile");
+    code->make_not_entrant(nmethod::InvalidationReason::JVMCI_REPROFILE);
   }
 
   MethodData* method_data = method->method_data();
   if (method_data == nullptr) {
     method_data = get_profiling_method_data(method, CHECK);
@@ -1393,13 +1402,18 @@
     method_data->reinitialize();
   }
 C2V_END
 
 
-C2V_VMENTRY(void, invalidateHotSpotNmethod, (JNIEnv* env, jobject, jobject hs_nmethod, jboolean deoptimize))
+C2V_VMENTRY(void, invalidateHotSpotNmethod, (JNIEnv* env, jobject, jobject hs_nmethod, jboolean deoptimize, jint invalidation_reason))
+  int first = static_cast<int>(nmethod::InvalidationReason::C1_CODEPATCH);
+  int last = static_cast<int>(nmethod::InvalidationReason::INVALIDATION_REASONS_COUNT);
+  if (invalidation_reason < first || invalidation_reason >= last) {
+    JVMCI_THROW_MSG(IllegalArgumentException, err_msg("Invalid invalidation_reason: %d", invalidation_reason));
+  }
   JVMCIObject nmethod_mirror = JVMCIENV->wrap(hs_nmethod);
-  JVMCIENV->invalidate_nmethod_mirror(nmethod_mirror, deoptimize, JVMCI_CHECK);
+  JVMCIENV->invalidate_nmethod_mirror(nmethod_mirror, deoptimize, static_cast<nmethod::InvalidationReason>(invalidation_reason), JVMCI_CHECK);
 C2V_END
 
 C2V_VMENTRY_NULL(jlongArray, collectCounters, (JNIEnv* env, jobject))
   // Returns a zero length array if counters aren't enabled
   JVMCIPrimitiveArray array = JVMCIENV->new_longArray(JVMCICounterSize, JVMCI_CHECK_NULL);
@@ -1820,11 +1834,11 @@
 
   if (invalidate) {
     if (!fst.current()->is_compiled_frame()) {
       JVMCI_THROW_MSG(IllegalStateException, "compiled stack frame expected");
     }
-    fst.current()->cb()->as_nmethod()->make_not_entrant("JVMCI materialize virtual objects");
+    fst.current()->cb()->as_nmethod()->make_not_entrant(nmethod::InvalidationReason::JVMCI_MATERIALIZE_VIRTUAL_OBJECT);
   }
   Deoptimization::deoptimize(thread, *fst.current(), Deoptimization::Reason_none);
   // look for the frame again as it has been updated by deopt (pc, deopt state...)
   StackFrameStream fstAfterDeopt(thread, true /* update */, true /* process_frames */);
   while (fstAfterDeopt.current()->id() != stack_pointer && !fstAfterDeopt.is_done()) {
@@ -3349,19 +3363,20 @@
   {CC "getResolvedJavaMethod",                        CC "(" OBJECTCONSTANT "J)" HS_METHOD,                                                 FN_PTR(getResolvedJavaMethod)},
   {CC "getConstantPool",                              CC "(" OBJECT "JZ)" HS_CONSTANT_POOL,                                                 FN_PTR(getConstantPool)},
   {CC "getResolvedJavaType0",                         CC "(Ljava/lang/Object;JZ)" HS_KLASS,                                                 FN_PTR(getResolvedJavaType0)},
   {CC "readConfiguration",                            CC "()[" OBJECT,                                                                      FN_PTR(readConfiguration)},
   {CC "installCode0",                                 CC "(JJZ" HS_COMPILED_CODE "[" OBJECT INSTALLED_CODE "J[B)I",                         FN_PTR(installCode0)},
+  {CC "getInvalidationReasonDescription",             CC "(I)" STRING,                                                                      FN_PTR(getInvalidationReasonDescription)},
   {CC "getInstallCodeFlags",                          CC "()I",                                                                             FN_PTR(getInstallCodeFlags)},
   {CC "resetCompilationStatistics",                   CC "()V",                                                                             FN_PTR(resetCompilationStatistics)},
   {CC "disassembleCodeBlob",                          CC "(" INSTALLED_CODE ")" STRING,                                                     FN_PTR(disassembleCodeBlob)},
   {CC "executeHotSpotNmethod",                        CC "([" OBJECT HS_NMETHOD ")" OBJECT,                                                 FN_PTR(executeHotSpotNmethod)},
   {CC "getLineNumberTable",                           CC "(" HS_METHOD2 ")[J",                                                              FN_PTR(getLineNumberTable)},
   {CC "getLocalVariableTableStart",                   CC "(" HS_METHOD2 ")J",                                                               FN_PTR(getLocalVariableTableStart)},
   {CC "getLocalVariableTableLength",                  CC "(" HS_METHOD2 ")I",                                                               FN_PTR(getLocalVariableTableLength)},
   {CC "reprofile",                                    CC "(" HS_METHOD2 ")V",                                                               FN_PTR(reprofile)},
-  {CC "invalidateHotSpotNmethod",                     CC "(" HS_NMETHOD "Z)V",                                                              FN_PTR(invalidateHotSpotNmethod)},
+  {CC "invalidateHotSpotNmethod",                     CC "(" HS_NMETHOD "ZI)V",                                                             FN_PTR(invalidateHotSpotNmethod)},
   {CC "collectCounters",                              CC "()[J",                                                                            FN_PTR(collectCounters)},
   {CC "getCountersSize",                              CC "()I",                                                                             FN_PTR(getCountersSize)},
   {CC "setCountersSize",                              CC "(I)Z",                                                                            FN_PTR(setCountersSize)},
   {CC "allocateCompileId",                            CC "(" HS_METHOD2 "I)I",                                                              FN_PTR(allocateCompileId)},
   {CC "isMature",                                     CC "(J)Z",                                                                            FN_PTR(isMature)},
diff a/src/hotspot/share/jvmci/jvmciEnv.cpp b/src/hotspot/share/jvmci/jvmciEnv.cpp
--- a/src/hotspot/share/jvmci/jvmciEnv.cpp
+++ b/src/hotspot/share/jvmci/jvmciEnv.cpp
@@ -1748,11 +1748,11 @@
   set_HotSpotInstalledCode_codeStart(installed_code, (jlong) cb->code_begin());
   set_HotSpotInstalledCode_codeSize(installed_code, cb->code_size());
 }
 
 
-void JVMCIEnv::invalidate_nmethod_mirror(JVMCIObject mirror, bool deoptimize, JVMCI_TRAPS) {
+void JVMCIEnv::invalidate_nmethod_mirror(JVMCIObject mirror, bool deoptimize, nmethod::InvalidationReason invalidation_reason, JVMCI_TRAPS) {
   if (mirror.is_null()) {
     JVMCI_THROW(NullPointerException);
   }
 
   Thread* current = Thread::current();
@@ -1771,20 +1771,20 @@
     return;
   }
 
   if (!deoptimize) {
     // Prevent future executions of the nmethod but let current executions complete.
-    nm->make_not_entrant("JVMCI invalidate nmethod mirror");
+    nm->make_not_entrant(invalidation_reason);
 
     // Do not clear the address field here as the Java code may still
     // want to later call this method with deoptimize == true. That requires
     // the address field to still be pointing at the nmethod.
    } else {
     // Deoptimize the nmethod immediately.
     DeoptimizationScope deopt_scope;
     deopt_scope.mark(nm);
-    nm->make_not_entrant("JVMCI invalidate nmethod mirror");
+    nm->make_not_entrant(invalidation_reason);
     nm->make_deoptimized();
     deopt_scope.deoptimize_marked();
 
     // A HotSpotNmethod instance can only reference a single nmethod
     // during its lifetime so simply clear it here.
diff a/src/hotspot/share/jvmci/jvmciEnv.hpp b/src/hotspot/share/jvmci/jvmciEnv.hpp
--- a/src/hotspot/share/jvmci/jvmciEnv.hpp
+++ b/src/hotspot/share/jvmci/jvmciEnv.hpp
@@ -460,11 +460,11 @@
 
   // Updates the nmethod (if any) in the HotSpotNmethod.address
   // field of `mirror` to prevent it from being called.
   // If `deoptimize` is true, the nmethod is immediately deoptimized.
   // The HotSpotNmethod.address field is zero upon returning.
-  void invalidate_nmethod_mirror(JVMCIObject mirror, bool deoptimze, JVMCI_TRAPS);
+  void invalidate_nmethod_mirror(JVMCIObject mirror, bool deoptimze, nmethod::InvalidationReason invalidation_reason, JVMCI_TRAPS);
 
   void initialize_installed_code(JVMCIObject installed_code, CodeBlob* cb, JVMCI_TRAPS);
 
  private:
   JVMCICompileState* _compile_state;
diff a/src/hotspot/share/jvmci/jvmciJavaClasses.hpp b/src/hotspot/share/jvmci/jvmciJavaClasses.hpp
--- a/src/hotspot/share/jvmci/jvmciJavaClasses.hpp
+++ b/src/hotspot/share/jvmci/jvmciJavaClasses.hpp
@@ -100,10 +100,11 @@
   end_class                                                                                                   \
   start_class(HotSpotNmethod, jdk_vm_ci_hotspot_HotSpotNmethod)                                               \
     boolean_field(HotSpotNmethod, isDefault)                                                                  \
     long_field(HotSpotNmethod, compileIdSnapshot)                                                             \
     object_field(HotSpotNmethod, method, "Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl;")                 \
+    int_field(HotSpotNmethod, invalidationReason)                                                             \
     jvmci_constructor(HotSpotNmethod, "(Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl;Ljava/lang/String;ZJ)V") \
   end_class                                                                                                   \
   start_class(HotSpotCompiledCode, jdk_vm_ci_hotspot_HotSpotCompiledCode)                                     \
     primarray_field(HotSpotCompiledCode, targetCode, "[B")                                                    \
     primarray_field(HotSpotCompiledCode, dataSection, "[B")                                                   \
diff a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp
@@ -795,11 +795,11 @@
   // (re)register it with the heap.
   MutexLocker ml(CodeCache_lock, Mutex::_no_safepoint_check_flag);
   Universe::heap()->register_nmethod(nm);
 }
 
-void JVMCINMethodData::invalidate_nmethod_mirror(nmethod* nm) {
+void JVMCINMethodData::invalidate_nmethod_mirror(nmethod* nm, nmethod::InvalidationReason invalidation_reason) {
   oop nmethod_mirror = get_nmethod_mirror(nm);
   if (nmethod_mirror == nullptr) {
     return;
   }
 
@@ -814,16 +814,24 @@
       // future invocations via the mirror will result in
       // an InvalidInstalledCodeException.
       HotSpotJVMCI::InstalledCode::set_address(jvmciEnv, nmethod_mirror, 0);
       HotSpotJVMCI::InstalledCode::set_entryPoint(jvmciEnv, nmethod_mirror, 0);
       HotSpotJVMCI::HotSpotInstalledCode::set_codeStart(jvmciEnv, nmethod_mirror, 0);
+      if (HotSpotJVMCI::HotSpotNmethod::invalidationReason(jvmciEnv, nmethod_mirror) ==
+        static_cast<int>(nmethod::InvalidationReason::NOT_INVALIDATED)) {
+        HotSpotJVMCI::HotSpotNmethod::set_invalidationReason(jvmciEnv, nmethod_mirror, static_cast<int>(invalidation_reason));
+      }
     } else if (nm->is_not_entrant()) {
       // Zero the entry point so any new invocation will fail but keep
       // the address link around that so that existing activations can
       // be deoptimized via the mirror (i.e. JVMCIEnv::invalidate_installed_code).
       HotSpotJVMCI::InstalledCode::set_entryPoint(jvmciEnv, nmethod_mirror, 0);
       HotSpotJVMCI::HotSpotInstalledCode::set_codeStart(jvmciEnv, nmethod_mirror, 0);
+      if (HotSpotJVMCI::HotSpotNmethod::invalidationReason(jvmciEnv, nmethod_mirror) ==
+        static_cast<int>(nmethod::InvalidationReason::NOT_INVALIDATED)) {
+        HotSpotJVMCI::HotSpotNmethod::set_invalidationReason(jvmciEnv, nmethod_mirror, static_cast<int>(invalidation_reason));
+      }
     }
   }
 
   if (_nmethod_mirror_index != -1 && nm->is_unloading()) {
     // Drop the reference to the nmethod mirror object but don't clear the actual oop reference.  Otherwise
@@ -2182,11 +2190,11 @@
               ResourceMark rm;
               char *method_name = method->name_and_sig_as_C_string();
               tty->print_cr("Replacing method %s", method_name);
             }
             if (old != nullptr) {
-              old->make_not_entrant("JVMCI register method");
+              old->make_not_entrant(nmethod::InvalidationReason::JVMCI_REPLACED_WITH_NEW_CODE);
             }
 
             LogTarget(Info, nmethod, install) lt;
             if (lt.is_enabled()) {
               ResourceMark rm;
diff a/src/hotspot/share/jvmci/jvmciRuntime.hpp b/src/hotspot/share/jvmci/jvmciRuntime.hpp
--- a/src/hotspot/share/jvmci/jvmciRuntime.hpp
+++ b/src/hotspot/share/jvmci/jvmciRuntime.hpp
@@ -119,11 +119,11 @@
   // Gets the JVMCI name of the nmethod (which may be null).
   const char* name() { return _has_name ? (char*)(((address) this) + sizeof(JVMCINMethodData)) : nullptr; }
 
   // Clears the HotSpotNmethod.address field in the  mirror. If nm
   // is dead, the HotSpotNmethod.entryPoint field is also cleared.
-  void invalidate_nmethod_mirror(nmethod* nm);
+  void invalidate_nmethod_mirror(nmethod* nm, nmethod::InvalidationReason invalidation_reason);
 
   // Gets the mirror from nm's oops table.
   oop get_nmethod_mirror(nmethod* nm);
 
   // Sets the mirror in nm's oops table.
diff a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
--- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
+++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp
@@ -562,11 +562,34 @@
                                                                           \
   declare_constant_with_value("CardTable::dirty_card", CardTable::dirty_card_val()) \
   declare_constant_with_value("LockStack::_end_offset", LockStack::end_offset()) \
   declare_constant_with_value("OMCache::oop_to_oop_difference", OMCache::oop_to_oop_difference()) \
   declare_constant_with_value("OMCache::oop_to_monitor_difference", OMCache::oop_to_monitor_difference()) \
-                                                                          \
+                                                                                          \
+  declare_constant(nmethod::InvalidationReason::NOT_INVALIDATED)                          \
+  declare_constant(nmethod::InvalidationReason::C1_CODEPATCH)                             \
+  declare_constant(nmethod::InvalidationReason::C1_DEOPTIMIZE)                            \
+  declare_constant(nmethod::InvalidationReason::C1_DEOPTIMIZE_FOR_PATCHING)               \
+  declare_constant(nmethod::InvalidationReason::C1_PREDICATE_FAILED_TRAP)                 \
+  declare_constant(nmethod::InvalidationReason::CI_REPLAY)                                \
+  declare_constant(nmethod::InvalidationReason::UNLOADING)                                \
+  declare_constant(nmethod::InvalidationReason::UNLOADING_COLD)                           \
+  declare_constant(nmethod::InvalidationReason::JVMCI_INVALIDATE)                         \
+  declare_constant(nmethod::InvalidationReason::JVMCI_MATERIALIZE_VIRTUAL_OBJECT)         \
+  declare_constant(nmethod::InvalidationReason::JVMCI_REPLACED_WITH_NEW_CODE)             \
+  declare_constant(nmethod::InvalidationReason::JVMCI_REPROFILE)                          \
+  declare_constant(nmethod::InvalidationReason::MARKED_FOR_DEOPTIMIZATION)                \
+  declare_constant(nmethod::InvalidationReason::MISSING_EXCEPTION_HANDLER)                \
+  declare_constant(nmethod::InvalidationReason::NOT_USED)                                 \
+  declare_constant(nmethod::InvalidationReason::OSR_INVALIDATION_BACK_BRANCH)             \
+  declare_constant(nmethod::InvalidationReason::OSR_INVALIDATION_FOR_COMPILING_WITH_C1)   \
+  declare_constant(nmethod::InvalidationReason::OSR_INVALIDATION_OF_LOWER_LEVEL)          \
+  declare_constant(nmethod::InvalidationReason::SET_NATIVE_FUNCTION)                      \
+  declare_constant(nmethod::InvalidationReason::UNCOMMON_TRAP)                            \
+  declare_constant(nmethod::InvalidationReason::WHITEBOX_DEOPTIMIZATION)                  \
+  declare_constant(nmethod::InvalidationReason::ZOMBIE)                                   \
+                                                                                          \
   declare_constant(CodeInstaller::VERIFIED_ENTRY)                         \
   declare_constant(CodeInstaller::UNVERIFIED_ENTRY)                       \
   declare_constant(CodeInstaller::OSR_ENTRY)                              \
   declare_constant(CodeInstaller::EXCEPTION_HANDLER_ENTRY)                \
   declare_constant(CodeInstaller::DEOPT_HANDLER_ENTRY)                    \
diff a/src/hotspot/share/oops/compressedKlass.hpp b/src/hotspot/share/oops/compressedKlass.hpp
--- a/src/hotspot/share/oops/compressedKlass.hpp
+++ b/src/hotspot/share/oops/compressedKlass.hpp
@@ -249,10 +249,13 @@
   inline static void check_encodable(const void* addr);
   // Given a narrow Klass ID, check that it is valid according to current encoding
   inline static void check_valid_narrow_klass_id(narrowKlass nk);
 #endif
 
+  // Given a narrow Klass ID, returns true if it appears to be valid
+  inline static bool is_valid_narrow_klass_id(narrowKlass nk);
+
   // Returns whether the pointer is in the memory region used for encoding compressed
   // class pointers.  This includes CDS.
   static inline bool is_encodable(const void* addr) {
     // An address can only be encoded if:
     //
diff a/src/hotspot/share/oops/compressedKlass.inline.hpp b/src/hotspot/share/oops/compressedKlass.inline.hpp
--- a/src/hotspot/share/oops/compressedKlass.inline.hpp
+++ b/src/hotspot/share/oops/compressedKlass.inline.hpp
@@ -91,10 +91,15 @@
   assert(nk >= _lowest_valid_narrow_klass_id &&
          nk <= _highest_valid_narrow_klass_id, "narrowKlass ID out of range (%u)", nk);
 }
 #endif // ASSERT
 
+// Given a narrow Klass ID, returns true if it appears to be valid
+inline bool CompressedKlassPointers::is_valid_narrow_klass_id(narrowKlass nk) {
+  return nk >= _lowest_valid_narrow_klass_id && nk < _highest_valid_narrow_klass_id;
+}
+
 inline address CompressedKlassPointers::encoding_range_end() {
   const int max_bits = narrow_klass_pointer_bits() + _shift;
   return (address)((uintptr_t)_base + nth_bit(max_bits));
 }
 
diff a/src/hotspot/share/oops/instanceKlass.cpp b/src/hotspot/share/oops/instanceKlass.cpp
--- a/src/hotspot/share/oops/instanceKlass.cpp
+++ b/src/hotspot/share/oops/instanceKlass.cpp
@@ -470,11 +470,11 @@
   assert(class_name != nullptr, "invariant");
   ClassLoaderData* loader_data = parser.loader_data();
   assert(loader_data != nullptr, "invariant");
 
   InstanceKlass* ik;
-  const bool use_class_space = parser.klass_needs_narrow_id();
+  const bool use_class_space = UseClassMetaspaceForAllClasses || parser.klass_needs_narrow_id();
 
   // Allocation
   if (parser.is_instance_ref_klass()) {
     // java.lang.ref.Reference
     ik = new (loader_data, size, use_class_space, THREAD) InstanceRefKlass(parser);
@@ -3499,11 +3499,11 @@
 
   // Get rid of the osr methods for the same bci that have lower levels.
   for (int l = CompLevel_limited_profile; l < n->comp_level(); l++) {
     nmethod *inv = lookup_osr_nmethod(n->method(), n->osr_entry_bci(), l, true);
     if (inv != nullptr && inv->is_in_use()) {
-      inv->make_not_entrant("OSR invalidation of lower levels");
+      inv->make_not_entrant(nmethod::InvalidationReason::OSR_INVALIDATION_OF_LOWER_LEVEL);
     }
   }
 }
 
 // Remove osr nmethod from the list. Return true if found and removed.
diff a/src/hotspot/share/oops/klass.inline.hpp b/src/hotspot/share/oops/klass.inline.hpp
--- a/src/hotspot/share/oops/klass.inline.hpp
+++ b/src/hotspot/share/oops/klass.inline.hpp
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.
@@ -180,8 +180,8 @@
   // Classes that are never instantiated need no narrow Klass Id, since the
   // only point of having a narrow id is to put it into an object header. Keeping
   // never instantiated classes out of class space lessens the class space pressure.
   // For more details, see JDK-8338526.
   // Note: don't call this function before access flags are initialized.
-  return !is_abstract() && !is_interface();
+  return UseClassMetaspaceForAllClasses || (!is_abstract() && !is_interface());
 }
 #endif // SHARE_OOPS_KLASS_INLINE_HPP
diff a/src/hotspot/share/oops/method.cpp b/src/hotspot/share/oops/method.cpp
--- a/src/hotspot/share/oops/method.cpp
+++ b/src/hotspot/share/oops/method.cpp
@@ -1026,11 +1026,11 @@
   // This function can be called more than once. We must make sure that we always
   // use the latest registered method -> check if a stub already has been generated.
   // If so, we have to make it not_entrant.
   nmethod* nm = code(); // Put it into local variable to guard against concurrent updates
   if (nm != nullptr) {
-    nm->make_not_entrant("set native function");
+    nm->make_not_entrant(nmethod::InvalidationReason::SET_NATIVE_FUNCTION);
   }
 }
 
 
 bool Method::has_native_function() const {
diff a/src/hotspot/share/oops/oop.hpp b/src/hotspot/share/oops/oop.hpp
--- a/src/hotspot/share/oops/oop.hpp
+++ b/src/hotspot/share/oops/oop.hpp
@@ -88,10 +88,11 @@
   inline Klass* klass_or_null_acquire() const;
   // Get the klass without running any asserts.
   inline Klass* klass_without_asserts() const;
 
   void set_narrow_klass(narrowKlass nk) NOT_CDS_JAVA_HEAP_RETURN;
+  inline narrowKlass narrow_klass() const;
   inline void set_klass(Klass* k);
   static inline void release_set_klass(HeapWord* mem, Klass* k);
 
   // For klass field compression
   static inline void set_klass_gap(HeapWord* mem, int z);
diff a/src/hotspot/share/oops/oop.inline.hpp b/src/hotspot/share/oops/oop.inline.hpp
--- a/src/hotspot/share/oops/oop.inline.hpp
+++ b/src/hotspot/share/oops/oop.inline.hpp
@@ -139,10 +139,21 @@
     default:
       return _metadata._klass;
   }
 }
 
+narrowKlass oopDesc::narrow_klass() const {
+  switch (ObjLayout::klass_mode()) {
+    case ObjLayout::Compact:
+      return mark().narrow_klass();
+    case ObjLayout::Compressed:
+      return _metadata._compressed_klass;
+    default:
+      ShouldNotReachHere();
+  }
+}
+
 void oopDesc::set_klass(Klass* k) {
   assert(Universe::is_bootstrapping() || (k != nullptr && k->is_klass()), "incorrect Klass");
   assert(!UseCompactObjectHeaders, "don't set Klass* with compact headers");
   if (UseCompressedClassPointers) {
     _metadata._compressed_klass = CompressedKlassPointers::encode_not_null(k);
diff a/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp b/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp
--- a/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp
+++ b/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp
@@ -994,10 +994,15 @@
   Bytes::put_Java_u8(writeable_address(8), x);
 }
 
 void JvmtiClassFileReconstituter::copy_bytecodes(const methodHandle& mh,
                                                  unsigned char* bytecodes) {
+  // We must copy bytecodes only from linked classes.
+  // Being linked guarantees we are not getting bytecodes at
+  // the same time the linking process is rewriting them.
+  guarantee(mh->method_holder()->is_linked(), "Bytecodes must be copied from a linked class");
+
   // use a BytecodeStream to iterate over the bytecodes. JVM/fast bytecodes
   // and the breakpoint bytecode are converted to their original bytecodes.
 
   BytecodeStream bs(mh);
 
diff a/src/hotspot/share/prims/jvmtiEnv.cpp b/src/hotspot/share/prims/jvmtiEnv.cpp
--- a/src/hotspot/share/prims/jvmtiEnv.cpp
+++ b/src/hotspot/share/prims/jvmtiEnv.cpp
@@ -449,10 +449,22 @@
       return JVMTI_ERROR_INVALID_CLASS;
     }
 
     InstanceKlass* ik = InstanceKlass::cast(klass);
     if (ik->get_cached_class_file_bytes() == nullptr) {
+      // Link the class to avoid races with the rewriter. This will call the verifier also
+      // on the class. Linking is also done in VM_RedefineClasses below, but we need
+      // to keep that for other VM_RedefineClasses callers.
+      JavaThread* THREAD = current_thread;
+      ik->link_class(THREAD);
+      if (HAS_PENDING_EXCEPTION) {
+        // Retransform/JVMTI swallows error messages. Using this class will rerun the verifier in a context
+        // that propagates the VerifyError, if thrown.
+        CLEAR_PENDING_EXCEPTION;
+        return JVMTI_ERROR_INVALID_CLASS;
+      }
+
       // Not cached, we need to reconstitute the class file from the
       // VM representation. We don't attach the reconstituted class
       // bytes to the InstanceKlass here because they have not been
       // validated and we're not at a safepoint.
       JvmtiClassFileReconstituter reconstituter(ik);
@@ -3426,19 +3438,27 @@
 // bytecodes_ptr - pre-checked for null
 jvmtiError
 JvmtiEnv::GetBytecodes(Method* method, jint* bytecode_count_ptr, unsigned char** bytecodes_ptr) {
   NULL_CHECK(method, JVMTI_ERROR_INVALID_METHODID);
 
-  methodHandle mh(Thread::current(), method);
+  JavaThread* current_thread = JavaThread::current();
+  methodHandle mh(current_thread, method);
   jint size = (jint)mh->code_size();
   jvmtiError err = allocate(size, bytecodes_ptr);
   if (err != JVMTI_ERROR_NONE) {
     return err;
   }
 
   (*bytecode_count_ptr) = size;
   // get byte codes
+  // Make sure the class is verified and rewritten first.
+  JavaThread* THREAD = current_thread;
+  mh->method_holder()->link_class(THREAD);
+  if (HAS_PENDING_EXCEPTION) {
+    CLEAR_PENDING_EXCEPTION;
+    return JVMTI_ERROR_INVALID_CLASS;
+  }
   JvmtiClassFileReconstituter::copy_bytecodes(mh, *bytecodes_ptr);
 
   return JVMTI_ERROR_NONE;
 } /* end GetBytecodes */
 
diff a/src/hotspot/share/prims/whitebox.cpp b/src/hotspot/share/prims/whitebox.cpp
--- a/src/hotspot/share/prims/whitebox.cpp
+++ b/src/hotspot/share/prims/whitebox.cpp
@@ -792,11 +792,11 @@
           if (f->can_be_deoptimized() && !f->is_deoptimized_frame()) {
             Deoptimization::deoptimize(t, *f);
             if (_make_not_entrant) {
                 nmethod* nm = CodeCache::find_nmethod(f->pc());
                 assert(nm != nullptr, "did not find nmethod");
-                nm->make_not_entrant("Whitebox deoptimization");
+                nm->make_not_entrant(nmethod::InvalidationReason::WHITEBOX_DEOPTIMIZATION);
             }
             ++_result;
           }
         }
       }
diff a/src/hotspot/share/runtime/deoptimization.cpp b/src/hotspot/share/runtime/deoptimization.cpp
--- a/src/hotspot/share/runtime/deoptimization.cpp
+++ b/src/hotspot/share/runtime/deoptimization.cpp
@@ -1824,11 +1824,11 @@
 }
 
 #if INCLUDE_JVMCI
 address Deoptimization::deoptimize_for_missing_exception_handler(nmethod* nm) {
   // there is no exception handler for this pc => deoptimize
-  nm->make_not_entrant("missing exception handler");
+  nm->make_not_entrant(nmethod::InvalidationReason::MISSING_EXCEPTION_HANDLER);
 
   // Use Deoptimization::deoptimize for all of its side-effects:
   // gathering traps statistics, logging...
   // it also patches the return pc but we do not care about that
   // since we return a continuation to the deopt_blob below.
@@ -2453,11 +2453,11 @@
 
     // Take requested actions on the method:
 
     // Recompile
     if (make_not_entrant) {
-      if (!nm->make_not_entrant("uncommon trap")) {
+      if (!nm->make_not_entrant(nmethod::InvalidationReason::UNCOMMON_TRAP)) {
         return; // the call did not change nmethod's state
       }
 
       if (pdata != nullptr) {
         // Record the recompilation event, if any.
diff a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.cpp
@@ -137,5 +137,27 @@
     return JVMFlag::VIOLATES_CONSTRAINT;
   }
 
   return JVMFlag::SUCCESS;
 }
+
+JVMFlag::Error OnSpinWaitInstNameConstraintFunc(ccstr value, bool verbose) {
+#ifdef AARCH64
+  if (value == nullptr) {
+    JVMFlag::printError(verbose, "OnSpinWaitInst cannot be empty\n");
+    return JVMFlag::VIOLATES_CONSTRAINT;
+  }
+
+  if (strcmp(value, "nop")   != 0 &&
+      strcmp(value, "isb")   != 0 &&
+      strcmp(value, "yield") != 0 &&
+      strcmp(value, "sb")    != 0 &&
+      strcmp(value, "none")  != 0) {
+    JVMFlag::printError(verbose,
+                        "Unrecognized value %s for OnSpinWaitInst. Must be one of the following: "
+                        "nop, isb, yield, sb, none\n",
+                        value);
+    return JVMFlag::VIOLATES_CONSTRAINT;
+  }
+#endif
+  return JVMFlag::SUCCESS;
+}
diff a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
--- a/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
+++ b/src/hotspot/share/runtime/flags/jvmFlagConstraintsRuntime.hpp
@@ -39,10 +39,11 @@
   f(ccstr,  AOTModeConstraintFunc)                    \
   f(int,    ObjectAlignmentInBytesConstraintFunc)     \
   f(int,    ContendedPaddingWidthConstraintFunc)      \
   f(int,    PerfDataSamplingIntervalFunc)             \
   f(uintx,  VMPageSizeConstraintFunc)                 \
-  f(size_t, NUMAInterleaveGranularityConstraintFunc)
+  f(size_t, NUMAInterleaveGranularityConstraintFunc)  \
+  f(ccstr,  OnSpinWaitInstNameConstraintFunc)
 
 RUNTIME_CONSTRAINTS(DECLARE_CONSTRAINT)
 
 #endif // SHARE_RUNTIME_FLAGS_JVMFLAGCONSTRAINTSRUNTIME_HPP
diff a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -2007,10 +2007,14 @@
           "contention on Threads_lock.")                                    \
                                                                             \
   develop(uint, BinarySearchThreshold, 16,                                  \
           "Minimal number of elements in a sorted collection to prefer"     \
           "binary search over simple linear search." )                      \
+                                                                            \
+  product(bool, UseClassMetaspaceForAllClasses, true, DIAGNOSTIC,           \
+          "Use the class metaspace for all classes including "              \
+          "abstract and interface classes.")                                \
 
 // end of RUNTIME_FLAGS
 
 DECLARE_FLAGS(LP64_RUNTIME_FLAGS)
 DECLARE_ARCH_FLAGS(ARCH_FLAGS)
diff a/src/hotspot/share/runtime/javaThread.cpp b/src/hotspot/share/runtime/javaThread.cpp
--- a/src/hotspot/share/runtime/javaThread.cpp
+++ b/src/hotspot/share/runtime/javaThread.cpp
@@ -1337,11 +1337,11 @@
   for (StackFrameStream fst(this, true /* update */, true /* process_frames */); !fst.is_done(); fst.next()) {
     if (fst.current()->can_be_deoptimized()) {
       // it is a Java nmethod
       nmethod* nm = CodeCache::find_nmethod(fst.current()->pc());
       assert(nm != nullptr, "did not find nmethod");
-      nm->make_not_entrant("zombie");
+      nm->make_not_entrant(nmethod::InvalidationReason::ZOMBIE);
     }
   }
 }
 #endif // PRODUCT
 
diff a/src/hotspot/share/utilities/ostream.hpp b/src/hotspot/share/utilities/ostream.hpp
--- a/src/hotspot/share/utilities/ostream.hpp
+++ b/src/hotspot/share/utilities/ostream.hpp
@@ -180,11 +180,11 @@
   const int           _indentation;
   const bool          _old_autoindent;
   NONCOPYABLE(StreamIndentor);
 
  public:
-  StreamIndentor(outputStream* os, int indentation) :
+  StreamIndentor(outputStream* os, int indentation = 2) :
     _stream(os),
     _indentation(indentation),
     _old_autoindent(_stream->set_autoindent(true)) {
 
     _stream->inc(_indentation);
diff a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/aarch64/AArch64.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/aarch64/AArch64.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/aarch64/AArch64.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/aarch64/AArch64.java
@@ -177,10 +177,11 @@
         LSE,
         DCPOP,
         SHA3,
         SHA512,
         SVE,
+        SB,
         PACA,
         SVEBITPERM,
         SVE2,
         A53MAC,
         FPHP,
diff a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/CompilerToVM.java
@@ -652,10 +652,12 @@
                     Object[] objectPool,
                     InstalledCode code,
                     long failedSpeculationsAddress,
                     byte[] speculations);
 
+    native String getInvalidationReasonDescription(int invalidationReason);
+
     /**
      * Gets flags specifying optional parts of code info. Only if a flag is set, will the
      * corresponding code info being included in the {@linkplain HotSpotCompiledCodeStream
      * serialized code stream}.
      *
@@ -840,11 +842,11 @@
      * Updates {@code nmethodMirror} such that {@link InvalidInstalledCodeException} will be raised
      * the next time {@code nmethodMirror} is {@linkplain #executeHotSpotNmethod executed}. The
      * {@code nmethod} associated with {@code nmethodMirror} is also made non-entrant and if
      * {@code deoptimize == true} any current activations of the {@code nmethod} are deoptimized.
      */
-    native void invalidateHotSpotNmethod(HotSpotNmethod nmethodMirror, boolean deoptimize);
+    native void invalidateHotSpotNmethod(HotSpotNmethod nmethodMirror, boolean deoptimize, int invalidationReason);
 
     /**
      * Collects the current values of all JVMCI benchmark counters, summed up over all threads.
      */
     native long[] collectCounters();
diff a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java
@@ -152,20 +152,24 @@
             }
         }
         return logOrDump(resultInstalledCode, compiledCode);
     }
 
-    @Override
-    public void invalidateInstalledCode(InstalledCode installedCode) {
+    public void invalidateInstalledCode(InstalledCode installedCode, int invalidationReason) {
         if (installedCode instanceof HotSpotNmethod) {
             HotSpotNmethod nmethod = (HotSpotNmethod) installedCode;
-            nmethod.invalidate(true);
+            nmethod.invalidate(true, invalidationReason);
         } else {
             throw new IllegalArgumentException("Cannot invalidate a " + Objects.requireNonNull(installedCode).getClass().getName());
         }
     }
 
+    @Override
+    public void invalidateInstalledCode(InstalledCode installedCode) {
+        invalidateInstalledCode(installedCode, jvmciInvalidationReason());
+    }
+
     @Override
     public TargetDescription getTarget() {
         return target;
     }
 
@@ -199,6 +203,10 @@
      * Resets all compilation statistics.
      */
     public void resetCompilationStatistics() {
         runtime.getCompilerToVM().resetCompilationStatistics();
     }
+
+    private static int jvmciInvalidationReason() {
+        return HotSpotJVMCIRuntime.runtime().config.getConstant("nmethod::InvalidationReason::JVMCI_INVALIDATE", Integer.class);
+    }
 }
diff a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2014, 2024, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.
@@ -93,11 +93,11 @@
         }
         return canBeStoredInCompressibleMetaSpace();
     }
 
     private boolean canBeStoredInCompressibleMetaSpace() {
-        if (metaspaceObject instanceof HotSpotResolvedJavaType t && !t.isArray()) {
+        if (!HotSpotVMConfig.config().useClassMetaspaceForAllClasses && metaspaceObject instanceof HotSpotResolvedJavaType t && !t.isArray()) {
             // As of JDK-8338526, interface and abstract types are not stored
             // in compressible metaspace.
             return !t.isInterface() && !t.isAbstract();
         }
         return true;
diff a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotNmethod.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotNmethod.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotNmethod.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotNmethod.java
@@ -25,10 +25,11 @@
 import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM;
 import static jdk.vm.ci.services.Services.IS_IN_NATIVE_IMAGE;
 
 import jdk.vm.ci.code.InstalledCode;
 import jdk.vm.ci.code.InvalidInstalledCodeException;
+import jdk.vm.ci.common.JVMCIError;
 import jdk.vm.ci.meta.JavaKind;
 import jdk.vm.ci.meta.JavaType;
 import jdk.vm.ci.meta.ResolvedJavaMethod;
 
 /**
@@ -74,16 +75,23 @@
      *
      * @see #inOopsTable
      */
     private final long compileIdSnapshot;
 
+    /**
+     * Identify the reason that caused this nmethod to be invalidated.
+     * A value of -1 means that the nmethod was not invalidated.
+     */
+    private int invalidationReason;
+
     HotSpotNmethod(HotSpotResolvedJavaMethodImpl method, String name, boolean isDefault, long compileId) {
         super(name);
         this.method = method;
         this.isDefault = isDefault;
         boolean inOopsTable = !IS_IN_NATIVE_IMAGE && !isDefault;
         this.compileIdSnapshot = inOopsTable ? 0L : compileId;
+        this.invalidationReason = -1;
         assert inOopsTable || compileId != 0L : this;
     }
 
     /**
      * Attaches {@code log} to this object. If {@code log.managesFailedSpeculations() == true}, this
@@ -120,13 +128,23 @@
 
     public ResolvedJavaMethod getMethod() {
         return method;
     }
 
+    /**
+     * Invalidate this nmethod using the reason specified in {@code invalidationReason} and
+     * optionally deoptimize the method if {@code deoptimize} is set.
+     * @param deoptimize whether or not to deoptimize the method.
+     * @param invalidationReason invalidation reason code.
+     */
+    public void invalidate(boolean deoptimize, int invalidationReason) {
+        compilerToVM().invalidateHotSpotNmethod(this, deoptimize, invalidationReason);
+    }
+
     @Override
     public void invalidate(boolean deoptimize) {
-        compilerToVM().invalidateHotSpotNmethod(this, deoptimize);
+        invalidate(deoptimize, jvmciInvalidationReason());
     }
 
     @Override
     public long getAddress() {
         if (compileIdSnapshot != 0L) {
@@ -186,6 +204,24 @@
 
     @Override
     public long getStart() {
         return isValid() ? super.getStart() : 0;
     }
+
+    /**
+     * @return an integer representing the reason why this nmethod was invalidated.
+     */
+    public int getInvalidationReason() {
+        return invalidationReason;
+    }
+
+    /**
+     * @return a String describing the reason why this nmethod was invalidated.
+     */
+    public String getInvalidationReasonDescription() {
+        return compilerToVM().getInvalidationReasonDescription(this.getInvalidationReason());
+    }
+
+    private static int jvmciInvalidationReason() {
+        return HotSpotJVMCIRuntime.runtime().config.getConstant("nmethod::InvalidationReason::JVMCI_INVALIDATE", Integer.class);
+    }
 }
diff a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfig.java b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfig.java
--- a/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfig.java
+++ b/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotVMConfig.java
@@ -1,7 +1,7 @@
 /*
- * 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.
@@ -65,10 +65,12 @@
 
     final boolean useDeferredInitBarriers = getFlag("ReduceInitialCardMarks", Boolean.class);
 
     final boolean useCompressedOops = getFlag("UseCompressedOops", Boolean.class);
 
+    final boolean useClassMetaspaceForAllClasses = getFlag("UseClassMetaspaceForAllClasses", Boolean.class);
+
     final int objectAlignment = getFlag("ObjectAlignmentInBytes", Integer.class);
 
     final int klassOffsetInBytes = getFieldValue("CompilerToVM::Data::oopDesc_klass_offset_in_bytes", Integer.class, "int");
 
     final int subklassOffset = getFieldOffset("Klass::_subklass", Integer.class, "Klass*");
diff a/test/hotspot/gtest/aarch64/aarch64-asmtest.py b/test/hotspot/gtest/aarch64/aarch64-asmtest.py
--- a/test/hotspot/gtest/aarch64/aarch64-asmtest.py
+++ b/test/hotspot/gtest/aarch64/aarch64-asmtest.py
@@ -1603,11 +1603,11 @@
                ])
 
 generate (Op, ["nop", "yield", "wfe", "sev", "sevl",
                "autia1716", "autiasp", "autiaz", "autib1716", "autibsp", "autibz",
                "pacia1716", "paciasp", "paciaz", "pacib1716", "pacibsp", "pacibz",
-               "eret", "drps", "isb",])
+               "eret", "drps", "isb", "sb",])
 
 # Ensure the "i" is not stripped off the end of the instruction
 generate (PostfixExceptionOp, ["wfi", "xpaclri"])
 
 barriers = ["OSHLD", "OSHST", "OSH", "NSHLD", "NSHST", "NSH",
diff a/test/hotspot/gtest/aarch64/asmtest.out.h b/test/hotspot/gtest/aarch64/asmtest.out.h
--- a/test/hotspot/gtest/aarch64/asmtest.out.h
+++ b/test/hotspot/gtest/aarch64/asmtest.out.h
@@ -185,10 +185,11 @@
     __ pacibsp();                                      //       pacibsp
     __ pacibz();                                       //       pacibz
     __ eret();                                         //       eret
     __ drps();                                         //       drps
     __ isb();                                          //       isb
+    __ sb();                                           //       sb
 
 // PostfixExceptionOp
     __ wfi();                                          //       wfi
     __ xpaclri();                                      //       xpaclri
 
@@ -1435,308 +1436,308 @@
     0x0aa70f53,     0x2aaa0f06,     0x4a6176a4,     0x6a604eb0,
     0x1105ed91,     0x3100583e,     0x5101f8bd,     0x710f0306,
     0x9101a1a0,     0xb10a5cc8,     0xd10810aa,     0xf10fd061,
     0x120cb166,     0x321764bc,     0x52174681,     0x720c0227,
     0x9241018e,     0xb25a2969,     0xd278b411,     0xf26aad01,
-    0x14000000,     0x17ffffd7,     0x140004af,     0x94000000,
-    0x97ffffd4,     0x940004ac,     0x3400000a,     0x34fffa2a,
-    0x3400952a,     0x35000008,     0x35fff9c8,     0x350094c8,
-    0xb400000b,     0xb4fff96b,     0xb400946b,     0xb500001d,
-    0xb5fff91d,     0xb500941d,     0x10000013,     0x10fff8b3,
-    0x100093b3,     0x90000013,     0x36300016,     0x3637f836,
-    0x36309336,     0x3758000c,     0x375ff7cc,     0x375892cc,
+    0x14000000,     0x17ffffd7,     0x140004b0,     0x94000000,
+    0x97ffffd4,     0x940004ad,     0x3400000a,     0x34fffa2a,
+    0x3400954a,     0x35000008,     0x35fff9c8,     0x350094e8,
+    0xb400000b,     0xb4fff96b,     0xb400948b,     0xb500001d,
+    0xb5fff91d,     0xb500943d,     0x10000013,     0x10fff8b3,
+    0x100093d3,     0x90000013,     0x36300016,     0x3637f836,
+    0x36309356,     0x3758000c,     0x375ff7cc,     0x375892ec,
     0x128313a0,     0x528a32c7,     0x7289173b,     0x92ab3acc,
     0xd2a0bf94,     0xf2c285e8,     0x9358722f,     0x330e652f,
     0x53067f3b,     0x93577c53,     0xb34a1aac,     0xd35a4016,
     0x13946c63,     0x93c3dbc8,     0x54000000,     0x54fff5a0,
-    0x540090a0,     0x54000001,     0x54fff541,     0x54009041,
-    0x54000002,     0x54fff4e2,     0x54008fe2,     0x54000002,
-    0x54fff482,     0x54008f82,     0x54000003,     0x54fff423,
-    0x54008f23,     0x54000003,     0x54fff3c3,     0x54008ec3,
-    0x54000004,     0x54fff364,     0x54008e64,     0x54000005,
-    0x54fff305,     0x54008e05,     0x54000006,     0x54fff2a6,
-    0x54008da6,     0x54000007,     0x54fff247,     0x54008d47,
-    0x54000008,     0x54fff1e8,     0x54008ce8,     0x54000009,
-    0x54fff189,     0x54008c89,     0x5400000a,     0x54fff12a,
-    0x54008c2a,     0x5400000b,     0x54fff0cb,     0x54008bcb,
-    0x5400000c,     0x54fff06c,     0x54008b6c,     0x5400000d,
-    0x54fff00d,     0x54008b0d,     0x5400000e,     0x54ffefae,
-    0x54008aae,     0x5400000f,     0x54ffef4f,     0x54008a4f,
+    0x540090c0,     0x54000001,     0x54fff541,     0x54009061,
+    0x54000002,     0x54fff4e2,     0x54009002,     0x54000002,
+    0x54fff482,     0x54008fa2,     0x54000003,     0x54fff423,
+    0x54008f43,     0x54000003,     0x54fff3c3,     0x54008ee3,
+    0x54000004,     0x54fff364,     0x54008e84,     0x54000005,
+    0x54fff305,     0x54008e25,     0x54000006,     0x54fff2a6,
+    0x54008dc6,     0x54000007,     0x54fff247,     0x54008d67,
+    0x54000008,     0x54fff1e8,     0x54008d08,     0x54000009,
+    0x54fff189,     0x54008ca9,     0x5400000a,     0x54fff12a,
+    0x54008c4a,     0x5400000b,     0x54fff0cb,     0x54008beb,
+    0x5400000c,     0x54fff06c,     0x54008b8c,     0x5400000d,
+    0x54fff00d,     0x54008b2d,     0x5400000e,     0x54ffefae,
+    0x54008ace,     0x5400000f,     0x54ffef4f,     0x54008a6f,
     0xd40658e1,     0xd4014d22,     0xd4046543,     0xd4273f60,
     0xd44cad80,     0xd503201f,     0xd503203f,     0xd503205f,
     0xd503209f,     0xd50320bf,     0xd503219f,     0xd50323bf,
     0xd503239f,     0xd50321df,     0xd50323ff,     0xd50323df,
     0xd503211f,     0xd503233f,     0xd503231f,     0xd503215f,
     0xd503237f,     0xd503235f,     0xd69f03e0,     0xd6bf03e0,
-    0xd5033fdf,     0xd503207f,     0xd50320ff,     0xd5033e9f,
-    0xd50332bf,     0xd61f0200,     0xd63f0280,     0xdac123ea,
-    0xdac127fb,     0xdac12be8,     0xdac12fe0,     0xdac133e1,
-    0xdac137f5,     0xdac13bf1,     0xdac13ffd,     0xdac147fd,
-    0xd61f0b9f,     0xd61f0c3f,     0xd63f0aff,     0xd63f0ebf,
-    0xd51b4434,     0xd51b4216,     0xd53b443b,     0xd53b4213,
-    0xd53b00eb,     0xd53b0030,     0xdac143e6,     0xc8117c80,
-    0xc80afed8,     0xc85f7e6a,     0xc85ffca1,     0xc89ffd1e,
-    0xc8dffe2c,     0x88097cee,     0x8801fe05,     0x885f7d82,
-    0x885ffd8a,     0x889fff83,     0x88dfff4e,     0x481e7dca,
-    0x4815fd2d,     0x485f7f76,     0x485ffe7c,     0x489fffcb,
-    0x48dffc53,     0x08027c37,     0x0800fe0c,     0x085f7ded,
-    0x085ffeb1,     0x089ffd6d,     0x08dffd1e,     0xc87f3578,
-    0xc87feaa1,     0xc83b506d,     0xc82c87a6,     0x887f1166,
-    0x887f93d0,     0x883e32a4,     0x883bf12f,     0xf80011f9,
-    0xb81b1022,     0x381ea354,     0x79002fd7,     0xf85cf39a,
-    0xb8580309,     0x385e218c,     0x784051e1,     0x389e11d8,
-    0x789fa1f8,     0x79c01865,     0xb881131b,     0xfc5dd3ad,
-    0xbc5d1137,     0xfc00900b,     0xbc181015,     0xf818ec7d,
-    0xb81b8c91,     0x381efc40,     0x78007c3d,     0xf857beb0,
-    0xb8413dd4,     0x385fddd6,     0x78409e2f,     0x389eddea,
-    0x789e7d94,     0x78de3d55,     0xb8805c13,     0xfc5cadc0,
-    0xbc428c23,     0xfc1a2dc4,     0xbc1caf92,     0xf81475f6,
-    0xb81f95d1,     0x381e757e,     0x78014561,     0xf8402436,
-    0xb85896e2,     0x385f4763,     0x785db4f0,     0x3880374f,
-    0x789e25e7,     0x78dd0563,     0xb88166f9,     0xfc529540,
-    0xbc4374d3,     0xfc1166ae,     0xbc1ba6c0,     0xf820ea7b,
-    0xb82d68c8,     0x38367a04,     0x782f4b59,     0xf878c8a4,
-    0xb8674a24,     0x386b78f1,     0x78776bc0,     0x38a15aca,
-    0x78bedbd5,     0x78fcd94b,     0xb8aa4a7c,     0xfc6ecbbe,
-    0xbc65d8a8,     0xfc2de919,     0xbc3a7b11,     0xf91f1193,
-    0xb91ed5f7,     0x391ec9bd,     0x79182ceb,     0xf95d4b0a,
-    0xb9581010,     0x395fc034,     0x795fb221,     0x399d8731,
-    0x799efb3b,     0x79dd1a2e,     0xb998e4ea,     0xfd583723,
-    0xbd5ea12c,     0xfd18dc38,     0xbd1b0e83,     0x58ffdaa2,
-    0x1800001d,     0xf885d1c0,     0xd8ffda40,     0xf8a77820,
-    0xf9980220,     0x1a030301,     0x3a140311,     0x5a0d000b,
-    0x7a07015c,     0x9a1001e4,     0xba140182,     0xda0d01bd,
-    0xfa0c00ce,     0x0b31f194,     0x2b206d7b,     0xcb29f027,
-    0x6b210f63,     0x8b2cb34d,     0xab2a88b1,     0xcb2f511e,
-    0xeb3332f3,     0x3a4533aa,     0x7a4d312b,     0xba442146,
-    0xfa42818c,     0x3a466a02,     0x7a4b68ed,     0xba4a9b6b,
-    0xfa4dd86d,     0x1a8a637a,     0x1a9cd6aa,     0x5a9bd137,
-    0x5a8fd7aa,     0x9a95233e,     0x9a95c620,     0xda9422b0,
-    0xda8397d3,     0x5ac00173,     0x5ac00418,     0x5ac00b3b,
-    0x5ac0106e,     0x5ac0162e,     0xdac001e7,     0xdac00798,
-    0xdac00b31,     0xdac00f42,     0xdac010bc,     0xdac01759,
-    0xdac1021b,     0xdac104d1,     0xdac10995,     0xdac10c80,
-    0xdac1136c,     0xdac11791,     0xdac1185c,     0xdac11d51,
-    0xd71f09ee,     0xd71f0dc3,     0xd73f0b2f,     0xd73f0e6e,
-    0x1ac40a05,     0x1ac40f3a,     0x1acc2042,     0x1ac8263d,
-    0x1ac42867,     0x1ada2c99,     0x9ad10899,     0x9ad10f40,
-    0x9ad521f7,     0x9adb263c,     0x9ac0286a,     0x9ac92f27,
-    0x9bdd7de6,     0x9b427d4f,     0x1b0b2cf1,     0x1b1ddcf7,
-    0x9b0b2f6e,     0x9b0cbf04,     0x9b2b728e,     0x9b2cdd6d,
-    0x9bae275e,     0x9ba7954d,     0x7ec315fe,     0x1ef0098c,
-    0x1ef21bff,     0x1ef02ab3,     0x1ef5394f,     0x1efc4942,
-    0x1eff5bc7,     0x1ee28832,     0x7ea3d546,     0x1e270979,
-    0x1e201981,     0x1e3d2a63,     0x1e263ae6,     0x1e3b4b80,
-    0x1e2758a2,     0x1e39899d,     0x7ef8d58d,     0x1e720913,
-    0x1e751b56,     0x1e622a74,     0x1e683ade,     0x1e754a76,
-    0x1e755a4c,     0x1e638a06,     0x1fc373a3,     0x1f0a35cf,
-    0x1f0aea4c,     0x1f2f74e7,     0x1f2032e0,     0x1f4d21d8,
-    0x1f49d0ef,     0x1f7f43b3,     0x1f705522,     0x1e20409e,
-    0x1e20c361,     0x1e214319,     0x1e21c2ae,     0x1e22c0cd,
-    0x1e23c32c,     0x1ee243d9,     0x1e6042bc,     0x1e60c2f0,
-    0x1e6143a5,     0x1e61c276,     0x1e62428d,     0x1ee1c393,
-    0x1e3800d1,     0x9e3800ed,     0x1e78035c,     0x9e7800d1,
-    0x1e220081,     0x9e22028e,     0x1e6202a7,     0x9e6202fb,
-    0x1e24028d,     0x9e64039e,     0x1e3002aa,     0x9e700225,
-    0x1e2601cb,     0x9e6602ad,     0x1e2701db,     0x9e6702e4,
-    0x1e3e2300,     0x1e6e2180,     0x1e202228,     0x1e602388,
-    0x29021b40,     0x297c78c0,     0x69660970,     0xa908018f,
-    0xa9427ae7,     0x29a03cfa,     0x29fc3d4b,     0x69c84033,
-    0xa988240e,     0xa9fa0d9b,     0x28a02d88,     0x28c8408a,
-    0x68f87a6a,     0xa8ba09f8,     0xa8c52a18,     0x280257be,
-    0x28727948,     0xa83868de,     0xa8440a98,     0x0c40733f,
-    0x4cdfa1e5,     0x0ccd6cea,     0x4cdf260d,     0x0d40c227,
-    0x4ddfcb30,     0x0dc7cc6b,     0x4c408ced,     0x0cdf8769,
-    0x4d60c346,     0x0dffca17,     0x4de8cda6,     0x4cda4834,
-    0x0c4049ef,     0x4d40e6dd,     0x4ddfe946,     0x0dcfeccf,
-    0x4cdf0546,     0x0cc7006b,     0x0d60e32c,     0x0dffe5eb,
-    0x0dfce8de,     0x0e31bb9b,     0x4e31bbbc,     0x0e71b841,
-    0x4e71bbbc,     0x4eb1b841,     0x0e30aab4,     0x4e30abdd,
-    0x0e70aa30,     0x4e70a9cd,     0x4eb0a96a,     0x6e30fbdd,
-    0x0e31abdd,     0x2e31aa93,     0x4e31aaf6,     0x6e31a96a,
-    0x0e71a8a4,     0x2e71a81f,     0x4e71aad5,     0x6e71a928,
-    0x4eb1a81f,     0x6eb1aa93,     0x6eb0f96a,     0x7e30fbbc,
-    0x7e70f862,     0x7eb0fb59,     0x7ef0f8c5,     0x0ea0c883,
-    0x4ea0c928,     0x4ee0caf6,     0x2ea0ca93,     0x6ea0c9cd,
-    0x6ee0c8c5,     0x0ea0dbdd,     0x4ea0db38,     0x4ee0dad5,
-    0x0ea0eb7a,     0x4ea0eb38,     0x4ee0e883,     0x2ea0db38,
-    0x6ea0db7a,     0x6ee0db17,     0x0e20ba0f,     0x4e20bad5,
-    0x0e60b883,     0x4e60bb38,     0x0ea0b928,     0x4ea0bb59,
-    0x4ee0bab4,     0x0ea0fa30,     0x4ea0fa51,     0x4ee0f862,
-    0x0ef8f841,     0x4ef8f820,     0x2ea0fb38,     0x6ea0f8a4,
-    0x6ee0f883,     0x2ef8f9ac,     0x6ef8f81f,     0x2ea1fbbc,
-    0x6ea1f96a,     0x6ee1fb7a,     0x2ef9f862,     0x6ef9f9ac,
-    0x2e205a72,     0x6e20581f,     0x0e231c41,     0x4e2f1dcd,
-    0x0ebf1fdd,     0x4ea21c20,     0x2e351e93,     0x6e2e1dac,
-    0x0e338651,     0x4e3886f6,     0x0e6f85cd,     0x4e7e87bc,
-    0x0ea087fe,     0x4ea1841f,     0x4ee38441,     0x0e3c0f7a,
-    0x4e3e0fbc,     0x0e660ca4,     0x4e600ffe,     0x0ea60ca4,
-    0x4ea80ce6,     0x4ee00ffe,     0x2e3c0f7a,     0x6e340e72,
-    0x2e6b0d49,     0x6e6a0d28,     0x2eae0dac,     0x6ea20c20,
-    0x6ef60eb4,     0x0e23d441,     0x4e3ad738,     0x4e64d462,
-    0x0e421420,     0x4e4b1549,     0x2e3a8738,     0x6e3c877a,
-    0x2e728630,     0x6e6087fe,     0x2ea58483,     0x6eac856a,
-    0x6ef98717,     0x0e2c2d6a,     0x4e262ca4,     0x0e742e72,
-    0x4e642c62,     0x0ead2d8b,     0x4eaa2d28,     0x4eec2d6a,
-    0x2e312e0f,     0x6e332e51,     0x2e642c62,     0x6e6c2d6a,
-    0x2eae2dac,     0x6eae2dac,     0x6ef12e0f,     0x0eafd5cd,
-    0x4ea4d462,     0x4ee9d507,     0x0ed616b4,     0x4edc177a,
-    0x0e329e30,     0x4e269ca4,     0x0e649c62,     0x4e669ca4,
-    0x0eae9dac,     0x4eb49e72,     0x2eb7d6d5,     0x6eb2d630,
-    0x6ef4d672,     0x2ecd158b,     0x6ed716d5,     0x2e39d717,
-    0x6e2ed5ac,     0x6e7cd77a,     0x2e591717,     0x6e5e17bc,
-    0x2e30ddee,     0x6e2ddd8b,     0x6e7adf38,     0x2e431c41,
-    0x6e4e1dac,     0x0e61941f,     0x4e6c956a,     0x0eb29630,
-    0x4ea99507,     0x0e24cc62,     0x4e25cc83,     0x4e6fcdcd,
-    0x0e550e93,     0x4e530e51,     0x2e729630,     0x6e659483,
-    0x2ea39441,     0x6ead958b,     0x0ea0cffe,     0x4ea7ccc5,
-    0x4eeacd28,     0x0ed10e0f,     0x4edf0fdd,     0x2e20fffe,
-    0x6e22fc20,     0x6e76feb4,     0x2e493d07,     0x6e563eb4,
-    0x0e396717,     0x4e3e67bc,     0x0e7766d5,     0x4e7d679b,
-    0x0ebb6759,     0x4ea764c5,     0x2e236441,     0x6e396717,
-    0x2e726630,     0x6e61641f,     0x2ea764c5,     0x6eae65ac,
-    0x0e2ba549,     0x4e3ea7bc,     0x0e71a60f,     0x4e7fa7dd,
-    0x0eb8a6f6,     0x4ea1a41f,     0x0e35f693,     0x4e21f41f,
-    0x4e67f4c5,     0x0e5035ee,     0x4e543672,     0x0e216c1f,
-    0x4e346e72,     0x0e7d6f9b,     0x4e766eb4,     0x0eb26e30,
-    0x4eae6dac,     0x2e2d6d8b,     0x6e2b6d49,     0x2e686ce6,
-    0x6e606ffe,     0x2eb36e51,     0x6ebd6f9b,     0x0e3eafbc,
-    0x4e20affe,     0x0e69ad07,     0x4e6cad6a,     0x0eb6aeb4,
-    0x4eacad6a,     0x0e66b4a4,     0x4e7ab738,     0x0eb3b651,
-    0x4eb3b651,     0x0e3826f6,     0x4e252483,     0x0e7f27dd,
-    0x4e71260f,     0x0eb826f6,     0x4eb52693,     0x0eb5f693,
-    0x4eb8f6f6,     0x4ee4f462,     0x0ed1360f,     0x4ec834e6,
-    0x2eaeedac,     0x6eb2ee30,     0x6eeded8b,     0x2ecf2dcd,
-    0x6ed92f17,     0x0f81100f,     0x4f848862,     0x4fc31841,
-    0x0fad518b,     0x4fa780c5,     0x4fd059ee,     0x2fa890e6,
-    0x4fa38841,     0x6fc1900f,     0x0f7b8149,     0x4f4688a4,
-    0x0faf81cd,     0x4fa58083,     0x0e3736d5,     0x4e393717,
-    0x0e61341f,     0x4e7b3759,     0x0ea43462,     0x4ea1341f,
-    0x4efd379b,     0x0e343e72,     0x4e2c3d6a,     0x0e793f17,
-    0x4e753e93,     0x0ea53c83,     0x4eb43e72,     0x4ee23c20,
-    0x2e3b8f59,     0x6e3c8f7a,     0x2e798f17,     0x6e648c62,
-    0x2eb48e72,     0x6eae8dac,     0x6ee68ca4,     0x2e3e37bc,
-    0x6e2037fe,     0x2e7f37dd,     0x6e723630,     0x2ebd379b,
-    0x6ea834e6,     0x6eeb3549,     0x2e3f3fdd,     0x6e343e72,
-    0x2e693d07,     0x6e663ca4,     0x2ea93d07,     0x6eb13e0f,
-    0x6eeb3d49,     0x0e39e717,     0x4e2ae528,     0x4e64e462,
-    0x2ebee7bc,     0x6eb7e6d5,     0x6ee1e41f,     0x2e27e4c5,
-    0x6e3de79b,     0x6e62e420,     0x659239e8,     0x65d03b94,
-    0x65d0232d,     0x65d120c2,     0x659129f2,     0x65933ca3,
-    0x25969683,     0x25961d15,     0x254d1c48,     0x259e3f61,
-    0x25953b96,     0x255b91d1,     0x247686ed,     0x24309098,
-    0x2462edb9,     0x24a57468,     0xba5fd3e3,     0x3a5f03e5,
-    0xfa411be4,     0x7a42cbe2,     0x93df03ff,     0xc820ffff,
-    0x8822fc7f,     0xc8247cbf,     0x88267fff,     0x4e010fe0,
-    0x5e040420,     0x4e081fe1,     0x4e0c1fe1,     0x4e0a1fe1,
-    0x4e071fe1,     0x4e042c20,     0x4e062c20,     0x4e052c20,
-    0x4e083c20,     0x0e0c3c20,     0x0e0a3c20,     0x0e073c20,
-    0x9eae0020,     0x0f03f409,     0x6f03f40e,     0x4cc0ac3f,
-    0x0ea1b820,     0x0ef9b820,     0x4ef9b820,     0x4e21c862,
-    0x0e79c862,     0x4e79c862,     0x4e61b8a4,     0x0e79b8a4,
-    0x4e79b8a4,     0x05a08020,     0x05104fe0,     0x05505001,
-    0x05906fe2,     0x05d03005,     0x05101fea,     0x05901feb,
-    0x04b0e3e0,     0x0470e7e1,     0x042f9c20,     0x043f9c35,
-    0x047f9c20,     0x04ff9c20,     0x04299420,     0x04319160,
-    0x0461943e,     0x04a19020,     0x04038100,     0x040381a0,
-    0x040387e1,     0x04438be2,     0x04c38fe3,     0x040181e0,
-    0x04018100,     0x04018621,     0x04418b22,     0x04418822,
-    0x04818c23,     0x040081e0,     0x04008120,     0x04008761,
-    0x04008621,     0x04408822,     0x04808c23,     0x042053ff,
-    0x047f5401,     0x25208028,     0x2538cfe0,     0x2578d001,
-    0x25b8efe2,     0x25f8f007,     0x2538dfea,     0x25b8dfeb,
-    0xa400a3e0,     0xa420a7e0,     0xa4484be0,     0xa467afe0,
-    0xa4a8a7ea,     0xa547a814,     0xa4084ffe,     0xa55c53e0,
-    0xa5e1540b,     0xe400fbf6,     0xe408ffff,     0xe420e7e0,
-    0xe4484be0,     0xe460efe0,     0xe547e400,     0xe4014be0,
-    0xe4a84fe0,     0xe5f15000,     0x858043e0,     0x85a043ff,
-    0xe59f5d08,     0x0420e3e9,     0x0460e3ea,     0x04a0e3eb,
-    0x04e0e3ec,     0x25104042,     0x25104871,     0x25904861,
-    0x25904c92,     0x05344020,     0x05744041,     0x05b44062,
-    0x05f44083,     0x252c8840,     0x253c1420,     0x25681572,
-    0x25a21ce3,     0x25ea1e34,     0x253c0421,     0x25680572,
-    0x25a20ce3,     0x25ea0e34,     0x0522c020,     0x05e6c0a4,
-    0x2401a001,     0x2443a051,     0x24858881,     0x24c78cd1,
-    0x24850891,     0x24c70cc1,     0x250f9001,     0x25508051,
-    0x25802491,     0x25df28c1,     0x25850c81,     0x251e10d1,
-    0x65816001,     0x65c36051,     0x65854891,     0x65c74cc1,
-    0x05733820,     0x05b238a4,     0x05f138e6,     0x0570396a,
-    0x65d0a001,     0x65d6a443,     0x65d4a826,     0x6594ac26,
-    0x6554ac26,     0x6556ac26,     0x6552ac26,     0x65cbac85,
-    0x65caac01,     0x6589ac85,     0x6588ac01,     0x65c9ac85,
-    0x65c8ac01,     0x65dea833,     0x659ca509,     0x65d8a801,
-    0x65dcac01,     0x655cb241,     0x0520a1e0,     0x0521a601,
-    0x052281e0,     0x05238601,     0x04a14026,     0x042244a6,
-    0x046344a6,     0x04a444a6,     0x04e544a7,     0x0568aca7,
-    0x05b23230,     0x853040af,     0xc5b040af,     0xe57080af,
-    0xe5b080af,     0x25034440,     0x254054c4,     0x25034640,
-    0x25415a05,     0x25834440,     0x25c54489,     0x250b5d3a,
-    0x2550dc20,     0x2518e3e1,     0x2518e021,     0x2518e0a1,
-    0x2518e121,     0x2518e1a1,     0x2558e3e2,     0x2558e042,
-    0x2558e0c2,     0x2558e142,     0x2598e3e3,     0x2598e063,
-    0x2598e0e3,     0x2598e163,     0x25d8e3e4,     0x25d8e084,
-    0x25d8e104,     0x25d8e184,     0x2518e407,     0x05214800,
-    0x05614800,     0x05a14800,     0x05e14800,     0x05214c00,
-    0x05614c00,     0x05a14c00,     0x05e14c00,     0x05304001,
-    0x05314001,     0x05a18610,     0x05e18610,     0x05271e11,
-    0x6545e891,     0x6585e891,     0x65c5e891,     0x6545c891,
-    0x6585c891,     0x65c5c891,     0x45b0c210,     0x45f1c231,
-    0x1e601000,     0x1e603000,     0x1e621000,     0x1e623000,
-    0x1e641000,     0x1e643000,     0x1e661000,     0x1e663000,
-    0x1e681000,     0x1e683000,     0x1e6a1000,     0x1e6a3000,
-    0x1e6c1000,     0x1e6c3000,     0x1e6e1000,     0x1e6e3000,
-    0x1e701000,     0x1e703000,     0x1e721000,     0x1e723000,
-    0x1e741000,     0x1e743000,     0x1e761000,     0x1e763000,
-    0x1e781000,     0x1e783000,     0x1e7a1000,     0x1e7a3000,
-    0x1e7c1000,     0x1e7c3000,     0x1e7e1000,     0x1e7e3000,
-    0xf8268267,     0xf82d023c,     0xf8301046,     0xf83d2083,
-    0xf8263290,     0xf82d528c,     0xf8284299,     0xf8337160,
-    0xf8386286,     0xf8bf820e,     0xf8a600e0,     0xf8af1353,
-    0xf8a922ea,     0xf8b53396,     0xf8a251e3,     0xf8b340f4,
-    0xf8a470fd,     0xf8a06209,     0xf8f48097,     0xf8f002ea,
-    0xf8eb10d9,     0xf8ff21b0,     0xf8f7302c,     0xf8ee52a9,
-    0xf8f041fa,     0xf8e471e4,     0xf8e863c6,     0xf864823d,
-    0xf87d013a,     0xf86f1162,     0xf87d20e3,     0xf86132bb,
-    0xf870510e,     0xf8704336,     0xf86572b4,     0xf8706217,
-    0xb83e8294,     0xb8200264,     0xb8381284,     0xb8242358,
-    0xb8333102,     0xb828530e,     0xb83042df,     0xb824703f,
-    0xb82a6194,     0xb8a080e9,     0xb8b80090,     0xb8bb1146,
-    0xb8bb21b8,     0xb8b032df,     0xb8b653f4,     0xb8bd41c9,
-    0xb8b47287,     0xb8bc6169,     0xb8ee828c,     0xb8e10138,
-    0xb8f3126d,     0xb8f020b0,     0xb8e03183,     0xb8e851ef,
-    0xb8f041e4,     0xb8fe7005,     0xb8ea6376,     0xb8638120,
-    0xb873015d,     0xb8781284,     0xb86723b8,     0xb86e3175,
-    0xb87b51ed,     0xb87f41d1,     0xb863721e,     0xb87660f4,
-    0xce216874,     0xce104533,     0xce648c15,     0xce8e3302,
-    0xce6e82ab,     0xce6c87d1,     0xcec08063,     0xce638937,
-    0x25e0c358,     0x25a1c7d3,     0x0580785a,     0x05426328,
-    0x05009892,     0x25a0cc29,     0x2561cec8,     0x058044b3,
-    0x05401c99,     0x05006b49,     0x25e0d6f7,     0x2561c528,
-    0x0583c8bc,     0x0542522f,     0x05001ec0,     0x25e0de65,
-    0x25a1c113,     0x05803cad,     0x0540f3c0,     0x0500ab15,
-    0x2560c28c,     0x2561d7c0,     0x05801ed7,     0x0542633b,
-    0x05003696,     0x2560d4b4,     0x25e1c918,     0x058021ff,
-    0x05400e15,     0x0500f3de,     0x0473025a,     0x04bd05ab,
-    0x658e0025,     0x658a08e2,     0x659a0493,     0x043e1062,
-    0x04f418b4,     0x046d15bd,     0x04611fce,     0x04d6a07c,
-    0x04001929,     0x041a09da,     0x04d098f4,     0x04db10d4,
-    0x0459a3ad,     0x041aa029,     0x041919fb,     0x04d39e24,
-    0x04118302,     0x04101dba,     0x04d7ae16,     0x04dea571,
-    0x04180210,     0x05e786fc,     0x05e4915c,     0x04881cf1,
-    0x044a0f04,     0x04090969,     0x048b16c4,     0x044101e4,
-    0x04dcbf44,     0x65809745,     0x658d833f,     0x65c68468,
-    0x65c79b07,     0x65829e38,     0x049dafca,     0x6582bba8,
-    0x65c0b7ff,     0x65c1b4e0,     0x658dbadd,     0x65819a9d,
-    0x65ed9246,     0x65b30815,     0x65e6263c,     0x65eebb94,
-    0x65bad14e,     0x65efe178,     0x65fc5697,     0x65e07f14,
-    0x040c55a6,     0x04977f4d,     0x043d3046,     0x04b733a0,
-    0x046830a4,     0x04ed322d,     0x05686948,     0x05bd6c13,
-    0x65c88ef0,     0x450db3d7,     0x4540b6d9,     0x043e3979,
-    0x445896ce,     0x445a9005,     0x44d98069,     0x445b87ae,
-    0x04da348e,     0x04982edb,     0x0499397f,     0x0408338c,
-    0x04ca309c,     0x65c721e6,     0x65c63641,     0x65982882,
-    0x04812b8b,     0x0e251083,     0x4e3712d5,     0x0e61101f,
-    0x4e6d118b,     0x0eba1338,     0x4eb712d5,     0x2e31120f,
-    0x6e2e11ac,     0x2e6810e6,     0x6e6f11cd,     0x2eaa1128,
-    0x6eb1120f,
+    0xd5033fdf,     0xd50330ff,     0xd503207f,     0xd50320ff,
+    0xd5033e9f,     0xd50332bf,     0xd61f0200,     0xd63f0280,
+    0xdac123ea,     0xdac127fb,     0xdac12be8,     0xdac12fe0,
+    0xdac133e1,     0xdac137f5,     0xdac13bf1,     0xdac13ffd,
+    0xdac147fd,     0xd61f0b9f,     0xd61f0c3f,     0xd63f0aff,
+    0xd63f0ebf,     0xd51b4434,     0xd51b4216,     0xd53b443b,
+    0xd53b4213,     0xd53b00eb,     0xd53b0030,     0xdac143e6,
+    0xc8117c80,     0xc80afed8,     0xc85f7e6a,     0xc85ffca1,
+    0xc89ffd1e,     0xc8dffe2c,     0x88097cee,     0x8801fe05,
+    0x885f7d82,     0x885ffd8a,     0x889fff83,     0x88dfff4e,
+    0x481e7dca,     0x4815fd2d,     0x485f7f76,     0x485ffe7c,
+    0x489fffcb,     0x48dffc53,     0x08027c37,     0x0800fe0c,
+    0x085f7ded,     0x085ffeb1,     0x089ffd6d,     0x08dffd1e,
+    0xc87f3578,     0xc87feaa1,     0xc83b506d,     0xc82c87a6,
+    0x887f1166,     0x887f93d0,     0x883e32a4,     0x883bf12f,
+    0xf80011f9,     0xb81b1022,     0x381ea354,     0x79002fd7,
+    0xf85cf39a,     0xb8580309,     0x385e218c,     0x784051e1,
+    0x389e11d8,     0x789fa1f8,     0x79c01865,     0xb881131b,
+    0xfc5dd3ad,     0xbc5d1137,     0xfc00900b,     0xbc181015,
+    0xf818ec7d,     0xb81b8c91,     0x381efc40,     0x78007c3d,
+    0xf857beb0,     0xb8413dd4,     0x385fddd6,     0x78409e2f,
+    0x389eddea,     0x789e7d94,     0x78de3d55,     0xb8805c13,
+    0xfc5cadc0,     0xbc428c23,     0xfc1a2dc4,     0xbc1caf92,
+    0xf81475f6,     0xb81f95d1,     0x381e757e,     0x78014561,
+    0xf8402436,     0xb85896e2,     0x385f4763,     0x785db4f0,
+    0x3880374f,     0x789e25e7,     0x78dd0563,     0xb88166f9,
+    0xfc529540,     0xbc4374d3,     0xfc1166ae,     0xbc1ba6c0,
+    0xf820ea7b,     0xb82d68c8,     0x38367a04,     0x782f4b59,
+    0xf878c8a4,     0xb8674a24,     0x386b78f1,     0x78776bc0,
+    0x38a15aca,     0x78bedbd5,     0x78fcd94b,     0xb8aa4a7c,
+    0xfc6ecbbe,     0xbc65d8a8,     0xfc2de919,     0xbc3a7b11,
+    0xf91f1193,     0xb91ed5f7,     0x391ec9bd,     0x79182ceb,
+    0xf95d4b0a,     0xb9581010,     0x395fc034,     0x795fb221,
+    0x399d8731,     0x799efb3b,     0x79dd1a2e,     0xb998e4ea,
+    0xfd583723,     0xbd5ea12c,     0xfd18dc38,     0xbd1b0e83,
+    0x58ffda82,     0x1800001d,     0xf885d1c0,     0xd8ffda20,
+    0xf8a77820,     0xf9980220,     0x1a030301,     0x3a140311,
+    0x5a0d000b,     0x7a07015c,     0x9a1001e4,     0xba140182,
+    0xda0d01bd,     0xfa0c00ce,     0x0b31f194,     0x2b206d7b,
+    0xcb29f027,     0x6b210f63,     0x8b2cb34d,     0xab2a88b1,
+    0xcb2f511e,     0xeb3332f3,     0x3a4533aa,     0x7a4d312b,
+    0xba442146,     0xfa42818c,     0x3a466a02,     0x7a4b68ed,
+    0xba4a9b6b,     0xfa4dd86d,     0x1a8a637a,     0x1a9cd6aa,
+    0x5a9bd137,     0x5a8fd7aa,     0x9a95233e,     0x9a95c620,
+    0xda9422b0,     0xda8397d3,     0x5ac00173,     0x5ac00418,
+    0x5ac00b3b,     0x5ac0106e,     0x5ac0162e,     0xdac001e7,
+    0xdac00798,     0xdac00b31,     0xdac00f42,     0xdac010bc,
+    0xdac01759,     0xdac1021b,     0xdac104d1,     0xdac10995,
+    0xdac10c80,     0xdac1136c,     0xdac11791,     0xdac1185c,
+    0xdac11d51,     0xd71f09ee,     0xd71f0dc3,     0xd73f0b2f,
+    0xd73f0e6e,     0x1ac40a05,     0x1ac40f3a,     0x1acc2042,
+    0x1ac8263d,     0x1ac42867,     0x1ada2c99,     0x9ad10899,
+    0x9ad10f40,     0x9ad521f7,     0x9adb263c,     0x9ac0286a,
+    0x9ac92f27,     0x9bdd7de6,     0x9b427d4f,     0x1b0b2cf1,
+    0x1b1ddcf7,     0x9b0b2f6e,     0x9b0cbf04,     0x9b2b728e,
+    0x9b2cdd6d,     0x9bae275e,     0x9ba7954d,     0x7ec315fe,
+    0x1ef0098c,     0x1ef21bff,     0x1ef02ab3,     0x1ef5394f,
+    0x1efc4942,     0x1eff5bc7,     0x1ee28832,     0x7ea3d546,
+    0x1e270979,     0x1e201981,     0x1e3d2a63,     0x1e263ae6,
+    0x1e3b4b80,     0x1e2758a2,     0x1e39899d,     0x7ef8d58d,
+    0x1e720913,     0x1e751b56,     0x1e622a74,     0x1e683ade,
+    0x1e754a76,     0x1e755a4c,     0x1e638a06,     0x1fc373a3,
+    0x1f0a35cf,     0x1f0aea4c,     0x1f2f74e7,     0x1f2032e0,
+    0x1f4d21d8,     0x1f49d0ef,     0x1f7f43b3,     0x1f705522,
+    0x1e20409e,     0x1e20c361,     0x1e214319,     0x1e21c2ae,
+    0x1e22c0cd,     0x1e23c32c,     0x1ee243d9,     0x1e6042bc,
+    0x1e60c2f0,     0x1e6143a5,     0x1e61c276,     0x1e62428d,
+    0x1ee1c393,     0x1e3800d1,     0x9e3800ed,     0x1e78035c,
+    0x9e7800d1,     0x1e220081,     0x9e22028e,     0x1e6202a7,
+    0x9e6202fb,     0x1e24028d,     0x9e64039e,     0x1e3002aa,
+    0x9e700225,     0x1e2601cb,     0x9e6602ad,     0x1e2701db,
+    0x9e6702e4,     0x1e3e2300,     0x1e6e2180,     0x1e202228,
+    0x1e602388,     0x29021b40,     0x297c78c0,     0x69660970,
+    0xa908018f,     0xa9427ae7,     0x29a03cfa,     0x29fc3d4b,
+    0x69c84033,     0xa988240e,     0xa9fa0d9b,     0x28a02d88,
+    0x28c8408a,     0x68f87a6a,     0xa8ba09f8,     0xa8c52a18,
+    0x280257be,     0x28727948,     0xa83868de,     0xa8440a98,
+    0x0c40733f,     0x4cdfa1e5,     0x0ccd6cea,     0x4cdf260d,
+    0x0d40c227,     0x4ddfcb30,     0x0dc7cc6b,     0x4c408ced,
+    0x0cdf8769,     0x4d60c346,     0x0dffca17,     0x4de8cda6,
+    0x4cda4834,     0x0c4049ef,     0x4d40e6dd,     0x4ddfe946,
+    0x0dcfeccf,     0x4cdf0546,     0x0cc7006b,     0x0d60e32c,
+    0x0dffe5eb,     0x0dfce8de,     0x0e31bb9b,     0x4e31bbbc,
+    0x0e71b841,     0x4e71bbbc,     0x4eb1b841,     0x0e30aab4,
+    0x4e30abdd,     0x0e70aa30,     0x4e70a9cd,     0x4eb0a96a,
+    0x6e30fbdd,     0x0e31abdd,     0x2e31aa93,     0x4e31aaf6,
+    0x6e31a96a,     0x0e71a8a4,     0x2e71a81f,     0x4e71aad5,
+    0x6e71a928,     0x4eb1a81f,     0x6eb1aa93,     0x6eb0f96a,
+    0x7e30fbbc,     0x7e70f862,     0x7eb0fb59,     0x7ef0f8c5,
+    0x0ea0c883,     0x4ea0c928,     0x4ee0caf6,     0x2ea0ca93,
+    0x6ea0c9cd,     0x6ee0c8c5,     0x0ea0dbdd,     0x4ea0db38,
+    0x4ee0dad5,     0x0ea0eb7a,     0x4ea0eb38,     0x4ee0e883,
+    0x2ea0db38,     0x6ea0db7a,     0x6ee0db17,     0x0e20ba0f,
+    0x4e20bad5,     0x0e60b883,     0x4e60bb38,     0x0ea0b928,
+    0x4ea0bb59,     0x4ee0bab4,     0x0ea0fa30,     0x4ea0fa51,
+    0x4ee0f862,     0x0ef8f841,     0x4ef8f820,     0x2ea0fb38,
+    0x6ea0f8a4,     0x6ee0f883,     0x2ef8f9ac,     0x6ef8f81f,
+    0x2ea1fbbc,     0x6ea1f96a,     0x6ee1fb7a,     0x2ef9f862,
+    0x6ef9f9ac,     0x2e205a72,     0x6e20581f,     0x0e231c41,
+    0x4e2f1dcd,     0x0ebf1fdd,     0x4ea21c20,     0x2e351e93,
+    0x6e2e1dac,     0x0e338651,     0x4e3886f6,     0x0e6f85cd,
+    0x4e7e87bc,     0x0ea087fe,     0x4ea1841f,     0x4ee38441,
+    0x0e3c0f7a,     0x4e3e0fbc,     0x0e660ca4,     0x4e600ffe,
+    0x0ea60ca4,     0x4ea80ce6,     0x4ee00ffe,     0x2e3c0f7a,
+    0x6e340e72,     0x2e6b0d49,     0x6e6a0d28,     0x2eae0dac,
+    0x6ea20c20,     0x6ef60eb4,     0x0e23d441,     0x4e3ad738,
+    0x4e64d462,     0x0e421420,     0x4e4b1549,     0x2e3a8738,
+    0x6e3c877a,     0x2e728630,     0x6e6087fe,     0x2ea58483,
+    0x6eac856a,     0x6ef98717,     0x0e2c2d6a,     0x4e262ca4,
+    0x0e742e72,     0x4e642c62,     0x0ead2d8b,     0x4eaa2d28,
+    0x4eec2d6a,     0x2e312e0f,     0x6e332e51,     0x2e642c62,
+    0x6e6c2d6a,     0x2eae2dac,     0x6eae2dac,     0x6ef12e0f,
+    0x0eafd5cd,     0x4ea4d462,     0x4ee9d507,     0x0ed616b4,
+    0x4edc177a,     0x0e329e30,     0x4e269ca4,     0x0e649c62,
+    0x4e669ca4,     0x0eae9dac,     0x4eb49e72,     0x2eb7d6d5,
+    0x6eb2d630,     0x6ef4d672,     0x2ecd158b,     0x6ed716d5,
+    0x2e39d717,     0x6e2ed5ac,     0x6e7cd77a,     0x2e591717,
+    0x6e5e17bc,     0x2e30ddee,     0x6e2ddd8b,     0x6e7adf38,
+    0x2e431c41,     0x6e4e1dac,     0x0e61941f,     0x4e6c956a,
+    0x0eb29630,     0x4ea99507,     0x0e24cc62,     0x4e25cc83,
+    0x4e6fcdcd,     0x0e550e93,     0x4e530e51,     0x2e729630,
+    0x6e659483,     0x2ea39441,     0x6ead958b,     0x0ea0cffe,
+    0x4ea7ccc5,     0x4eeacd28,     0x0ed10e0f,     0x4edf0fdd,
+    0x2e20fffe,     0x6e22fc20,     0x6e76feb4,     0x2e493d07,
+    0x6e563eb4,     0x0e396717,     0x4e3e67bc,     0x0e7766d5,
+    0x4e7d679b,     0x0ebb6759,     0x4ea764c5,     0x2e236441,
+    0x6e396717,     0x2e726630,     0x6e61641f,     0x2ea764c5,
+    0x6eae65ac,     0x0e2ba549,     0x4e3ea7bc,     0x0e71a60f,
+    0x4e7fa7dd,     0x0eb8a6f6,     0x4ea1a41f,     0x0e35f693,
+    0x4e21f41f,     0x4e67f4c5,     0x0e5035ee,     0x4e543672,
+    0x0e216c1f,     0x4e346e72,     0x0e7d6f9b,     0x4e766eb4,
+    0x0eb26e30,     0x4eae6dac,     0x2e2d6d8b,     0x6e2b6d49,
+    0x2e686ce6,     0x6e606ffe,     0x2eb36e51,     0x6ebd6f9b,
+    0x0e3eafbc,     0x4e20affe,     0x0e69ad07,     0x4e6cad6a,
+    0x0eb6aeb4,     0x4eacad6a,     0x0e66b4a4,     0x4e7ab738,
+    0x0eb3b651,     0x4eb3b651,     0x0e3826f6,     0x4e252483,
+    0x0e7f27dd,     0x4e71260f,     0x0eb826f6,     0x4eb52693,
+    0x0eb5f693,     0x4eb8f6f6,     0x4ee4f462,     0x0ed1360f,
+    0x4ec834e6,     0x2eaeedac,     0x6eb2ee30,     0x6eeded8b,
+    0x2ecf2dcd,     0x6ed92f17,     0x0f81100f,     0x4f848862,
+    0x4fc31841,     0x0fad518b,     0x4fa780c5,     0x4fd059ee,
+    0x2fa890e6,     0x4fa38841,     0x6fc1900f,     0x0f7b8149,
+    0x4f4688a4,     0x0faf81cd,     0x4fa58083,     0x0e3736d5,
+    0x4e393717,     0x0e61341f,     0x4e7b3759,     0x0ea43462,
+    0x4ea1341f,     0x4efd379b,     0x0e343e72,     0x4e2c3d6a,
+    0x0e793f17,     0x4e753e93,     0x0ea53c83,     0x4eb43e72,
+    0x4ee23c20,     0x2e3b8f59,     0x6e3c8f7a,     0x2e798f17,
+    0x6e648c62,     0x2eb48e72,     0x6eae8dac,     0x6ee68ca4,
+    0x2e3e37bc,     0x6e2037fe,     0x2e7f37dd,     0x6e723630,
+    0x2ebd379b,     0x6ea834e6,     0x6eeb3549,     0x2e3f3fdd,
+    0x6e343e72,     0x2e693d07,     0x6e663ca4,     0x2ea93d07,
+    0x6eb13e0f,     0x6eeb3d49,     0x0e39e717,     0x4e2ae528,
+    0x4e64e462,     0x2ebee7bc,     0x6eb7e6d5,     0x6ee1e41f,
+    0x2e27e4c5,     0x6e3de79b,     0x6e62e420,     0x659239e8,
+    0x65d03b94,     0x65d0232d,     0x65d120c2,     0x659129f2,
+    0x65933ca3,     0x25969683,     0x25961d15,     0x254d1c48,
+    0x259e3f61,     0x25953b96,     0x255b91d1,     0x247686ed,
+    0x24309098,     0x2462edb9,     0x24a57468,     0xba5fd3e3,
+    0x3a5f03e5,     0xfa411be4,     0x7a42cbe2,     0x93df03ff,
+    0xc820ffff,     0x8822fc7f,     0xc8247cbf,     0x88267fff,
+    0x4e010fe0,     0x5e040420,     0x4e081fe1,     0x4e0c1fe1,
+    0x4e0a1fe1,     0x4e071fe1,     0x4e042c20,     0x4e062c20,
+    0x4e052c20,     0x4e083c20,     0x0e0c3c20,     0x0e0a3c20,
+    0x0e073c20,     0x9eae0020,     0x0f03f409,     0x6f03f40e,
+    0x4cc0ac3f,     0x0ea1b820,     0x0ef9b820,     0x4ef9b820,
+    0x4e21c862,     0x0e79c862,     0x4e79c862,     0x4e61b8a4,
+    0x0e79b8a4,     0x4e79b8a4,     0x05a08020,     0x05104fe0,
+    0x05505001,     0x05906fe2,     0x05d03005,     0x05101fea,
+    0x05901feb,     0x04b0e3e0,     0x0470e7e1,     0x042f9c20,
+    0x043f9c35,     0x047f9c20,     0x04ff9c20,     0x04299420,
+    0x04319160,     0x0461943e,     0x04a19020,     0x04038100,
+    0x040381a0,     0x040387e1,     0x04438be2,     0x04c38fe3,
+    0x040181e0,     0x04018100,     0x04018621,     0x04418b22,
+    0x04418822,     0x04818c23,     0x040081e0,     0x04008120,
+    0x04008761,     0x04008621,     0x04408822,     0x04808c23,
+    0x042053ff,     0x047f5401,     0x25208028,     0x2538cfe0,
+    0x2578d001,     0x25b8efe2,     0x25f8f007,     0x2538dfea,
+    0x25b8dfeb,     0xa400a3e0,     0xa420a7e0,     0xa4484be0,
+    0xa467afe0,     0xa4a8a7ea,     0xa547a814,     0xa4084ffe,
+    0xa55c53e0,     0xa5e1540b,     0xe400fbf6,     0xe408ffff,
+    0xe420e7e0,     0xe4484be0,     0xe460efe0,     0xe547e400,
+    0xe4014be0,     0xe4a84fe0,     0xe5f15000,     0x858043e0,
+    0x85a043ff,     0xe59f5d08,     0x0420e3e9,     0x0460e3ea,
+    0x04a0e3eb,     0x04e0e3ec,     0x25104042,     0x25104871,
+    0x25904861,     0x25904c92,     0x05344020,     0x05744041,
+    0x05b44062,     0x05f44083,     0x252c8840,     0x253c1420,
+    0x25681572,     0x25a21ce3,     0x25ea1e34,     0x253c0421,
+    0x25680572,     0x25a20ce3,     0x25ea0e34,     0x0522c020,
+    0x05e6c0a4,     0x2401a001,     0x2443a051,     0x24858881,
+    0x24c78cd1,     0x24850891,     0x24c70cc1,     0x250f9001,
+    0x25508051,     0x25802491,     0x25df28c1,     0x25850c81,
+    0x251e10d1,     0x65816001,     0x65c36051,     0x65854891,
+    0x65c74cc1,     0x05733820,     0x05b238a4,     0x05f138e6,
+    0x0570396a,     0x65d0a001,     0x65d6a443,     0x65d4a826,
+    0x6594ac26,     0x6554ac26,     0x6556ac26,     0x6552ac26,
+    0x65cbac85,     0x65caac01,     0x6589ac85,     0x6588ac01,
+    0x65c9ac85,     0x65c8ac01,     0x65dea833,     0x659ca509,
+    0x65d8a801,     0x65dcac01,     0x655cb241,     0x0520a1e0,
+    0x0521a601,     0x052281e0,     0x05238601,     0x04a14026,
+    0x042244a6,     0x046344a6,     0x04a444a6,     0x04e544a7,
+    0x0568aca7,     0x05b23230,     0x853040af,     0xc5b040af,
+    0xe57080af,     0xe5b080af,     0x25034440,     0x254054c4,
+    0x25034640,     0x25415a05,     0x25834440,     0x25c54489,
+    0x250b5d3a,     0x2550dc20,     0x2518e3e1,     0x2518e021,
+    0x2518e0a1,     0x2518e121,     0x2518e1a1,     0x2558e3e2,
+    0x2558e042,     0x2558e0c2,     0x2558e142,     0x2598e3e3,
+    0x2598e063,     0x2598e0e3,     0x2598e163,     0x25d8e3e4,
+    0x25d8e084,     0x25d8e104,     0x25d8e184,     0x2518e407,
+    0x05214800,     0x05614800,     0x05a14800,     0x05e14800,
+    0x05214c00,     0x05614c00,     0x05a14c00,     0x05e14c00,
+    0x05304001,     0x05314001,     0x05a18610,     0x05e18610,
+    0x05271e11,     0x6545e891,     0x6585e891,     0x65c5e891,
+    0x6545c891,     0x6585c891,     0x65c5c891,     0x45b0c210,
+    0x45f1c231,     0x1e601000,     0x1e603000,     0x1e621000,
+    0x1e623000,     0x1e641000,     0x1e643000,     0x1e661000,
+    0x1e663000,     0x1e681000,     0x1e683000,     0x1e6a1000,
+    0x1e6a3000,     0x1e6c1000,     0x1e6c3000,     0x1e6e1000,
+    0x1e6e3000,     0x1e701000,     0x1e703000,     0x1e721000,
+    0x1e723000,     0x1e741000,     0x1e743000,     0x1e761000,
+    0x1e763000,     0x1e781000,     0x1e783000,     0x1e7a1000,
+    0x1e7a3000,     0x1e7c1000,     0x1e7c3000,     0x1e7e1000,
+    0x1e7e3000,     0xf8268267,     0xf82d023c,     0xf8301046,
+    0xf83d2083,     0xf8263290,     0xf82d528c,     0xf8284299,
+    0xf8337160,     0xf8386286,     0xf8bf820e,     0xf8a600e0,
+    0xf8af1353,     0xf8a922ea,     0xf8b53396,     0xf8a251e3,
+    0xf8b340f4,     0xf8a470fd,     0xf8a06209,     0xf8f48097,
+    0xf8f002ea,     0xf8eb10d9,     0xf8ff21b0,     0xf8f7302c,
+    0xf8ee52a9,     0xf8f041fa,     0xf8e471e4,     0xf8e863c6,
+    0xf864823d,     0xf87d013a,     0xf86f1162,     0xf87d20e3,
+    0xf86132bb,     0xf870510e,     0xf8704336,     0xf86572b4,
+    0xf8706217,     0xb83e8294,     0xb8200264,     0xb8381284,
+    0xb8242358,     0xb8333102,     0xb828530e,     0xb83042df,
+    0xb824703f,     0xb82a6194,     0xb8a080e9,     0xb8b80090,
+    0xb8bb1146,     0xb8bb21b8,     0xb8b032df,     0xb8b653f4,
+    0xb8bd41c9,     0xb8b47287,     0xb8bc6169,     0xb8ee828c,
+    0xb8e10138,     0xb8f3126d,     0xb8f020b0,     0xb8e03183,
+    0xb8e851ef,     0xb8f041e4,     0xb8fe7005,     0xb8ea6376,
+    0xb8638120,     0xb873015d,     0xb8781284,     0xb86723b8,
+    0xb86e3175,     0xb87b51ed,     0xb87f41d1,     0xb863721e,
+    0xb87660f4,     0xce216874,     0xce104533,     0xce648c15,
+    0xce8e3302,     0xce6e82ab,     0xce6c87d1,     0xcec08063,
+    0xce638937,     0x25e0c358,     0x25a1c7d3,     0x0580785a,
+    0x05426328,     0x05009892,     0x25a0cc29,     0x2561cec8,
+    0x058044b3,     0x05401c99,     0x05006b49,     0x25e0d6f7,
+    0x2561c528,     0x0583c8bc,     0x0542522f,     0x05001ec0,
+    0x25e0de65,     0x25a1c113,     0x05803cad,     0x0540f3c0,
+    0x0500ab15,     0x2560c28c,     0x2561d7c0,     0x05801ed7,
+    0x0542633b,     0x05003696,     0x2560d4b4,     0x25e1c918,
+    0x058021ff,     0x05400e15,     0x0500f3de,     0x0473025a,
+    0x04bd05ab,     0x658e0025,     0x658a08e2,     0x659a0493,
+    0x043e1062,     0x04f418b4,     0x046d15bd,     0x04611fce,
+    0x04d6a07c,     0x04001929,     0x041a09da,     0x04d098f4,
+    0x04db10d4,     0x0459a3ad,     0x041aa029,     0x041919fb,
+    0x04d39e24,     0x04118302,     0x04101dba,     0x04d7ae16,
+    0x04dea571,     0x04180210,     0x05e786fc,     0x05e4915c,
+    0x04881cf1,     0x044a0f04,     0x04090969,     0x048b16c4,
+    0x044101e4,     0x04dcbf44,     0x65809745,     0x658d833f,
+    0x65c68468,     0x65c79b07,     0x65829e38,     0x049dafca,
+    0x6582bba8,     0x65c0b7ff,     0x65c1b4e0,     0x658dbadd,
+    0x65819a9d,     0x65ed9246,     0x65b30815,     0x65e6263c,
+    0x65eebb94,     0x65bad14e,     0x65efe178,     0x65fc5697,
+    0x65e07f14,     0x040c55a6,     0x04977f4d,     0x043d3046,
+    0x04b733a0,     0x046830a4,     0x04ed322d,     0x05686948,
+    0x05bd6c13,     0x65c88ef0,     0x450db3d7,     0x4540b6d9,
+    0x043e3979,     0x445896ce,     0x445a9005,     0x44d98069,
+    0x445b87ae,     0x04da348e,     0x04982edb,     0x0499397f,
+    0x0408338c,     0x04ca309c,     0x65c721e6,     0x65c63641,
+    0x65982882,     0x04812b8b,     0x0e251083,     0x4e3712d5,
+    0x0e61101f,     0x4e6d118b,     0x0eba1338,     0x4eb712d5,
+    0x2e31120f,     0x6e2e11ac,     0x2e6810e6,     0x6e6f11cd,
+    0x2eaa1128,     0x6eb1120f,
   };
 // END  Generated code -- do not edit
diff a/test/hotspot/gtest/aarch64/test_spin_pause.cpp b/test/hotspot/gtest/aarch64/test_spin_pause.cpp
--- /dev/null
+++ b/test/hotspot/gtest/aarch64/test_spin_pause.cpp
@@ -0,0 +1,33 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+#if defined(AARCH64) && !defined(ZERO)
+
+#include "utilities/spinYield.hpp"
+#include "unittest.hpp"
+
+TEST_VM(SpinPause, sanity) {
+  ASSERT_EQ(SpinPause(), 1);
+}
+
+#endif  // AARCH64
diff a/test/hotspot/gtest/gc/shenandoah/test_shenandoahOldGeneration.cpp b/test/hotspot/gtest/gc/shenandoah/test_shenandoahOldGeneration.cpp
--- a/test/hotspot/gtest/gc/shenandoah/test_shenandoahOldGeneration.cpp
+++ b/test/hotspot/gtest/gc/shenandoah/test_shenandoahOldGeneration.cpp
@@ -50,11 +50,11 @@
   void SetUp() override {
     SKIP_IF_NOT_SHENANDOAH();
 
     ShenandoahHeap::heap()->lock()->lock(false);
 
-    old = new ShenandoahOldGeneration(8, 1024 * 1024, 1024);
+    old = new ShenandoahOldGeneration(8, 1024 * 1024);
     old->set_promoted_reserve(512 * HeapWordSize);
     old->expend_promoted(256 * HeapWordSize);
     old->set_evacuation_reserve(512 * HeapWordSize);
 
     Thread* thread = Thread::current();
diff a/test/hotspot/gtest/oops/test_compressedKlass.cpp b/test/hotspot/gtest/oops/test_compressedKlass.cpp
--- a/test/hotspot/gtest/oops/test_compressedKlass.cpp
+++ b/test/hotspot/gtest/oops/test_compressedKlass.cpp
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2024, Red Hat, Inc. All rights reserved.
+ * Copyright (c) 2024, 2025, Red Hat, Inc. 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
  * under the terms of the GNU General Public License version 2 only, as
@@ -20,10 +20,11 @@
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
+#include "classfile/vmClasses.hpp"
 #include "oops/compressedKlass.inline.hpp"
 #include "utilities/globalDefinitions.hpp"
 
 #include "unittest.hpp"
 
@@ -105,5 +106,17 @@
   address addr = CompressedKlassPointers::klass_range_start();
   ASSERT_TRUE(CompressedKlassPointers::is_encodable(addr));
   addr = CompressedKlassPointers::klass_range_end() - alignment;
   ASSERT_TRUE(CompressedKlassPointers::is_encodable(addr));
 }
+
+TEST_VM(CompressedKlass, test_is_valid_narrow_klass) {
+  if (!UseCompressedClassPointers) {
+    return;
+  }
+  ASSERT_FALSE(CompressedKlassPointers::is_valid_narrow_klass_id(0));
+  narrowKlass nk_jlC = CompressedKlassPointers::encode((Klass*)vmClasses::Class_klass());
+  ASSERT_TRUE(CompressedKlassPointers::is_valid_narrow_klass_id(nk_jlC));
+  if (CompressedClassSpaceSize < 4 * G && CompressedKlassPointers::base() != nullptr) {
+    ASSERT_FALSE(CompressedKlassPointers::is_valid_narrow_klass_id(0xFFFFFFFF));
+  }
+}
diff a/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java b/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
--- a/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
+++ b/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java
@@ -227,12 +227,12 @@
 
     public static void reprofile(HotSpotResolvedJavaMethod method) {
         CTVM.reprofile((HotSpotResolvedJavaMethodImpl)method);
     }
 
-    public static void invalidateHotSpotNmethod(HotSpotNmethod nmethodMirror, boolean deoptimize) {
-        CTVM.invalidateHotSpotNmethod(nmethodMirror, deoptimize);
+    public static void invalidateHotSpotNmethod(HotSpotNmethod nmethodMirror, boolean deoptimize, int invalidationReason) {
+        CTVM.invalidateHotSpotNmethod(nmethodMirror, deoptimize, invalidationReason);
     }
 
     public static long[] collectCounters() {
         return CTVM.collectCounters();
     }
diff a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInvalidationReasonTest.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInvalidationReasonTest.java
--- /dev/null
+++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/CodeInvalidationReasonTest.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @requires vm.jvmci
+ * @requires vm.simpleArch == "x64" | vm.simpleArch == "aarch64" | vm.simpleArch == "riscv64"
+ * @library /test/lib /
+ * @modules jdk.internal.vm.ci/jdk.vm.ci.hotspot
+ *          jdk.internal.vm.ci/jdk.vm.ci.meta
+ *          jdk.internal.vm.ci/jdk.vm.ci.code
+ *          jdk.internal.vm.ci/jdk.vm.ci.code.site
+ *          jdk.internal.vm.ci/jdk.vm.ci.runtime
+ *          jdk.internal.vm.ci/jdk.vm.ci.aarch64
+ *          jdk.internal.vm.ci/jdk.vm.ci.amd64
+ *          jdk.internal.vm.ci/jdk.vm.ci.riscv64
+ * @compile CodeInstallationTest.java DebugInfoTest.java TestAssembler.java TestHotSpotVMConfig.java amd64/AMD64TestAssembler.java aarch64/AArch64TestAssembler.java riscv64/RISCV64TestAssembler.java
+ * @run junit/othervm -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:-UseJVMCICompiler jdk.vm.ci.code.test.CodeInvalidationReasonTest
+ */
+
+package jdk.vm.ci.code.test;
+
+import jdk.test.lib.Asserts;
+import jdk.vm.ci.code.Register;
+import jdk.vm.ci.hotspot.HotSpotNmethod;
+
+import org.junit.Test;
+
+import java.lang.reflect.Method;
+
+/**
+ * Test if setting HotSpotNmethod invalidation reason around works.
+ */
+public class CodeInvalidationReasonTest extends CodeInstallationTest {
+
+    public static int add(int a, int b) {
+        return a + b;
+    }
+
+    private static void compileAdd(TestAssembler asm) {
+        Register arg0 = asm.emitIntArg0();
+        Register arg1 = asm.emitIntArg1();
+        Register ret = asm.emitIntAdd(arg0, arg1);
+        asm.emitIntRet(ret);
+    }
+
+    @Test
+    public void test() {
+        Method method = getMethod("add", int.class, int.class);
+
+        HotSpotNmethod nmethod = test(CodeInvalidationReasonTest::compileAdd, method, 5, 7);
+        Asserts.assertEquals(-1 /* since it was not invalidated yet. */, nmethod.getInvalidationReason());
+
+        nmethod.invalidate(true, config.NMETHOD_INVALIDATION_REASON_JVMCI_INVALIDATE);
+        Asserts.assertEquals(config.NMETHOD_INVALIDATION_REASON_JVMCI_INVALIDATE, nmethod.getInvalidationReason());
+    }
+}
diff a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
--- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
+++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleCodeInstallationTest.java
@@ -1,7 +1,7 @@
 /*
- * 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.
@@ -69,17 +69,17 @@
         Asserts.assertTrue(nmethod.isValid(), "code is not valid, i = " + nmethod);
         Asserts.assertTrue(nmethod.isAlive(), "code is not alive, i = " + nmethod);
         Asserts.assertNotEquals(nmethod.getStart(), 0L);
 
         // Make nmethod non-entrant but still alive
-        nmethod.invalidate(false);
+        nmethod.invalidate(false, config.NMETHOD_INVALIDATION_REASON_JVMCI_INVALIDATE);
         Asserts.assertFalse(nmethod.isValid(), "code is valid, i = " + nmethod);
         Asserts.assertTrue(nmethod.isAlive(), "code is not alive, i = " + nmethod);
         Asserts.assertEquals(nmethod.getStart(), 0L);
 
         // Deoptimize the nmethod and cut the link to it from the HotSpotNmethod
-        nmethod.invalidate(true);
+        nmethod.invalidate(true, config.NMETHOD_INVALIDATION_REASON_JVMCI_INVALIDATE);
         Asserts.assertFalse(nmethod.isValid(), "code is valid, i = " + nmethod);
         Asserts.assertFalse(nmethod.isAlive(), "code is alive, i = " + nmethod);
         Asserts.assertEquals(nmethod.getStart(), 0L);
     }
 }
diff a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestHotSpotVMConfig.java b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestHotSpotVMConfig.java
--- a/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestHotSpotVMConfig.java
+++ b/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/TestHotSpotVMConfig.java
@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2016, 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.
@@ -53,24 +53,27 @@
     public final long handleDeoptStub = getFieldValue("CompilerToVM::Data::SharedRuntime_deopt_blob_unpack", Long.class, "address");
 
     public final int maxOopMapStackOffset = getFieldValue("CompilerToVM::Data::_max_oop_map_stack_offset", Integer.class, "int");
     public final int heapWordSize = getConstant("HeapWordSize", Integer.class);
 
+    public final int NMETHOD_INVALIDATION_REASON_JVMCI_INVALIDATE = getConstant("nmethod::InvalidationReason::JVMCI_INVALIDATE", Integer.class);
+
     public final boolean ropProtection;
 
     private Boolean initNmethodEntryBarrierConcurrentPatch(Architecture arch) {
         Boolean patchConcurrent = null;
         if (arch instanceof AArch64 && nmethodEntryBarrier != 0) {
             Integer patchingType = getFieldValue("CompilerToVM::Data::BarrierSetAssembler_nmethod_patching_type", Integer.class, "int");
             if (patchingType != null) {
                 // There currently only 2 variants in use that differ only by the presence of a
                 // dmb instruction
                 int stw = getConstant("NMethodPatchingType::stw_instruction_and_data_patch", Integer.class);
-                int conc = getConstant("NMethodPatchingType::conc_data_patch", Integer.class);
+                int conc1 = getConstant("NMethodPatchingType::conc_data_patch", Integer.class);
+                int conc2 = getConstant("NMethodPatchingType::conc_instruction_and_data_patch", Integer.class);
                 if (patchingType == stw) {
                     patchConcurrent = false;
-                } else if (patchingType == conc) {
+                } else if (patchingType == conc1 || patchingType == conc2) {
                     patchConcurrent = true;
                 } else {
                     throw new IllegalArgumentException("unsupported barrier sequence " + patchingType);
                 }
             }
diff a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java
--- a/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java
+++ b/test/hotspot/jtreg/compiler/onSpinWait/TestOnSpinWaitAArch64.java
@@ -27,38 +27,42 @@
  * @bug 8186670
  * @library /test/lib
  *
  * @requires vm.flagless
  * @requires os.arch=="aarch64"
+ * @requires vm.debug
  *
  * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c2 nop 7
  * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c2 isb 3
  * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c2 yield 1
+ * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c2 sb 1
  * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 nop 7
  * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 isb 3
- * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 yield
+ * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 yield 1
+ * @run driver compiler.onSpinWait.TestOnSpinWaitAArch64 c1 sb 1
  */
 
 package compiler.onSpinWait;
 
+import java.util.Arrays;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.ListIterator;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 
 public class TestOnSpinWaitAArch64 {
+
     public static void main(String[] args) throws Exception {
         String compiler = args[0];
         String spinWaitInst = args[1];
-        String spinWaitInstCount = (args.length == 3) ? args[2] : "1";
+        String spinWaitInstCount = args[2];
         ArrayList<String> command = new ArrayList<String>();
         command.add("-XX:+IgnoreUnrecognizedVMOptions");
         command.add("-showversion");
         command.add("-XX:-BackgroundCompilation");
         command.add("-XX:+UnlockDiagnosticVMOptions");
-        command.add("-XX:+PrintAssembly");
         if (compiler.equals("c2")) {
             command.add("-XX:-TieredCompilation");
         } else if (compiler.equals("c1")) {
             command.add("-XX:+TieredCompilation");
             command.add("-XX:TieredStopAtLevel=1");
@@ -67,142 +71,110 @@
         }
         command.add("-Xbatch");
         command.add("-XX:OnSpinWaitInst=" + spinWaitInst);
         command.add("-XX:OnSpinWaitInstCount=" + spinWaitInstCount);
         command.add("-XX:CompileCommand=compileonly," + Launcher.class.getName() + "::" + "test");
+        command.add("-XX:CompileCommand=print," + Launcher.class.getName() + "::" + "test");
         command.add(Launcher.class.getName());
 
         ProcessBuilder pb = ProcessTools.createLimitedTestJavaProcessBuilder(command);
 
         OutputAnalyzer analyzer = new OutputAnalyzer(pb.start());
 
+        if ("sb".equals(spinWaitInst) && analyzer.contains("CPU does not support SB")) {
+            System.out.println("Skipping the test. The current CPU does not support SB instruction.");
+            return;
+        }
+
         analyzer.shouldHaveExitValue(0);
 
         System.out.println(analyzer.getOutput());
 
         checkOutput(analyzer, spinWaitInst, Integer.parseInt(spinWaitInstCount));
     }
 
     private static String getSpinWaitInstHex(String spinWaitInst) {
       if ("nop".equals(spinWaitInst)) {
-          return "1f20 03d5";
+          return "1f2003d5";
       } else if ("isb".equals(spinWaitInst)) {
-          return "df3f 03d5";
+          return "df3f03d5";
       } else if ("yield".equals(spinWaitInst)) {
-          return "3f20 03d5";
+          return "3f2003d5";
+      } else if ("sb".equals(spinWaitInst)) {
+          return "ff3003d5";
       } else {
           throw new RuntimeException("Unknown spin wait instruction: " + spinWaitInst);
       }
     }
 
-    private static void addInstrs(String line, ArrayList<String> instrs) {
-        for (String instr : line.split("\\|")) {
-            instrs.add(instr.trim());
-        }
-    }
-
-    // The expected output of PrintAssembly for example for a spin wait with three NOPs:
-    //
-    // # {method} {0x0000ffff6ac00370} 'test' '()V' in 'compiler/onSpinWait/TestOnSpinWaitAArch64$Launcher'
-    // #           [sp+0x40]  (sp of caller)
-    // 0x0000ffff9d557680: 1f20 03d5 | e953 40d1 | 3f01 00f9 | ff03 01d1 | fd7b 03a9 | 1f20 03d5 | 1f20 03d5
-    //
-    // 0x0000ffff9d5576ac: ;*invokestatic onSpinWait {reexecute=0 rethrow=0 return_oop=0}
-    //                     ; - compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test@0 (line 161)
-    // 0x0000ffff9d5576ac: 1f20 03d5 | fd7b 43a9 | ff03 0191
+    // The expected output for a spin wait with three NOPs
+    // if the hsdis library is available:
     //
-    // The checkOutput method adds hex instructions before 'invokestatic onSpinWait' and from the line after
-    // it to a list. The list is traversed from the end to count spin wait instructions.
+    // ;; spin_wait {
+    // 0x0000000111dfa58c:   nop
+    // 0x0000000111dfa590:   nop
+    // 0x0000000111dfa594:   nop
+    // ;; }
     //
-    // If JVM finds the hsdis library the output is like:
-    //
-    // # {method} {0x0000ffff63000370} 'test' '()V' in 'compiler/onSpinWait/TestOnSpinWaitAArch64$Launcher'
-    // #           [sp+0x20]  (sp of caller)
-    // 0x0000ffffa409da80:   nop
-    // 0x0000ffffa409da84:   sub sp, sp, #0x20
-    // 0x0000ffffa409da88:   stp x29, x30, [sp, #16]         ;*synchronization entry
-    //                                                       ; - compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test@-1 (line 187)
-    // 0x0000ffffa409da8c:   nop
-    // 0x0000ffffa409da90:   nop
-    // 0x0000ffffa409da94:   nop
-    // 0x0000ffffa409da98:   nop
-    // 0x0000ffffa409da9c:   nop
-    // 0x0000ffffa409daa0:   nop
-    // 0x0000ffffa409daa4:   nop                                 ;*invokestatic onSpinWait {reexecute=0 rethrow=0 return_oop=0}
-    //                                                           ; - compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test@0 (line 187)
-    private static void checkOutput(OutputAnalyzer output, String spinWaitInst, int spinWaitInstCount) {
+    private static void checkOutput(OutputAnalyzer output, final String spinWaitInst, final int expectedCount) {
         Iterator<String> iter = output.asLines().listIterator();
 
-        String match = skipTo(iter, "'test' '()V' in 'compiler/onSpinWait/TestOnSpinWaitAArch64$Launcher'");
-        if (match == null) {
-            throw new RuntimeException("Missing compiler output for the method compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test");
-        }
-
-        ArrayList<String> instrs = new ArrayList<String>();
-        String line = null;
-        boolean hasHexInstInOutput = false;
+        // 1. Check whether printed instructions are disassembled
+        boolean isDisassembled = false;
         while (iter.hasNext()) {
-            line = iter.next();
-            if (line.contains("*invokestatic onSpinWait")) {
+            String line = iter.next();
+            if (line.contains("[Disassembly]")) {
+                isDisassembled = true;
                 break;
             }
-            if (!hasHexInstInOutput) {
-                hasHexInstInOutput = line.contains("|");
-            }
-            if (line.contains("0x") && !line.contains(";")) {
-                addInstrs(line, instrs);
-            }
-        }
-
-        if (!iter.hasNext() || !iter.next().contains("- compiler.onSpinWait.TestOnSpinWaitAArch64$Launcher::test@0") || !iter.hasNext()) {
-            throw new RuntimeException("Missing compiler output for Thread.onSpinWait intrinsic");
-        }
-
-        String strToSearch = null;
-        if (!hasHexInstInOutput) {
-            instrs.add(line.split(";")[0].trim());
-            strToSearch = spinWaitInst;
-        } else {
-            line = iter.next();
-            if (!line.contains("0x") || line.contains(";")) {
-                throw new RuntimeException("Expected hex instructions");
-            }
-
-            addInstrs(line, instrs);
-            strToSearch = getSpinWaitInstHex(spinWaitInst);
-        }
-
-        int foundInstCount = 0;
-
-        ListIterator<String> instrReverseIter = instrs.listIterator(instrs.size());
-        while (instrReverseIter.hasPrevious()) {
-            if (instrReverseIter.previous().endsWith(strToSearch)) {
-                foundInstCount = 1;
+            if (line.contains("[MachCode]")) {
                 break;
             }
         }
 
-        while (instrReverseIter.hasPrevious()) {
-            if (!instrReverseIter.previous().endsWith(strToSearch)) {
+        // 2. Look for the block comment
+        boolean foundHead = false;
+        while (iter.hasNext()) {
+            String line = iter.next().trim();
+            if (line.contains(";; spin_wait {")) {
+                foundHead = true;
                 break;
             }
-            ++foundInstCount;
         }
-
-        if (foundInstCount != spinWaitInstCount) {
-            throw new RuntimeException("Wrong instruction " + strToSearch + " count " + foundInstCount + "!\n  -- expecting " + spinWaitInstCount);
+        if (!foundHead) {
+            throw new RuntimeException("Block comment not found");
         }
-    }
 
-    private static String skipTo(Iterator<String> iter, String substring) {
+        // 3. Count spin wait instructions
+        final String expectedInst = isDisassembled ? spinWaitInst : getSpinWaitInstHex(spinWaitInst);
+        int foundCount = 0;
         while (iter.hasNext()) {
-            String nextLine = iter.next();
-            if (nextLine.contains(substring)) {
-                return nextLine;
+            String line = iter.next().trim();
+            if (line.startsWith(";; }")) {
+                break;
+            }
+            if (!line.startsWith("0x")) {
+                continue;
             }
+            int pos = line.indexOf(':');
+            if (pos == -1 || pos == line.length() - 1) {
+                continue;
+            }
+            line = line.substring(pos + 1).replaceAll("\\s", "");
+            if (line.startsWith(";")) {
+                continue;
+            }
+            // When code is disassembled, we have one instruction per line.
+            // Otherwise, there can be multiple hex instructions separated by '|'.
+            foundCount += (int)Arrays.stream(line.split("\\|"))
+                                     .takeWhile(i -> i.startsWith(expectedInst))
+                                     .count();
+        }
+
+        if (foundCount != expectedCount) {
+            throw new RuntimeException("Expected " + expectedCount + " " + spinWaitInst + " instructions. Found: " + foundCount);
         }
-        return null;
     }
 
     static class Launcher {
         public static void main(final String[] args) throws Exception {
             int end = 20_000;
diff a/test/hotspot/jtreg/gc/shenandoah/TestDynamicSoftMaxHeapSize.java b/test/hotspot/jtreg/gc/shenandoah/TestDynamicSoftMaxHeapSize.java
--- a/test/hotspot/jtreg/gc/shenandoah/TestDynamicSoftMaxHeapSize.java
+++ b/test/hotspot/jtreg/gc/shenandoah/TestDynamicSoftMaxHeapSize.java
@@ -21,107 +21,177 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  *
  */
 
-/*
- * @test id=passive
+/**
+ * @test id=satb-adaptive
  * @requires vm.gc.Shenandoah
  * @library /test/lib
  *
- * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
- *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
+ * @run main/othervm -Xms100m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ *      -XX:+UseShenandoahGC -Xlog:gc=info -Dtarget=10000
+ *      -XX:ShenandoahGCMode=satb
  *      -XX:+ShenandoahDegeneratedGC
- *      -Dtarget=10000
+ *      -XX:ShenandoahGCHeuristics=adaptive
  *      TestDynamicSoftMaxHeapSize
  *
- * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
- *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
- *      -XX:-ShenandoahDegeneratedGC
- *      -Dtarget=10000
- *      TestDynamicSoftMaxHeapSize
  */
 
-/*
- * @test id=aggressive
+/**
+ * @test id=satb-aggressive
  * @requires vm.gc.Shenandoah
  * @library /test/lib
  *
- * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
- *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=aggressive
- *      -Dtarget=1000
+ * @run main/othervm -Xms100m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ *      -XX:+UseShenandoahGC -Xlog:gc=info -Dtarget=10000
+ *      -XX:ShenandoahGCMode=satb
+ *      -XX:+ShenandoahDegeneratedGC
+ *      -XX:ShenandoahGCHeuristics=aggressive
  *      TestDynamicSoftMaxHeapSize
+ *
  */
 
-/*
- * @test id=adaptive
+/**
+ * @test id=satb-compact
  * @requires vm.gc.Shenandoah
  * @library /test/lib
  *
- * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
- *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive
- *      -Dtarget=10000
+ * @run main/othervm -Xms100m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ *      -XX:+UseShenandoahGC -Xlog:gc=info -Dtarget=10000
+ *      -XX:ShenandoahGCMode=satb
+ *      -XX:+ShenandoahDegeneratedGC
+ *      -XX:ShenandoahGCHeuristics=compact
  *      TestDynamicSoftMaxHeapSize
+ *
  */
 
-/*
- * @test id=generational
+/**
+ * @test id=satb-static
  * @requires vm.gc.Shenandoah
  * @library /test/lib
  *
- * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
- *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=adaptive -XX:ShenandoahGCMode=generational
- *      -Dtarget=10000
+ * @run main/othervm -Xms100m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ *      -XX:+UseShenandoahGC -Xlog:gc=info -Dtarget=10000
+ *      -XX:ShenandoahGCMode=satb
+ *      -XX:+ShenandoahDegeneratedGC
+ *      -XX:ShenandoahGCHeuristics=static
  *      TestDynamicSoftMaxHeapSize
+ *
  */
 
-/*
- * @test id=static
+/**
+ * @test id=passive
  * @requires vm.gc.Shenandoah
  * @library /test/lib
  *
  * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
- *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=static
+ *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
+ *      -XX:+ShenandoahDegeneratedGC
+ *      -Dtarget=10000
+ *      TestDynamicSoftMaxHeapSize
+ *
+ * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ *      -XX:+UseShenandoahGC -XX:ShenandoahGCMode=passive
+ *      -XX:-ShenandoahDegeneratedGC
  *      -Dtarget=10000
  *      TestDynamicSoftMaxHeapSize
  */
 
-/*
- * @test id=compact
+/**
+ * @test id=generational
  * @requires vm.gc.Shenandoah
  * @library /test/lib
  *
- * @run main/othervm -Xms16m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
- *      -XX:+UseShenandoahGC -XX:ShenandoahGCHeuristics=compact
- *      -Dtarget=1000
- *     TestDynamicSoftMaxHeapSize
+ * @run main/othervm -Xms100m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ *      -XX:+UseShenandoahGC -Xlog:gc=info -Dtarget=10000
+ *      -XX:ShenandoahGCMode=generational
+ *      -XX:ShenandoahGCHeuristics=adaptive
+ *      TestDynamicSoftMaxHeapSize
+ *
  */
 
-import java.util.Random;
+/**
+ * @test id=generational-softMaxHeapSizeValidation
+ * @requires vm.gc.Shenandoah
+ * @library /test/lib
+ *
+ * @run main/othervm -DvalidateSoftMaxHeap=true
+ *      TestDynamicSoftMaxHeapSize
+ *      -Xms100m -Xmx512m -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions
+ *      -XX:+UseShenandoahGC -Xlog:gc=info -Dtarget=10000 -DverifySoftMaxHeapValue=true
+ *      -XX:ShenandoahGCMode=generational
+ *      -XX:ShenandoahGCHeuristics=adaptive
+ */
 import jdk.test.lib.Utils;
 import jdk.test.lib.process.OutputAnalyzer;
 import jdk.test.lib.process.ProcessTools;
 import jdk.test.lib.dcmd.PidJcmdExecutor;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Random;
+
 public class TestDynamicSoftMaxHeapSize {
+    static final int K = 1024;
+    static final int XMS_MB = 100;
+    static final int XMX_MB = 512;
+
+    public static void main(String[] args) throws Exception {
+        if ("true".equals(System.getProperty("validateSoftMaxHeap"))) {
+            List<String> flagArgs = new ArrayList<>(Arrays.asList(args));
 
-    static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
-    static final long STRIDE = 10_000_000;
+            int softMaxInMb = Utils.getRandomInstance().nextInt(XMS_MB, XMX_MB);
+            flagArgs.add("-DsoftMaxCapacity=" + softMaxInMb * K * K);
+            flagArgs.add("-Dtest.jdk=" + System.getProperty("test.jdk"));
+            flagArgs.add("-Dcompile.jdk=" + System.getProperty("compile.jdk"));
 
-    static volatile Object sink;
+            flagArgs.add(SoftMaxWithExpectationTest.class.getName());
 
-    public static void main(String[] args) throws Exception {
-        long count = TARGET_MB * 1024 * 1024 / 16;
-        Random r = Utils.getRandomInstance();
-        PidJcmdExecutor jcmd = new PidJcmdExecutor();
-
-        for (long c = 0; c < count; c += STRIDE) {
-            // Sizes specifically include heaps below Xms and above Xmx to test saturation code.
-            jcmd.execute("VM.set_flag SoftMaxHeapSize " + r.nextInt(768*1024*1024), true);
-            for (long s = 0; s < STRIDE; s++) {
-                sink = new Object();
+            ProcessBuilder genShenPbValidateFlag = ProcessTools.createLimitedTestJavaProcessBuilder(flagArgs);
+            OutputAnalyzer output = new OutputAnalyzer(genShenPbValidateFlag.start());
+            output.shouldHaveExitValue(0);
+            output.shouldContain(String.format("Soft Max Heap Size: %dM -> %dM", XMX_MB, softMaxInMb)); // By default, the soft max heap size is Xmx
+        } else {
+            SoftMaxSetFlagOnlyTest.test();
+        }
+    }
+
+    public static class SoftMaxSetFlagOnlyTest {
+        static final long TARGET_MB = Long.getLong("target", 10_000); // 10 Gb allocation
+        static final long STRIDE = 10_000_000;
+
+        static volatile Object sink;
+
+        public static void test() throws Exception {
+            long count = TARGET_MB * 1024 * 1024 / 16;
+            Random r = Utils.getRandomInstance();
+            PidJcmdExecutor jcmd = new PidJcmdExecutor();
+
+            for (long c = 0; c < count; c += STRIDE) {
+                // Sizes specifically include heaps below Xms and above Xmx to test saturation code.
+                jcmd.execute("VM.set_flag SoftMaxHeapSize " + r.nextInt(768*1024*1024), true);
+                for (long s = 0; s < STRIDE; s++) {
+                    sink = new Object();
+                }
+                Thread.sleep(1);
             }
-            Thread.sleep(1);
         }
     }
 
+    public static class SoftMaxWithExpectationTest {
+        static final long TOTAL = 100_000_000;
+
+        static volatile Object sink;
+
+        public static void main(String[] args) throws Exception {
+            int expectedSoftMaxHeapSize = Integer.getInteger("softMaxCapacity", 0);
+            PidJcmdExecutor jcmd = new PidJcmdExecutor();
+            jcmd.execute("VM.set_flag SoftMaxHeapSize " + expectedSoftMaxHeapSize, false);
+
+            for (long s = 0; s < TOTAL; s++) {
+                sink = new Object();
+            }
+        }
+    }
 }
diff a/test/hotspot/jtreg/gtest/TestSpinPauseAArch64.java b/test/hotspot/jtreg/gtest/TestSpinPauseAArch64.java
--- /dev/null
+++ b/test/hotspot/jtreg/gtest/TestSpinPauseAArch64.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test id=default_armv8_0
+ * @bug 8362193
+ * @summary Run SpinPause gtest using different instructions for SpinPause
+ * @library /test/lib
+ * @requires vm.flagless
+ * @requires os.arch=="aarch64"
+ * @run main/native GTestWrapper --gtest_filter=SpinPause*
+ * @run main/native GTestWrapper --gtest_filter=SpinPause* -XX:+UnlockDiagnosticVMOptions -XX:OnSpinWaitInst=none
+ * @run main/native GTestWrapper --gtest_filter=SpinPause* -XX:+UnlockDiagnosticVMOptions -XX:OnSpinWaitInst=nop
+ * @run main/native GTestWrapper --gtest_filter=SpinPause* -XX:+UnlockDiagnosticVMOptions -XX:OnSpinWaitInst=isb
+ * @run main/native GTestWrapper --gtest_filter=SpinPause* -XX:+UnlockDiagnosticVMOptions -XX:OnSpinWaitInst=yield
+ */
+
+/*
+ * @test id=sb_armv8_5
+ * @bug 8362193
+ * @summary Run SpinPause gtest using SB instruction for SpinPause
+ * @library /test/lib
+ * @requires vm.flagless
+ * @requires (os.arch=="aarch64" & vm.cpu.features ~= ".*sb.*")
+ * @run main/native GTestWrapper --gtest_filter=SpinPause* -XX:+UnlockDiagnosticVMOptions -XX:OnSpinWaitInst=sb
+ */
diff a/test/jdk/java/lang/instrument/RetransformBigClassTest.java b/test/jdk/java/lang/instrument/RetransformBigClassTest.java
--- /dev/null
+++ b/test/jdk/java/lang/instrument/RetransformBigClassTest.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ *
+ */
+
+/*
+ * @test
+ * @bug 8277444
+ *
+ * @library /test/lib
+ * @compile SimpleIdentityTransformer.java
+ * @run shell MakeJAR.sh retransformAgent
+ * @run main/othervm -javaagent:retransformAgent.jar RetransformBigClassTest
+ */
+
+import jdk.test.lib.compiler.InMemoryJavaCompiler;
+
+/*
+ * JvmtiClassFileReconstituter::copy_bytecodes restores bytecodes rewritten
+ * by the linking process. It is used by RetransformClasses.
+ * JDK-8277444 is a data race between copy_bytecodes and the linking process.
+ * This test puts the linking process in one thread and the retransforming process
+ * in another thread. The test uses Class.forName("BigClass", false, classLoader)
+ * which does not link the class. When the class is used, the linking process starts.
+ * In another thread retransforming of the class is happening.
+ * We generate a class with big methods. A number of methods and their size are
+ * chosen to make the linking and retransforming processes run concurrently.
+ * We delay the retransforming process to follow the linking process.
+ * If there is no synchronization between the processes, a data race will happen.
+ */
+public class RetransformBigClassTest extends AInstrumentationTestCase {
+
+    private static final Object LOCK = new Object();
+    private static final int COUNTER_INC_COUNT            = 2000; // A number of 'c+=1;' statements in methods of a class.
+    private static final int MIN_LINK_TIME_MS             = 60;   // Large enough so the linking and retransforming processes run in parallel.
+    private static final int RETRANSFORM_CLASSES_DELAY_MS = 37;   // We manage to create a data race when a delay is in the range 0.52x - 0.62x of MIN_LINK_TIME_MS.
+
+    private static Class<?> bigClass;
+    private static byte[] bigClassBytecode;
+
+    private Thread retransformThread;
+
+    RetransformBigClassTest() {
+        super("RetransformBigClassTest");
+    }
+
+    public static void main(String[] args) throws Throwable {
+        new RetransformBigClassTest().runTest();
+    }
+
+    protected final void doRunTest() throws Throwable {
+        ClassLoader classLoader = new ClassLoader() {
+                @Override
+                protected Class<?> findClass(String name) throws ClassNotFoundException {
+                    if (name.equals("BigClass")) {
+                        return defineClass(name, bigClassBytecode, 0, bigClassBytecode.length);
+                    }
+
+                    return super.findClass(name);
+                }
+        };
+        synchronized (LOCK) {
+            bigClass = Class.forName("BigClass", false, classLoader);
+            LOCK.notify();
+        }
+        // Make a use of the BigClass
+        assertTrue(bigClass.getConstructor().newInstance().hashCode() != 0);
+        retransformThread.join();
+    }
+
+    private byte[] createClassBytecode(String className, int methodCount) throws Exception {
+        String methodBody = "";
+        for (int j = 0; j < COUNTER_INC_COUNT; j++) {
+            methodBody += "c+=1;";
+        }
+
+        String classSrc = "public class " + className + " { int c;";
+
+        for (int i = 0; i < methodCount; i++) {
+            classSrc += "\npublic void m" + i + "(){";
+            classSrc += methodBody;
+            classSrc += "\n}";
+        }
+        classSrc += "\n}";
+
+        return InMemoryJavaCompiler.compile(className, classSrc);
+    }
+
+    // We need a number of methods such that the linking time is greater than
+    // or equal to MIN_LINK_TIME_MS.
+    // We create a class having 5 methods and trigger the linking process.
+    // We measure the time taken and use it to calculate the needed number.
+    private int findMethodCount() throws Exception {
+        int methodCount = 5;
+        final String className = "BigClass" + methodCount;
+        final byte[] bytecode = createClassBytecode(className, methodCount);
+        ClassLoader classLoader = new ClassLoader() {
+            @Override
+            protected Class<?> findClass(String name) throws ClassNotFoundException {
+                if (name.equals(className)) {
+                    return defineClass(name, bytecode, 0, bytecode.length);
+                }
+
+                return super.findClass(name);
+            }
+        };
+        var bigClass = Class.forName(className, false, classLoader);
+        long startTime = System.nanoTime();
+        assertTrue(bigClass.getConstructor().newInstance().hashCode() != 0);
+        double linkTimeMs = (System.nanoTime() - startTime) / 1000000.0;
+        System.out.println("Link time for a class with " + methodCount + " methods each having " + COUNTER_INC_COUNT + " counter increments: " + Math.round(linkTimeMs));
+        if (linkTimeMs < MIN_LINK_TIME_MS) {
+          methodCount = (int)Math.round((MIN_LINK_TIME_MS * methodCount) / linkTimeMs);
+        }
+        System.out.println("The number of methods to exceed " + MIN_LINK_TIME_MS + " ms linking time: " + methodCount);
+        return methodCount;
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        bigClassBytecode = createClassBytecode("BigClass", findMethodCount());
+        fInst.addTransformer(new SimpleIdentityTransformer());
+        retransformThread = new Thread(() -> {
+            try {
+                synchronized (LOCK) {
+                    while (bigClass == null) {
+                        System.out.println("[retransformThread]: Waiting for bigClass");
+                        LOCK.wait();
+                    }
+                }
+                Thread.sleep(RETRANSFORM_CLASSES_DELAY_MS);
+                fInst.retransformClasses(bigClass);
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        });
+        retransformThread.start();
+        Thread.sleep(100);
+    }
+}
diff a/test/jdk/sun/security/lib/cacerts/AmazonCACertConstants.java b/test/jdk/sun/security/lib/cacerts/AmazonCACertConstants.java
--- /dev/null
+++ b/test/jdk/sun/security/lib/cacerts/AmazonCACertConstants.java
@@ -0,0 +1,135 @@
+/*
+ * Copyright Amazon.com Inc. 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
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+public class AmazonCACertConstants {
+    public static final int AMAZON_CA_CERT_COUNT = 49;
+    public static final Map<String, String> AMAZON_CA_FINGERPRINT_MAP = new HashMap<>() {
+        {
+            put("accvraiz1",
+                    "9A:6E:C0:12:E1:A7:DA:9D:BE:34:19:4D:47:8A:D7:C0:DB:18:22:FB:07:1D:F1:29:81:49:6E:D1:04:38:41:13");
+            put("acraizfnmt-rcm",
+                    "EB:C5:57:0C:29:01:8C:4D:67:B1:AA:12:7B:AF:12:F7:03:B4:61:1E:BC:17:B7:DA:B5:57:38:94:17:9B:93:FA");
+            put("acraizfnmt-rcmservidoresseguros",
+                    "55:41:53:B1:3D:2C:F9:DD:B7:53:BF:BE:1A:4E:0A:E0:8D:0A:A4:18:70:58:FE:60:A2:B8:62:B2:E4:B8:7B:CB");
+            put("anfsecureserverrootca",
+                    "FB:8F:EC:75:91:69:B9:10:6B:1E:51:16:44:C6:18:C5:13:04:37:3F:6C:06:43:08:8D:8B:EF:FD:1B:99:75:99");
+            put("atostrustedroot2011",
+                    "F3:56:BE:A2:44:B7:A9:1E:B3:5D:53:CA:9A:D7:86:4A:CE:01:8E:2D:35:D5:F8:F9:6D:DF:68:A6:F4:1A:A4:74");
+            put("autoridaddecertificacionfirmaprofesionalcifa62634068",
+                    "04:04:80:28:BF:1F:28:64:D4:8F:9A:D4:D8:32:94:36:6A:82:88:56:55:3F:3B:14:30:3F:90:14:7F:5D:40:EF");
+            put("cadisigrootr2",
+                    "E2:3D:4A:03:6D:7B:70:E9:F5:95:B1:42:20:79:D2:B9:1E:DF:BB:1F:B6:51:A0:63:3E:AA:8A:9D:C5:F8:07:03");
+            put("certignarootca",
+                    "D4:8D:3D:23:EE:DB:50:A4:59:E5:51:97:60:1C:27:77:4B:9D:7B:18:C9:4D:5A:05:95:11:A1:02:50:B9:31:68");
+            put("certsignrootca",
+                    "EA:A9:62:C4:FA:4A:6B:AF:EB:E4:15:19:6D:35:1C:CD:88:8D:4F:53:F3:FA:8A:E6:D7:C4:66:A9:4E:60:42:BB");
+            put("certsignrootcag2",
+                    "65:7C:FE:2F:A7:3F:AA:38:46:25:71:F3:32:A2:36:3A:46:FC:E7:02:09:51:71:07:02:CD:FB:B6:EE:DA:33:05");
+            put("certumec-384ca",
+                    "6B:32:80:85:62:53:18:AA:50:D1:73:C9:8D:8B:DA:09:D5:7E:27:41:3D:11:4C:F7:87:A0:F5:D0:6C:03:0C:F6");
+            put("certumtrustednetworkca2",
+                    "B6:76:F2:ED:DA:E8:77:5C:D3:6C:B0:F6:3C:D1:D4:60:39:61:F4:9E:62:65:BA:01:3A:2F:03:07:B6:D0:B8:04");
+            put("certumtrustedrootca",
+                    "FE:76:96:57:38:55:77:3E:37:A9:5E:7A:D4:D9:CC:96:C3:01:57:C1:5D:31:76:5B:A9:B1:57:04:E1:AE:78:FD");
+            put("cfcaevroot",
+                    "5C:C3:D7:8E:4E:1D:5E:45:54:7A:04:E6:87:3E:64:F9:0C:F9:53:6D:1C:CC:2E:F8:00:F3:55:C4:C5:FD:70:FD");
+            put("comodocertificationauthority",
+                    "0C:2C:D6:3D:F7:80:6F:A3:99:ED:E8:09:11:6B:57:5B:F8:79:89:F0:65:18:F9:80:8C:86:05:03:17:8B:AF:66");
+            put("e-szignorootca2017",
+                    "BE:B0:0B:30:83:9B:9B:C3:2C:32:E4:44:79:05:95:06:41:F2:64:21:B1:5E:D0:89:19:8B:51:8A:E2:EA:1B:99");
+            put("emsigneccrootca-c3",
+                    "BC:4D:80:9B:15:18:9D:78:DB:3E:1D:8C:F4:F9:72:6A:79:5D:A1:64:3C:A5:F1:35:8E:1D:DB:0E:DC:0D:7E:B3");
+            put("emsigneccrootca-g3",
+                    "86:A1:EC:BA:08:9C:4A:8D:3B:BE:27:34:C6:12:BA:34:1D:81:3E:04:3C:F9:E8:A8:62:CD:5C:57:A3:6B:BE:6B");
+            put("emsignrootca-c1",
+                    "12:56:09:AA:30:1D:A0:A2:49:B9:7A:82:39:CB:6A:34:21:6F:44:DC:AC:9F:39:54:B1:42:92:F2:E8:C8:60:8F");
+            put("emsignrootca-g1",
+                    "40:F6:AF:03:46:A9:9A:A1:CD:1D:55:5A:4E:9C:CE:62:C7:F9:63:46:03:EE:40:66:15:83:3D:C8:C8:D0:03:67");
+            put("gdcatrustauthr5root",
+                    "BF:FF:8F:D0:44:33:48:7D:6A:8A:A6:0C:1A:29:76:7A:9F:C2:BB:B0:5E:42:0F:71:3A:13:B9:92:89:1D:38:93");
+            put("globalsignroote46",
+                    "CB:B9:C4:4D:84:B8:04:3E:10:50:EA:31:A6:9F:51:49:55:D7:BF:D2:E2:C6:B4:93:01:01:9A:D6:1D:9F:50:58");
+            put("globalsignrootr46",
+                    "4F:A3:12:6D:8D:3A:11:D1:C4:85:5A:4F:80:7C:BA:D6:CF:91:9D:3A:5A:88:B0:3B:EA:2C:63:72:D9:3C:40:C9");
+            put("globaltrust2020",
+                    "9A:29:6A:51:82:D1:D4:51:A2:E3:7F:43:9B:74:DA:AF:A2:67:52:33:29:F9:0F:9A:0D:20:07:C3:34:E2:3C:9A");
+            put("gtsrootr1",
+                    "D9:47:43:2A:BD:E7:B7:FA:90:FC:2E:6B:59:10:1B:12:80:E0:E1:C7:E4:E4:0F:A3:C6:88:7F:FF:57:A7:F4:CF");
+            put("gtsrootr2",
+                    "8D:25:CD:97:22:9D:BF:70:35:6B:DA:4E:B3:CC:73:40:31:E2:4C:F0:0F:AF:CF:D3:2D:C7:6E:B5:84:1C:7E:A8");
+            put("gtsrootr3",
+                    "34:D8:A7:3E:E2:08:D9:BC:DB:0D:95:65:20:93:4B:4E:40:E6:94:82:59:6E:8B:6F:73:C8:42:6B:01:0A:6F:48");
+            put("gtsrootr4",
+                    "34:9D:FA:40:58:C5:E2:63:12:3B:39:8A:E7:95:57:3C:4E:13:13:C8:3F:E6:8F:93:55:6C:D5:E8:03:1B:3C:7D");
+            put("hongkongpostrootca3",
+                    "5A:2F:C0:3F:0C:83:B0:90:BB:FA:40:60:4B:09:88:44:6C:76:36:18:3D:F9:84:6E:17:10:1A:44:7F:B8:EF:D6");
+            put("izenpe.com",
+                    "25:30:CC:8E:98:32:15:02:BA:D9:6F:9B:1F:BA:1B:09:9E:2D:29:9E:0F:45:48:BB:91:4F:36:3B:C0:D4:53:1F");
+            put("microsece-szignorootca2009",
+                    "3C:5F:81:FE:A5:FA:B8:2C:64:BF:A2:EA:EC:AF:CD:E8:E0:77:FC:86:20:A7:CA:E5:37:16:3D:F3:6E:DB:F3:78");
+            put("microsofteccrootcertificateauthority2017",
+                    "35:8D:F3:9D:76:4A:F9:E1:B7:66:E9:C9:72:DF:35:2E:E1:5C:FA:C2:27:AF:6A:D1:D7:0E:8E:4A:6E:DC:BA:02");
+            put("microsoftrsarootcertificateauthority2017",
+                    "C7:41:F7:0F:4B:2A:8D:88:BF:2E:71:C1:41:22:EF:53:EF:10:EB:A0:CF:A5:E6:4C:FA:20:F4:18:85:30:73:E0");
+            put("naverglobalrootcertificationauthority",
+                    "88:F4:38:DC:F8:FF:D1:FA:8F:42:91:15:FF:E5:F8:2A:E1:E0:6E:0C:70:C3:75:FA:AD:71:7B:34:A4:9E:72:65");
+            put("netlockarany(classgold)ftanstvny",
+                    "6C:61:DA:C3:A2:DE:F0:31:50:6B:E0:36:D2:A6:FE:40:19:94:FB:D1:3D:F9:C8:D4:66:59:92:74:C4:46:EC:98");
+            put("oistewisekeyglobalrootgbca",
+                    "6B:9C:08:E8:6E:B0:F7:67:CF:AD:65:CD:98:B6:21:49:E5:49:4A:67:F5:84:5E:7B:D1:ED:01:9F:27:B8:6B:D6");
+            put("oistewisekeyglobalrootgcca",
+                    "85:60:F9:1C:36:24:DA:BA:95:70:B5:FE:A0:DB:E3:6F:F1:1A:83:23:BE:94:86:85:4F:B3:F3:4A:55:71:19:8D");
+            put("secureglobalca",
+                    "42:00:F5:04:3A:C8:59:0E:BB:52:7D:20:9E:D1:50:30:29:FB:CB:D4:1C:A1:B5:06:EC:27:F1:5A:DE:7D:AC:69");
+            put("securesignrootca11",
+                    "BF:0F:EE:FB:9E:3A:58:1A:D5:F9:E9:DB:75:89:98:57:43:D2:61:08:5C:4D:31:4F:6F:5D:72:59:AA:42:16:12");
+            put("ssl.comevrootcertificationauthorityecc",
+                    "22:A2:C1:F7:BD:ED:70:4C:C1:E7:01:B5:F4:08:C3:10:88:0F:E9:56:B5:DE:2A:4A:44:F9:9C:87:3A:25:A7:C8");
+            put("szafirrootca2",
+                    "A1:33:9D:33:28:1A:0B:56:E5:57:D3:D3:2B:1C:E7:F9:36:7E:B0:94:BD:5F:A7:2A:7E:50:04:C8:DE:D7:CA:FE");
+            put("trustwaveglobalcertificationauthority",
+                    "97:55:20:15:F5:DD:FC:3C:87:88:C0:06:94:45:55:40:88:94:45:00:84:F1:00:86:70:86:BC:1A:2B:B5:8D:C8");
+            put("trustwaveglobaleccp256certificationauthority",
+                    "94:5B:BC:82:5E:A5:54:F4:89:D1:FD:51:A7:3D:DF:2E:A6:24:AC:70:19:A0:52:05:22:5C:22:A7:8C:CF:A8:B4");
+            put("trustwaveglobaleccp384certificationauthority",
+                    "55:90:38:59:C8:C0:C3:EB:B8:75:9E:CE:4E:25:57:22:5F:F5:75:8B:BD:38:EB:D4:82:76:60:1E:1B:D5:80:97");
+            put("tubitakkamusmsslkoksertifikasi-surum1",
+                    "46:ED:C3:68:90:46:D5:3A:45:3F:B3:10:4A:B8:0D:CA:EC:65:8B:26:60:EA:16:29:DD:7E:86:79:90:64:87:16");
+            put("twcaglobalrootca",
+                    "59:76:90:07:F7:68:5D:0F:CD:50:87:2F:9F:95:D5:75:5A:5B:2B:45:7D:81:F3:69:2B:61:0A:98:67:2F:0E:1B");
+            put("twcarootcertificationauthority",
+                    "BF:D8:8F:E1:10:1C:41:AE:3E:80:1B:F8:BE:56:35:0E:E9:BA:D1:A6:B9:BD:51:5E:DC:5C:6D:5B:87:11:AC:44");
+            put("ucaextendedvalidationroot",
+                    "D4:3A:F9:B3:54:73:75:5C:96:84:FC:06:D7:D8:CB:70:EE:5C:28:E7:73:FB:29:4E:B4:1E:E7:17:22:92:4D:24");
+            put("ucaglobalg2root",
+                    "9B:EA:11:C9:76:FE:01:47:64:C1:BE:56:A6:F9:14:B5:A5:60:31:7A:BD:99:88:39:33:82:E5:16:1A:A0:49:3C");
+        }
+    };
+
+    public static final HashSet<String> AMAZON_CA_EXPIRY_EXC_ENTRIES = new HashSet<>() {
+        {
+            add("globalsignrootca-r2");
+            add("cybertrustglobalroot");
+        }
+    };
+}
diff a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
--- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
+++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java
@@ -314,40 +314,48 @@
 
     private static boolean atLeastOneFailed = false;
 
     private static MessageDigest md;
 
+    private static final int OVERALL_CA_CERT_COUNT = COUNT + AmazonCACertConstants.AMAZON_CA_CERT_COUNT;
+
     public static void main(String[] args) throws Exception {
         System.out.println("cacerts file: " + CACERTS);
+        FINGERPRINT_MAP.putAll(AmazonCACertConstants.AMAZON_CA_FINGERPRINT_MAP);
+        EXPIRY_EXC_ENTRIES.addAll(AmazonCACertConstants.AMAZON_CA_EXPIRY_EXC_ENTRIES);
 
         // verify integrity of cacerts
         md = MessageDigest.getInstance("SHA-256");
         byte[] data = Files.readAllBytes(Path.of(CACERTS));
+        /* Ignore whole-file checksum as the checksum of the cacerts 
+         * file changes with each build, due to the way we merge upstream 
+         * OpenJDK certs and Amazon Linux certs at build time.
         String checksum = HEX.formatHex(md.digest(data));
         if (!checksum.equals(CHECKSUM)) {
             atLeastOneFailed = true;
             System.err.println("ERROR: wrong checksum " + checksum);
             System.err.println("Expected checksum " + CHECKSUM);
         }
+        */
 
         KeyStore ks = KeyStore.getInstance("JKS");
         ks.load(new ByteArrayInputStream(data), "changeit".toCharArray());
 
         // check the count of certs inside
-        if (ks.size() != COUNT) {
+        if (ks.size() != OVERALL_CA_CERT_COUNT) {
             atLeastOneFailed = true;
             System.err.println("ERROR: " + ks.size() + " entries, should be "
-                    + COUNT);
+                    + OVERALL_CA_CERT_COUNT);
         }
 
         System.out.println("Trusted CA Certificate count: " + ks.size());
 
         // also ensure FINGERPRINT_MAP lists correct count
-        if (FINGERPRINT_MAP.size() != COUNT) {
+        if (FINGERPRINT_MAP.size() != OVERALL_CA_CERT_COUNT) {
             atLeastOneFailed = true;
             System.err.println("ERROR: " + FINGERPRINT_MAP.size()
-                    + " FINGERPRINT_MAP entries, should be " + COUNT);
+                    + " FINGERPRINT_MAP entries, should be " + OVERALL_CA_CERT_COUNT);
         }
 
         // check that all entries in the map are in the keystore
         for (String alias : FINGERPRINT_MAP.keySet()) {
             if (!ks.isCertificateEntry(alias)) {
diff a/test/jdk/tools/launcher/HelpFlagsTest.java b/test/jdk/tools/launcher/HelpFlagsTest.java
--- a/test/jdk/tools/launcher/HelpFlagsTest.java
+++ b/test/jdk/tools/launcher/HelpFlagsTest.java
@@ -61,11 +61,14 @@
         // Oracle proprietary tools without help message.
         "javacpl",
         "jmc",
         "jweblauncher",
         "jcontrol",
-        "ssvagent"
+        "ssvagent",
+        // asprof don't test
+        "asprof",
+        "jfrconv"
     };
 
     // Lists which tools support which flags.
     private static class ToolHelpSpec {
         String toolname;
diff a/test/jdk/tools/launcher/VersionCheck.java b/test/jdk/tools/launcher/VersionCheck.java
--- a/test/jdk/tools/launcher/VersionCheck.java
+++ b/test/jdk/tools/launcher/VersionCheck.java
@@ -42,10 +42,11 @@
 
 public class VersionCheck extends TestHelper {
 
     // tools that do not accept -J-option
     static final String[] BLACKLIST_JOPTION = {
+        "asprof",
         "controlpanel",
         "jabswitch",
         "java-rmi",
         "java-rmi.cgi",
         "java",
@@ -55,20 +56,22 @@
         "jaccesswalker",
         "jaccesswalker-32",
         "javaw",
         "javaws",
         "jcontrol",
+        "jfrconv",
         "jmc",
         "jmc.ini",
         "jweblauncher",
         "jpackage",
         "ssvagent",
         "jwebserver"
     };
 
     // tools that do not accept -version
     static final String[] BLACKLIST_VERSION = {
+        "asprof",
         "controlpanel",
         "jaccessinspector",
         "jaccessinspector-32",
         "jaccesswalker",
         "jaccesswalker-32",
@@ -83,10 +86,11 @@
         "jconsole",
         "jcontrol",
         "jdeprscan",
         "jdeps",
         "jfr",
+        "jfrconv",
         "jimage",
         "jinfo",
         "jlink",
         "jmap",
         "jmod",
diff a/version.txt b/version.txt
--- /dev/null
+++ b/version.txt
@@ -0,0 +1,1 @@
+25.0.0.36.2
