JDK-8347405 : MergeStores with reverse bytes order value
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 25
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2025-01-10
  • Updated: 2025-11-27
  • Resolved: 2025-03-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 25
25 b14Fixed
Related Reports
Causes :  
Relates :  
Description
Now MergeStores optimization only support stored value in sequential order, not support value in reverse order. For example, in little endian machine, code piece like below can not be merged

public void patchInt(int offset, int x) {
   byte[] elems = this.elems;
   elems[offset    ] = (byte) (x >> 24);
   elems[offset + 1] = (byte) (x >> 16);
   elems[offset + 2] = (byte) (x >> 8);
   elems[offset + 3] = (byte)  x;
}

This pattern may appeared in access data between big-endian and little-endian.
Comments
Changeset: 59282092 Branch: master Author: Kuai Wei <kuaiwei.kw@alibaba-inc.com> Committer: Shaojin Wen <swen@openjdk.org> Date: 2025-03-11 02:07:19 +0000 URL: https://git.openjdk.org/jdk/commit/5928209280e7a655a22f11bc03eae32a4e99756c
11-03-2025

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/23030 Date: 2025-01-10 09:07:11 +0000
10-01-2025