On Wed, 8 Feb 2023 00:37:57 GMT, Mandy Chung <mch...@openjdk.org> wrote:

>> Adam Sotona 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 four additional 
>> commits since the last revision:
>> 
>>  - j.l.r.ProxyGenerator fix - Classfile API moved under 
>> jdk.internal.classfile package
>>  - Merge branch 'JDK-8294982' into JDK-8294961
>>  - Merge branch 'JDK-8294982' into JDK-8294961
>>  - 8294961: java.base java.lang.reflect.ProxyGenerator uses ASM to generate 
>> proxy classes
>
> src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java line 423:
> 
>> 421:     private byte[] generateClassFile() {
>> 422:         var localCache = new HashMap<ClassDesc, 
>> ClassHierarchyResolver.ClassHierarchyInfo>();
>> 423:         return Classfile.build(classDesc, 
>> List.of(Classfile.Option.classHierarchyResolver(classDesc ->
> 
> How/when is `ClassHierarchyResolver` being called?   I didn't dig deeper.

`ClassHierarchyResolver` is used for stack maps generation in situations when 
it is not clear if the given type is class or interface and to resolve class 
hierarchy (parent - child relations and common parent).
Classfile API is not using class loaders by default (In contrast to ASM 
library) and there are alternative ways how to provide required info. However 
in this situation is class hierarchy resolution asking provided class loader.

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

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

Reply via email to