RFR: 8268829: Provide an optimized way to walk the stack with Class object only [v4]

Mandy Chung mchung at openjdk.org
Thu Aug 24 16:39:33 UTC 2023


On Thu, 24 Aug 2023 13:47:42 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Mandy Chung has updated the pull request incrementally with three additional commits since the last revision:
>> 
>>  - fix whitespace
>>  - move retainClassRef to ClassFrameInfo as a bit set in the flags field
>>  - fixup the factory methods
>
> src/java.base/share/classes/java/lang/StackStreamFactory.java line 1083:
> 
>> 1081:     private static boolean filterStackWalkImpl(Class<?> c) {
>> 1082:         return stackWalkImplClasses.contains(c) ||
>> 1083:                 c.getPackageName().equals("java.util.stream");
> 
> There is a small semantic difference here and in the change below compared to the original code: the original code would have also included sub-packages, where the new code will not. Since neither `java.util.stream` nor `java.lang.invoke` have sub-package I guess it's of no concern for now.

Right, that's the reason for this change.  Subpackages if added in the future may not need to be filtered as it may not the implementation of streams and method handles.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15370#discussion_r1304599669


More information about the core-libs-dev mailing list