Skip to content

对 Java 26 默认启用压缩对象头#5274

Merged
Glavo merged 1 commit into
HMCL-dev:mainfrom
Glavo:vm-options
Jan 21, 2026
Merged

对 Java 26 默认启用压缩对象头#5274
Glavo merged 1 commit into
HMCL-dev:mainfrom
Glavo:vm-options

Conversation

@Glavo
Copy link
Copy Markdown
Member

@Glavo Glavo commented Jan 21, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request enables compressed object headers for Java 26 by updating the version check condition in the launcher's JVM argument generation logic.

Changes:

  • Updated the Java version check for enabling UseCompactObjectHeaders from checking only Java 25 to checking Java versions 25 and 26

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

if (is64bit && javaVersion == 25) {
if (is64bit && (javaVersion >= 25 && javaVersion <= 26)) {
Copy link

Copilot AI Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition javaVersion >= 25 && javaVersion <= 26 requires manual updates for each new Java version. Based on the JEP for Compact Object Headers, this feature is expected to remain available in future Java versions. Consider using javaVersion >= 25 instead to avoid needing updates when Java 27 and later versions are released. This pattern is consistent with other version checks in this file.

Suggested change
if (is64bit && (javaVersion >= 25 && javaVersion <= 26)) {
if (is64bit && javaVersion >= 25) {

Copilot uses AI. Check for mistakes.
@Glavo Glavo merged commit 55cbb6c into HMCL-dev:main Jan 21, 2026
8 checks passed
@Glavo Glavo deleted the vm-options branch January 21, 2026 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants