Integrated: 8292878: x86: Make scratch register usage explicit in assembler code
Vladimir Ivanov
vlivanov at openjdk.org
Tue Aug 30 18:48:05 UTC 2022
On Wed, 24 Aug 2022 18:42:28 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> 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
This pull request has now been integrated.
Changeset: 6e248279
Author: Vladimir Ivanov <vlivanov at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/6e248279cfb44cf6a1b5156a41200bf9c166388f
Stats: 1210 lines in 32 files changed: 230 ins; 143 del; 837 mod
8292878: x86: Make scratch register usage explicit in assembler code
Reviewed-by: kvn, shade
-------------
PR: https://git.openjdk.org/jdk/pull/10003
More information about the hotspot-dev
mailing list