SUGGESTED FIX
This is a suggested fix below (except that maybe the REF_INFO_MASK needs to be defined in the
jvmtiTagMap.hpp instead of jvmtiTagMap.cpp):
diff -c xx jvmtiTagMap.cpp
*** xx Tue Jun 26 21:01:38 2007
--- jvmtiTagMap.cpp Tue Jun 26 22:13:35 2007
***************
*** 2230,2235 ****
--- 2230,2239 ----
return true;
}
+ #define REF_INFO_MASK ( (1 << JVMTI_HEAP_REFERENCE_FIELD) | (1 << JVMTI_HEAP_REFERENCE_STATIC_FIELD) \
+ | (1 << JVMTI_HEAP_REFERENCE_ARRAY_ELEMENT) | (1 << JVMTI_HEAP_REFERENCE_CONSTANT_POOL) \
+ | (1 << JVMTI_HEAP_REFERENCE_STACK_LOCAL) | (1 << JVMTI_HEAP_REFERENCE_JNI_LOCAL) )
+
// invoke the object reference callback to report a reference
inline bool CallbackInvoker::invoke_advanced_object_reference_callback(jvmtiHeapReferenceKind ref_kind,
oop referrer,
***************
*** 2271,2279 ****
// for arrays we need the length, otherwise -1
jint len = (jint)(obj->is_array() ? arrayOop(obj)->length() : -1);
// invoke the callback
int res = (*cb)(ref_kind,
! &reference_info,
wrapper.klass_tag(),
wrapper.referrer_klass_tag(),
wrapper.obj_size(),
--- 2275,2284 ----
// for arrays we need the length, otherwise -1
jint len = (jint)(obj->is_array() ? arrayOop(obj)->length() : -1);
+
// invoke the callback
int res = (*cb)(ref_kind,
! (REF_INFO_MASK & (1 << ref_kind)) ? &reference_info : NULL,
wrapper.klass_tag(),
wrapper.referrer_klass_tag(),
wrapper.obj_size(),
With the fix above the JCK test is passed:
ss45998@tomsk sh run
SunOS tomsk 5.11 snv_55 i86pc i386 i86pc
MYDIR=/home/ss45998/bugs/2007/6551457-heap3-jck
/net/tomsk.sfbay/export/home/ss45998/1.5/hs_eret7.latest/i386/jdk1.7.0/bin/javac -g -cp /home/ss45998/bugs/2007/6551457-heap3-jck/jck/classes -d /home/ss45998/bugs/2007/6551457-heap3-jck/jck/classes fref00107/fref00107.java
/net/tomsk.sfbay/export/home/ss45998/1.5/hs_eret7.latest/i386/jdk1.7.0/bin/java -agentlib:jckjvmti=fref00107 -showversion -Xfuture -classpath /home/ss45998/bugs/2007/6551457-heap3-jck/jck/classes javasoft.sqe.tests.vm.jvmti.fref001.fref00107.fref00107 -platform.jvmtiSupported true
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b12)
Java HotSpot(TM) Client VM (build 1.7.0-internal-fastdebug, mixed mode)
Checking can_tag_objects capability ... available
HeapReferenceCallback was called 8221 times
|