RFR: 8281815: x86: Use short jumps in TIG::generate_slow_signature_handler
Richard Reingruber
rrich at openjdk.java.net
Thu Feb 17 08:47:12 UTC 2022
On Tue, 15 Feb 2022 09:40:28 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Similar to [JDK-8281744](https://bugs.openjdk.java.net/browse/JDK-8281744), this change improves `TemplateInterpreterGenerator::generate_slow_signature_handler`: there are only a few moves between the jumps, and we can tell `MacroAssembler` those can be short. This code is used to process arguments after the slow call to VM, so the performance improvement is drowned by the call itself. This makes interpreter code a bit more compact, though.
>
> Additional testing:
> - [x] Linux x86_64 fastdebug `hotspot:tier1`
> - [x] Linux x86_32 fastdebug `hotspot:tier1`
> > On s390, being CISC too, there are similar issues. We addressed them with `NearLabel`, `branch_optimized`, and `compare_and_branch_optimized`. They provide a higher level of abstraction which helps writing better code without knowing all the details, which at least I instantly forget after looking into the manual.
>
> In x86 `MacroAssembler` there are `jcc` and `jccb` for this. When `MacroAssembler` can make `jcc`, it would, but that requires the jump target to be already bound, so that jump offset is already known. For _forward_ jumps, though, `MacroAssembler` cannot know this, so in those cases we need to tell it explicitly. `NearLabel` looks like another way of doing so.
Yes it is another way of doing so. For me the intend is clearer. Also you can pass a `NearLabel` to an assembler method that takes a `Label` parameter and there you can optimize if the passed `Label` is actually a `NearLabel`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7475
More information about the hotspot-dev
mailing list