RFR: 8256011: Shenandoah: Don't resurrect finalizably reachable objects [v5]

Zhengyu Gu zgu at openjdk.java.net
Tue Nov 10 14:37:55 UTC 2020


On Tue, 10 Nov 2020 13:28:13 GMT, Roman Kennke <rkennke at openjdk.org> wrote:

>> In the weak-LRB we currently return referents when it is 'marked', that is when it's either reachable strongly or through a finalizable object. This means a finalizable object can be resurrected by Reference.get(), which is wrong. Only truly strongly reachable objects should be returned by Reference.get() during weak-reference-processing. 
>> 
>> I had to reconsider the way we call into runtime-LRBs from generated code for these reasons:
>>  - We need to distinguish phantom, weak and strong reference strength, and native vs in-heap access. Those are two orthogonal dimensions
>>  - We can have strong and phantom native referents, and strong and weak in-heap referents
>>  - Native referents are never compressed
>> 
>> Note that this depends on PR#1140.
>> 
>> Testing:
>>  - [x] hotspot_gc_shenandoah
>>  - [x] tier1 +UseShenandoahGC +ShenandoahVerify
>>  - [ ] tier2 +UseShenandoahGC +ShenandoahVerify
>
> Roman Kennke has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Aarch64 parts

Changes requested by zgu (Reviewer).

src/hotspot/cpu/x86/gc/shenandoah/shenandoahBarrierSetAssembler_x86.cpp line 278:

> 276:   bool is_phantom = ShenandoahBarrierSet::is_phantom_access(decorators);
> 277:   bool is_native  = ShenandoahBarrierSet::is_native_access(decorators);
> 278:   bool is_narrow  = LP64_ONLY(UseCompressedOops &&) !is_native;

This seems wrong for 32-bits. should be:

is_narrow  = LP64_ONLY(UseCompressedOops &&) NOT_LP64(false &&) !is_native;

src/hotspot/cpu/aarch64/gc/shenandoah/shenandoahBarrierSetAssembler_aarch64.cpp line 237:

> 235:   bool is_phantom = ShenandoahBarrierSet::is_phantom_access(decorators);
> 236:   bool is_native  = ShenandoahBarrierSet::is_native_access(decorators);
> 237:   bool is_narrow  = LP64_ONLY(UseCompressedOops &&) !is_native;

Don't need LP64_ONLY, aarch64 always 64-bits.

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

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


More information about the shenandoah-dev mailing list