]> source.dussan.org Git - dcevm.git/commitdiff
Fix problem with java8 breakpoints 114/head
authorskybber <lada.dvorak7@gmail.com>
Sat, 3 Dec 2016 11:07:09 +0000 (12:07 +0100)
committerskybber <lada.dvorak7@gmail.com>
Sat, 3 Dec 2016 11:07:09 +0000 (12:07 +0100)
Jvmti GetLoadedClasses collects classes from classloaders
in java8 while java7 collects it from SystemDictionary. Dcevm7/8
holds only new classes in Dictionary while classloader holds
all versions including old one. Therefore dcevm8 must return
only new version in jvmti getLoadedClasses.

hotspot/.hg/patches/jvmti-getLoadedClasses-java8.patch [new file with mode: 0644]
hotspot/.hg/patches/series

diff --git a/hotspot/.hg/patches/jvmti-getLoadedClasses-java8.patch b/hotspot/.hg/patches/jvmti-getLoadedClasses-java8.patch
new file mode 100644 (file)
index 0000000..cde459d
--- /dev/null
@@ -0,0 +1,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) {
index 0dd5cc487c8eee4a76be6489d0258b486fa63eaf..0d9ce3bb50e8b40df0b59ed23104ea5f6ec0303b 100644 (file)
@@ -49,6 +49,7 @@ light-jdk8u20-b22.patch  #+light-jdk8u20-b22 #+light-jdk8u31-b13
 light-jdk8u40-b25.patch #+light-jdk8u40-b25 #+light-jdk8u45-b14 #+light-jdk8u51-b16
 light-jdk8u66-b17.patch #+light-jdk8u66-b17 #+light-jdk8u74-b02
 light-jdk8u92-b14.patch #+light-jdk8u92-b14 #+light-jdk8u102-b31 #+light-jdk8u111-b14 #+light-jdk8u112-b16
+jvmti-getLoadedClasses-java8.patch #+light-jdk8u112-b16
 light-jdk8u20-deopt-cp.patch #+light-jdk8u20-b22 #+light-jdk8u31-b13 #+light-jdk8u40-b25 #+light-jdk8u45-b14 #+light-jdk8u51-b16
 light-jdk8u66-b17-deopt-cp.patch #+light-jdk8u66-b17 #+light-jdk8u74-b02 #+light-jdk8u92-b14 #+light-jdk8u102-b31 #+light-jdk8u111-b14 #+light-jdk8u112-b16
 dont-clear-f1.patch #+light-jdk8u74-b02 #+light-jdk8u92-b14 #+light-jdk8u102-b31 #+light-jdk8u111-b14 #+light-jdk8u112-b16