RFR: 8286897: Loom: Cleanup x86_64 StubGenerator [v2]
Vladimir Kozlov
kvn at openjdk.java.net
Tue May 17 18:25:40 UTC 2022
On Tue, 17 May 2022 17:21:10 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> During x86_32 porting, I ended up rewriting the copy of x86_64 StubGenerator significantly to make it more streamlined. The original x86_64 StubGenerator should enjoy the similar streamlining, since it would likely to be the template for many other architectures.
>>
>> There should be no behavior changes. The changes themselves should speak for themselves, but here is a brief list:
>> - no need for `assert_asm` macros, instead do the inline checks, like the rest of Hotspot and Loom code
>> - `_masm` and `masm` shadowing can just use whatever is currently defined as `__`
>> - more strong cohesion between `post_call_nop`, its associated PC and its oopmap
>> - consistently use `call_VM_leaf` that only takes the number of arguments, as we are doing argument pushes ourselves anyway;
>> - for many moves, it is easier to use `ptr` flavors (e.g. `testq` -> `testptr`) to ease copy-pasting to other arches;
>> - `generate_cont_thaw` should just do the `enabled()` check and carry the `StubCodeMark`, like other stubs do;
>> - inline comments are reflowed to block-like comments, matching the usual style of stub code;
>> - labels are prefixed with `L_` for clarity (used in some places in Hotspot);
>> - `jfr_prolog` and `jfr_epilog` are used only once and do not carry their weight;
>> - `continuation_*` are documented a bit better;
>>
>> Additional testing:
>> - [x] Linux x86_64 fastdebug, `java/lang/Thread/virtual`
>> - [x] Linux x86_64 fastdebug, `serviceability/jvmti`
>> - [x] Linux x86_64 fastdebug, `runtime/vthread`
>
> Aleksey Shipilev has updated the pull request incrementally with one additional commit since the last revision:
>
> More changes from x86_32 PR
Nice cleanup.
src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 7455:
> 7453: OopMapSet* oop_maps = new OopMapSet();
> 7454: OopMap* map = new OopMap(framesize, 1);
> 7455: oop_maps->add_gc_map(the_pc - start, map);
Use `frame_complete`.
src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 7460:
> 7458: __ movptr(c_rarg0, r15_thread);
> 7459: __ movptr(c_rarg1, rsp);
> 7460: __ call_VM_leaf(Continuation::freeze_entry(), 2);
Was it bug to not set `c_rarg1`? stubGenerator_aarch64.cpp has the same issue.
src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 7666:
> 7664: OopMapSet* oop_maps = new OopMapSet();
> 7665: OopMap* map = new OopMap(framesize, 1); // rbp
> 7666: oop_maps->add_gc_map(the_pc - start, map);
You can use `frame_complete` here too.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8755
More information about the hotspot-dev
mailing list