On Thu, 10 Sep 2026 20:20:49 GMT, Coleen Phillimore <[email protected]> wrote:
> I don't know where to fix the spec to say that JVMTI_HEAP_REFERENCE_OTHER can
> support ad-hoc refs.
Here's a first stab on the spec updates.
--- a/src/hotspot/share/prims/jvmti.xml
+++ b/src/hotspot/share/prims/jvmti.xml
@@ -3548,7 +3548,12 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);
Callback</functionlink> to
describe the kind of reference
being reported.
-
+ <p/>
+ <b>Implementation Note:</b>
+ In the HotSpot VM implementation, a reference from a class loader to
each
+ non-hidden class defined by the class loader is reported with
reference kind
+ <datalink id="JVMTI_HEAP_REFERENCE_OTHER"/>.
+ <p/>
<constants id="jvmtiHeapReferenceKind"
label="Heap Reference Enumeration"
kind="enum"
@@ -3609,11 +3614,10 @@ err = (*jvmti)->Deallocate(jvmti, stack_info);
Heap root reference: Thread.
</constant>
<constant id="JVMTI_HEAP_REFERENCE_OTHER" num="27">
- Heap root reference: other heap root reference.
+ Other reference from an object to another object, or other heap
root reference.
</constant>
</constants>
- <p/>
Definitions for the single character type descriptors of
primitive types.
@@ -4299,7 +4303,7 @@ class C2 extends C1 implements I2 {
<description>
Agent supplied callback function.
Describes a reference from an object or the VM (the referrer) to
another object
- (the referree) or a heap root to a referree.
+ (the referree), or a heap root.
<p/>
This function should return a bit vector of the desired
<datalink id="jvmtiHeapVisitControl">visit control flags</datalink>.
@@ -4346,7 +4350,7 @@ class C2 extends C1 implements I2 {
<jlong/>
<description>
The tag of the class of the referrer object (zero if the class is
not tagged
- or the referree is a heap root). If the referrer object represents
a runtime
+ or the reference is a heap root). If the referrer object
represents a runtime
class, the <code>referrer_class_tag</code> is the tag associated
with
the <code>java.lang.Class</code>
(zero if <code>java.lang.Class</code> is not tagged).
@@ -4374,7 +4378,7 @@ class C2 extends C1 implements I2 {
Points to the tag of the referrer object, or
points to the zero if the referrer
object is not tagged.
- Null if the referrer in not an object (that is,
+ Null if the referrer is not an object (that is,
this callback is reporting a heap root).
To set the tag value to be associated with the referrer object
the agent sets the <code>jlong</code> pointed to by the parameter.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/32519#issuecomment-5634628911