-
Bug
-
Resolution: Fixed
-
P5
-
11, 17, 20, 21
-
b19
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8310195 | 17.0.9-oracle | Tobias Hartmann | P5 | Resolved | Fixed | b01 |
JDK-8307706 | 17.0.8 | Guoxiong Li | P5 | Resolved | Fixed | b02 |
Currently, the method `Assembler::prefix`, shown below, may emit two REX prefixes when the `adr` needs `REX_B` and `dst` needs `REX_R`. It seems this code path is not invoked by any caller, so the bug is not exposed now.
```
void Assembler::prefix(Register dst, Address adr, Prefix p) {
if (adr.base_needs_rex()) {
if (adr.index_needs_rex()) {
assert(false, "prefix(Register dst, Address adr, Prefix p) does not support handling of an X");
} else {
prefix(REX_B); // <-- here
}
} else {
if (adr.index_needs_rex()) {
assert(false, "prefix(Register dst, Address adr, Prefix p) does not support handling of an X");
}
}
if (dst->encoding() >= 8) {
p = (Prefix)(p | REX_R);
}
if (p != Prefix_EMPTY) {
// do not generate an empty prefix
prefix(p);
}
}
```
```
void Assembler::prefix(Register dst, Address adr, Prefix p) {
if (adr.base_needs_rex()) {
if (adr.index_needs_rex()) {
assert(false, "prefix(Register dst, Address adr, Prefix p) does not support handling of an X");
} else {
prefix(REX_B); // <-- here
}
} else {
if (adr.index_needs_rex()) {
assert(false, "prefix(Register dst, Address adr, Prefix p) does not support handling of an X");
}
}
if (dst->encoding() >= 8) {
p = (Prefix)(p | REX_R);
}
if (p != Prefix_EMPTY) {
// do not generate an empty prefix
prefix(p);
}
}
```
- backported by
-
JDK-8307706 [X86] Do not emit two REX prefixes in Assembler::prefix
- Resolved
-
JDK-8310195 [X86] Do not emit two REX prefixes in Assembler::prefix
- Resolved
- links to
-
Commit openjdk/jdk17u-dev/6a849743
-
Commit openjdk/jdk/49726ee3
-
Review openjdk/jdk17u-dev/1334
-
Review openjdk/jdk/13369
(1 links to)