RFR: 8260012: Reduce inclusion of collectedHeap.hpp and heapInspection.hpp [v2]

Ioi Lam iklam at openjdk.java.net
Wed Feb 3 06:40:08 UTC 2021


On Tue, 2 Feb 2021 12:09:22 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

>> Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains three additional commits since the last revision:
>> 
>>  - @tschatzl and @stefank comments
>>  - Merge branch 'master' into 8260012-reduce-inclue-collectedHeap-heapInspection-hpp
>>  - 8260012: Reduce inclusion of collectedHeap.hpp and heapInspection.hpp
>
> src/hotspot/share/gc/shared/memAllocator.hpp line 30:
> 
>> 28: #include "memory/memRegion.hpp"
>> 29: #include "oops/oopsHierarchy.hpp"
>> 30: #include "runtime/thread.hpp"
> 
> If we want to, this could be changed to a forward declaration if we removed the default value (Thread* thread = Thread::current()) of the constructors. Not needed for this RFE though.

memAllocator.hpp is not included very often (only 65 out of ~1000 .o files), so I decided to leave it as is.

> src/hotspot/cpu/arm/frame_arm.cpp line 518:
> 
>> 516:         obj = *(oop*)res_addr;
>> 517:       }
>> 518:       assert(obj == NULL || Universe::is_in_heap(obj), "sanity check");
> 
> Could have been changed to is_in_heap_or_null.

Fixed

> src/hotspot/cpu/ppc/frame_ppc.cpp line 308:
> 
>> 306:       case T_ARRAY: {
>> 307:         oop obj = *(oop*)tos_addr;
>> 308:         assert(obj == NULL || Universe::is_in_heap(obj), "sanity check");
> 
> Could have been changed to is_in_heap_or_null.

Fixed. I also change other frame_<cpu>.cpp files to use is_in_heap_or_null.

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

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



More information about the hotspot-gc-dev mailing list