On Wed, 9 Sep 2026 17:35:53 GMT, Coleen Phillimore <[email protected]> wrote:

>> Remove the upcall to addClass during class loading.  The comment says it's 
>> only so GC can keep classes alive while the class loader is alive.  We have 
>> other ways to do that. There were some JVMTI tests in the past that failed 
>> without this vector but today seems to be only one test.  Maybe there's some 
>> code that has a dependency on this in heap walking.
>> Tested tier1-6
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Coleen Phillimore has updated the pull request incrementally with one 
> additional commit since the last revision:
> 
>   Fix wording in test. Not a special root reference.

src/hotspot/share/prims/jvmtiTagMap.cpp line 2472:

> 2470: inline bool CallbackInvoker::report_other_reference(const 
> JvmtiHeapwalkObject& referrer, const JvmtiHeapwalkObject& referree) {
> 2471:   if (is_basic_heap_walk()) {
> 2472:     return 
> invoke_basic_object_reference_callback(JVMTI_REFERENCE_OTHER, referrer, 
> referree, -1);

Just to double check, is_basic_heap_walk is true for the legacy/deprecated 
"Heap 1.0" functions, is that right? In that case, this looks like it will 
invoke the callback specified to IterateOverObjectsReachableFromObject with a 
value that is not defined by jvmtiObjectReferenceKind (the newer API uses the 
enum jvmtiHeapReferenceKind, the deprecated API uses the older enum 
jvmtiObjectReferenceKind).

>From a stewardship perspective, I think it defendable to "degrade 
>"IterateOverObjectsReachableFromObject and not synthesize refs from a class 
>loader to the classes that it has defined. FollowReferencewas the replacement 
>for this function JDK 6. The so-called "Heap 1.0" functions have been 
>deprecated since JDK 17 ([CSR](https://bugs.openjdk.org/browse/JDK-8268242)).

src/hotspot/share/prims/jvmtiTagMap.cpp line 3137:

> 3135:       // Pretend the classes are referred indirectly by the class 
> loader. They are
> 3136:       // root objects, so make them other references.
> 3137:       if (!CallbackInvoker::report_other_reference(o, m)) {

The comment "They are root objects", do you mean they will be reported as roots 
(no referrer) too?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32519#discussion_r3977393166
PR Review Comment: https://git.openjdk.org/jdk/pull/32519#discussion_r3977407114

Reply via email to