RFR: 8293618: x86: Wrong code generation in class Assembler

Quan Anh Mai duke at openjdk.org
Mon Sep 12 15:36:47 UTC 2022


Hi,

This patch fixes some issues in the code generation of x86 assembler:

- `Assembler::testl` misses `prefix(dst)`
- `Assembler::addw` misses the 0x66 prefix
- `Assembler::emit_operand` needs the length of the instruction from the address operand, this is often forgotten, making this parameter explicit to prevent potential issues
- The assembler should not do optimisations that change the actual emitted instructions, these should be moved to `MacroAssembler` instead

AFAICT there is no failure due to these mistakes. Please take a look and give reviews.
Thanks you very much.

-------------

Commit messages:
 - fix code generation

Changes: https://git.openjdk.org/jdk/pull/10240/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10240&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8293618
  Stats: 540 lines in 5 files changed: 62 ins; 25 del; 453 mod
  Patch: https://git.openjdk.org/jdk/pull/10240.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10240/head:pull/10240

PR: https://git.openjdk.org/jdk/pull/10240


More information about the hotspot-dev mailing list