File: jvmti-getLoadedClasses-java8.patch

package info (click to toggle)
openjdk-8-jre-dcevm 8u112-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 65,404 kB
  • ctags: 184,424
  • sloc: cpp: 570,249; java: 257,943; xml: 16,359; ansic: 9,543; asm: 2,774; sh: 2,403; makefile: 2,391
file content (19 lines) | stat: -rw-r--r-- 958 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
diff --git a/src/share/vm/prims/jvmtiGetLoadedClasses.cpp b/src/share/vm/prims/jvmtiGetLoadedClasses.cpp
index 70aede5..381868b 100644
--- a/src/share/vm/prims/jvmtiGetLoadedClasses.cpp
+++ b/src/share/vm/prims/jvmtiGetLoadedClasses.cpp
@@ -42,7 +42,13 @@
 
   void do_klass(Klass* k) {
     // Collect all jclasses
-    _classStack.push((jclass) _env->jni_reference(k->java_mirror()));
+    // DCEVM : LoadedClassesClosure in dcevm7 iterates over classes from SystemDictionary therefore the class "k" is always
+    //         the new version (SystemDictionary stores only new versions). But the LoadedClassesClosure's functionality was
+    //         changed in java8  where jvmtiLoadedClasses collects all classes from all classloaders, therefore we
+    //         must use new versions only.
+    if (k->new_version()==NULL) {
+      _classStack.push((jclass) _env->jni_reference(k->java_mirror()));
+    }
   }
 
   int extract(jclass* result_list) {