Integrated: 8261954: Dependencies: Improve iteration over class hierarchy under context class
Vladimir Ivanov
vlivanov at openjdk.java.net
Fri Feb 26 08:22:54 UTC 2021
On Thu, 18 Feb 2021 17:05:08 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:
> Simplify `ClassHierarchyWalker::find_witness_anywhere()` which iterates over class hierarchy under context class searching for witnesses.
>
> Current implementation traverses the hierarchy in a breadth-first manner and keeps a stack-allocated array to keep a worklist.
> But all the subclasses are already part of a singly linked list formed by `Klass::subklass()`/`next_sibling()`/`superklass()`.
>
> Proposed refactoring gets rid of the explicit worklist and switches to the traversal over the linked list (encapsulated into `ClassHierarchyIterator`). It performs depth-first pre-order hierarchy traversal.
>
> (There are some other minor refactorings applied in `ClassHierarchyWalker` along the way.)
>
> Testing:
> - [x] hs-tier1 - hs-tier8
> - [x] additional verification that CHA decisions aren't affected
This pull request has now been integrated.
Changeset: 0a4e710f
Author: Vladimir Ivanov <vlivanov at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/0a4e710f
Stats: 173 lines in 3 files changed: 68 ins; 69 del; 36 mod
8261954: Dependencies: Improve iteration over class hierarchy under context class
Reviewed-by: kvn, coleenp, eosterlund
-------------
PR: https://git.openjdk.java.net/jdk/pull/2630
More information about the hotspot-compiler-dev
mailing list