RFR: Refactor heap verification
Zhengyu Gu
zgu at redhat.com
Thu Jun 1 20:57:52 UTC 2017
On 06/01/2017 04:44 PM, Aleksey Shipilev wrote:
> On 06/01/2017 10:41 PM, Zhengyu Gu wrote:
>> Is this right?
>>
>> 239 if (ShenandoahVerify) {
>> 240 ReservedSpace verify_bitmap(_bitmap_size, page_size);
>> 241 os::commit_memory_or_exit(verify_bitmap.base(), verify_bitmap.size(),
>> false,
>> 242 "couldn't allocate verification bitmap");
>> 243 MemTracker::record_virtual_memory_type(verify_bitmap.base(), mtGC);
>> 244 MemRegion verify_bitmap_region = MemRegion((HeapWord *)
>> verify_bitmap.base(), verify_bitmap.size() / HeapWordSize);
>> 245 _verification_bit_map.initialize(_heap_region, verify_bitmap_region);
>> 246 }
>> 247
>> 248 _verifier = new ShenandoahVerifier(this, &_verification_bit_map);
>> 249
>>
>> You want to construct _verifier without initialized bitmap?
>
> Verifier would barf when used without ShenandoahVerify enabled. And this saves
> NULL-checking on every verifier()->foo() call. Seems like the lesser evil,
> although we need to think if we just want to initialize verification bitmap
> unconditionally, because sometimes Universe asks us to verify anyway.
Well, it can barf in SH::verifier() method, and save the checking inside
verifier.
-Zhengyu
>
> -Aleksey
>
More information about the shenandoah-dev
mailing list