Skip to content
欢迎扫码关注公众号

JEP 297: Unified arm32/arm64 Port | 统一的 arm32/arm64 端口

摘要

将由 Oracle 贡献的 HotSpot 统一端口集成到 JDK 中,以支持 arm32 和 arm64。

动机

主要动机是在 JDK 中提供对 arm32 / aarch32 的支持。尽管已经有一些努力支持 arm32 / aarch32,但目前 JDK 中唯一维护的选项是 Zero 端口。来自 Oracle 的贡献为 ARM 提供了完整的 C1 和 C2 支持,使其与其他体系结构相媲美。

该端口还提供了对 arm64 / aarch64 的支持,但这并不是主要动机,因为 JDK 已经包含了一个仅支持 aarch64 的端口。

描述

来自 Oracle 的贡献为 arm32 和 arm64 提供了 C1 和 C2 的支持。这段代码已经合并到 JDK 9 树的 aarch32 项目区域的一个单独的存储库中。

Oracle 宣布拟开源 ARM 端口的意图是在 2016 年 8 月 23 日的 aarch32 邮件列表上公布的,并且在 aarch32 邮件列表上进行了几次讨论。请点击以下链接查看这些讨论。

在 2016 年 10 月 21 日星期五的一个公开电话会议上,大家一致同意应该将此功能包含在 JDK 中。没有正式的记录,但会议的笔记已经 发布到了 aarch32 列表中

Oracle 贡献的 Webrev 可在 http://cr.openjdk.java.net/~bobv/arm3264/webrev 上找到,合并的 jdk9 树可以在 http://hg.openjdk.java.net/aarch32-port/jdk9-arm3264 上找到。

合并的树可以构建 arm32 或 arm64 的最小、客户端或服务器 VM。该树还可以构建现有的 aarch64 端口。

还有一个额外的 ARM 特定选项 --with-cpu-port,可用于指定新的 aarch64 构建 --with-cpu-port=arm64 或现有的 aarch64 构建 --with-cpu-port=aarch64。如果未指定选项,则构建将默认为现有的 aarch64 构建。

打算保持 aarch64 的默认构建方式不变。

测试

由于它是 Oracle 的专有 VM 的一部分,因此该端口已经在 Oracle 内部进行了测试。因此,它已经通过 JPRT 和其他内部测试进行了测试。

在 aarch32 项目中的 JDK 9 树已经使用 jtreg 进行了测试,包括硬 / 软 FP、发布 / 调试构建和客户端 / 服务器构建等各种配置。发现了一些合并源代码的问题,已经修复了这些问题。

风险

对共享代码的更改已经尽量减少。贡献的端口与 aarch64 端口共享 #ifdefs。此外,ARM 的 #ifdefs 已经存在于共享代码中。这意味着对共享代码的更改仅限于构建更改和 libproc.h 中的单个 #ifdef

由于源代码来自 Oracle 内部的闭源端口,因此在 Oracle 内部它们是一个已知的数量,这极大地降低了将其合并到 JDK 中所带来的风险。

由于将会有两个 aarch64 端口,即现有的 aarch64 端口和统一的 arm32 / arm64 端口,因此在构建 JDK 时可能会导致人们的困惑。

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.