RFR: 8302873: ZGC: dump barrier data in C2 Mach nodes

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Wed Feb 22 09:50:01 UTC 2023


On Tue, 21 Feb 2023 10:42:40 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:

>> This changeset adds (debug-only) support for printing ZGC barrier data in a human-readable form as part of the C2 Mach node dumps. This is useful for debugging, IGV visualization (e.g. to create [barrier-specific filters](https://user-images.githubusercontent.com/8792647/216639224-aa288dd8-72cc-43a5-a445-a93d65004dac.png)), and for matching nodes in IR test framework checks (e.g. to write [barrier optimization tests](https://github.com/openjdk/zgc/blob/zgc_generational/test/hotspot/jtreg/compiler/gcbarriers/TestZGCBarrierElision.java)).
>> 
>> #### Testing
>> 
>> - tier1 (x64 and aaarch64; linux, windows, and macosx; release and debug mode)
>> - tested manually that the expected barrier information is dumped when using ZGC
>> - tested manually that the dumps remain unchanged when using another GC
>
> src/hotspot/share/gc/shared/c2/barrierSetC2.hpp line 309:
> 
>> 307: #ifndef PRODUCT
>> 308:   virtual void dump_barrier_data(const MachNode* mach, outputStream* st) const {
>> 309:     st->print("%x", mach->barrier_data());
> 
> Just wondering, do we ever have barrier data without ZGC?

No, this is just a generic fallback implementation in case other GCs want to adopt ZGC's very late barrier expansion model. Would you prefer to remove the `st->print` statement? Either way is fine by me.

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

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


More information about the hotspot-compiler-dev mailing list