RFR: 8292878: x86: Make scratch register usage explicit in assembler code [v4]

Vladimir Ivanov vlivanov at openjdk.org
Thu Aug 25 22:19:14 UTC 2022


> Improve MacroAssembler API and make scratch register usages explicit at use sites.
> 
> Different parts of JVM have different assumptions about scratch registers and
> implicit assumptions in MacroAssembler makes it harder to reason about the
> correctness of generated code.
> 
> Most of scratch register usages relate to `AddressLiteral` on x86_64.  In such case the argument is turned into a default one (with `noreg` as a default) and implementation asserts that scratch register should be provided when the address is not guaranteed to be always reachable.
> 
> Otherwise, scratch register argument is required to be explicitly provided.
> 
> The only case left (mostly) intact is `call(AddressLiteral)`, but I switched it from `rscratch` (`r10`) to `rax`.
> 
> Testing:
> - [x] hs-tier1 - hs-tier4 (w/ -XX:+-ForceUnreachable)
> - [x] x86_32 build

Vladimir Ivanov has updated the pull request incrementally with one additional commit since the last revision:

  x86_32

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10003/files
  - new: https://git.openjdk.org/jdk/pull/10003/files/ed4dc939..f920a0fe

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10003&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10003&range=02-03

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/10003.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10003/head:pull/10003

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


More information about the hotspot-dev mailing list