RFR: 8261071: AArch64: Refactor interpreter native wrappers

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

RFR: 8261071: AArch64: Refactor interpreter native wrappers

Anton Kozlov-2
Please review refactoring of interpreter signature handlers on aarch64. The main objective is to prepare for the new calling convention of macOS/AArch64, although this patch brings nothing from the new convention.

Tested with signature stress tests and tier1 on Linux/AArch64.

I have stared with a single function implementing SlowSignatureHandler (https://github.com/openjdk/jdk/commit/5ef1bd15c3bb174f4aed5e358d1ce2fff2846858#diff-1ff58ce70aeea7e9842d34e8d8fd9c94dd91182999d455618b2a171efd8f742cR164). The single function was compact but obscure. I was shuffling it until I eventually came to something similar of the initial approach with few pieces abstracted away.

The most notable changes in the final version should be
* we count only parameters passed in registers
* ldrw/strw are used to pass via stack in SignatureHandlerGenerator::pass_int

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

Commit messages:
 - Fix java stack access for int & float
 - Extract functions from SignatureHandlerGenerator
 - Finish SlowSignatureHandler
 - Simplify pass_fp/gp
 - Split load
 - Split SSh to pass_gp/fp
 - Single function for SlowSignatureHandler

Changes: https://git.openjdk.java.net/jdk/pull/2413/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2413&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261071
  Stats: 266 lines in 2 files changed: 39 ins; 147 del; 80 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2413.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2413/head:pull/2413

PR: https://git.openjdk.java.net/jdk/pull/2413
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261071: AArch64: Refactor interpreter native wrappers

Andrew Haley-2
On Thu, 4 Feb 2021 22:01:34 GMT, Anton Kozlov <[hidden email]> wrote:

> Please review refactoring of interpreter signature handlers on aarch64. The main objective is to prepare for the new calling convention of macOS/AArch64, although this patch brings nothing from the new convention.
>
> Tested with signature stress tests and tier1 on Linux/AArch64.
>
> I have stared with a single function implementing SlowSignatureHandler (https://github.com/openjdk/jdk/commit/5ef1bd15c3bb174f4aed5e358d1ce2fff2846858#diff-1ff58ce70aeea7e9842d34e8d8fd9c94dd91182999d455618b2a171efd8f742cR164). The single function was compact but obscure. I was shuffling it until I eventually came to something similar of the initial approach with few pieces abstracted away.
>
> The most notable changes in the final version should be
> * we count only parameters passed in registers
> * ldrw/strw are used to pass via stack in SignatureHandlerGenerator::pass_int

Thanks, that looks way better. Are all platform differences handled by Interpreter::local_offset_in_bytes() ?

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

PR: https://git.openjdk.java.net/jdk/pull/2413
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261071: AArch64: Refactor interpreter native wrappers

Anton Kozlov-2
On Fri, 5 Feb 2021 09:56:25 GMT, Andrew Haley <[hidden email]> wrote:

> Are all platform differences handled by Interpreter::local_offset_in_bytes() ?

Java local structure is very similar between CPUs. The function is a simple one:
  // Local values relative to locals[n]
  static int  local_offset_in_bytes(int n) {
    return ((frame::interpreter_frame_expression_stack_direction() * n) * stackElementSize);
  }

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

PR: https://git.openjdk.java.net/jdk/pull/2413
Reply | Threaded
Open this post in threaded view
|

Re: RFR: 8261071: AArch64: Refactor interpreter native wrappers

Andrew Haley-2
In reply to this post by Anton Kozlov-2
On Thu, 4 Feb 2021 22:01:34 GMT, Anton Kozlov <[hidden email]> wrote:

> Please review refactoring of interpreter signature handlers on aarch64. The main objective is to prepare for the new calling convention of macOS/AArch64, although this patch brings nothing from the new convention.
>
> Tested with signature stress tests and tier1 on Linux/AArch64.
>
> I have stared with a single function implementing SlowSignatureHandler (https://github.com/openjdk/jdk/commit/5ef1bd15c3bb174f4aed5e358d1ce2fff2846858#diff-1ff58ce70aeea7e9842d34e8d8fd9c94dd91182999d455618b2a171efd8f742cR164). The single function was compact but obscure. I was shuffling it until I eventually came to something similar of the initial approach with few pieces abstracted away.
>
> The most notable changes in the final version should be
> * we count only parameters passed in registers
> * ldrw/strw are used to pass via stack in SignatureHandlerGenerator::pass_int

Marked as reviewed by aph (Reviewer).

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

PR: https://git.openjdk.java.net/jdk/pull/2413
Reply | Threaded
Open this post in threaded view
|

Integrated: 8261071: AArch64: Refactor interpreter native wrappers

Anton Kozlov-2
In reply to this post by Anton Kozlov-2
On Thu, 4 Feb 2021 22:01:34 GMT, Anton Kozlov <[hidden email]> wrote:

> Please review refactoring of interpreter signature handlers on aarch64. The main objective is to prepare for the new calling convention of macOS/AArch64, although this patch brings nothing from the new convention.
>
> Tested with signature stress tests and tier1 on Linux/AArch64.
>
> I have stared with a single function implementing SlowSignatureHandler (https://github.com/openjdk/jdk/commit/5ef1bd15c3bb174f4aed5e358d1ce2fff2846858#diff-1ff58ce70aeea7e9842d34e8d8fd9c94dd91182999d455618b2a171efd8f742cR164). The single function was compact but obscure. I was shuffling it until I eventually came to something similar of the initial approach with few pieces abstracted away.
>
> The most notable changes in the final version should be
> * we count only parameters passed in registers
> * ldrw/strw are used to pass via stack in SignatureHandlerGenerator::pass_int

This pull request has now been integrated.

Changeset: 682e78e8
Author:    Anton Kozlov <[hidden email]>
Committer: Vladimir Kempik <[hidden email]>
URL:       https://git.openjdk.java.net/jdk/commit/682e78e8
Stats:     266 lines in 2 files changed: 39 ins; 147 del; 80 mod

8261071: AArch64: Refactor interpreter native wrappers

Reviewed-by: aph

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

PR: https://git.openjdk.java.net/jdk/pull/2413