changeset 7958:815957d0203e

8004967: Default method cause VerifyError: Illegal use of nonvirtual Summary: Recognize VM generated method in old verifier Reviewed-by: acorn, coleenp Contributed-by: bharadwaj.yadavelli@oracle.com
author acorn
date Mon, 28 Jan 2013 10:55:30 -0500
parents cf8470eaf7e5
children 7885e162c30f
files make/bsd/makefiles/mapfile-vers-debug make/bsd/makefiles/mapfile-vers-product make/linux/makefiles/mapfile-vers-debug make/linux/makefiles/mapfile-vers-product make/solaris/makefiles/mapfile-vers src/share/vm/prims/jvm.cpp src/share/vm/prims/jvm.h
diffstat 7 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/make/bsd/makefiles/mapfile-vers-debug	Sun Jan 27 21:58:34 2013 -0500
+++ b/make/bsd/makefiles/mapfile-vers-debug	Mon Jan 28 10:55:30 2013 -0500
@@ -188,6 +188,7 @@
                 JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
+                JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
                 JVM_Listen;
                 JVM_LoadClass0;
--- a/make/bsd/makefiles/mapfile-vers-product	Sun Jan 27 21:58:34 2013 -0500
+++ b/make/bsd/makefiles/mapfile-vers-product	Mon Jan 28 10:55:30 2013 -0500
@@ -188,6 +188,7 @@
                 JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
+                JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
                 JVM_Listen;
                 JVM_LoadClass0;
--- a/make/linux/makefiles/mapfile-vers-debug	Sun Jan 27 21:58:34 2013 -0500
+++ b/make/linux/makefiles/mapfile-vers-debug	Mon Jan 28 10:55:30 2013 -0500
@@ -184,6 +184,7 @@
                 JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
+                JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
                 JVM_Listen;
                 JVM_LoadClass0;
--- a/make/linux/makefiles/mapfile-vers-product	Sun Jan 27 21:58:34 2013 -0500
+++ b/make/linux/makefiles/mapfile-vers-product	Mon Jan 28 10:55:30 2013 -0500
@@ -184,6 +184,7 @@
                 JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
+                JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
                 JVM_Listen;
                 JVM_LoadClass0;
--- a/make/solaris/makefiles/mapfile-vers	Sun Jan 27 21:58:34 2013 -0500
+++ b/make/solaris/makefiles/mapfile-vers	Mon Jan 28 10:55:30 2013 -0500
@@ -184,6 +184,7 @@
                 JVM_IsSilentCompiler;
                 JVM_IsSupportedJNIVersion;
                 JVM_IsThreadAlive;
+                JVM_IsVMGeneratedMethodIx;
                 JVM_LatestUserDefinedLoader;
                 JVM_Listen;
                 JVM_LoadClass0;
--- a/src/share/vm/prims/jvm.cpp	Sun Jan 27 21:58:34 2013 -0500
+++ b/src/share/vm/prims/jvm.cpp	Mon Jan 28 10:55:30 2013 -0500
@@ -2302,6 +2302,15 @@
 JVM_END
 
 
+JVM_QUICK_ENTRY(jboolean, JVM_IsVMGeneratedMethodIx(JNIEnv *env, jclass cls, int method_index))
+  JVMWrapper("JVM_IsVMGeneratedMethodIx");
+  ResourceMark rm(THREAD);
+  Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
+  k = JvmtiThreadState::class_to_verify_considering_redefinition(k, thread);
+  Method* method = InstanceKlass::cast(k)->methods()->at(method_index);
+  return method->is_overpass();
+JVM_END
+
 JVM_ENTRY(const char*, JVM_GetMethodIxNameUTF(JNIEnv *env, jclass cls, jint method_index))
   JVMWrapper("JVM_GetMethodIxIxUTF");
   Klass* k = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(cls));
--- a/src/share/vm/prims/jvm.h	Sun Jan 27 21:58:34 2013 -0500
+++ b/src/share/vm/prims/jvm.h	Mon Jan 28 10:55:30 2013 -0500
@@ -860,6 +860,13 @@
 JVM_IsConstructorIx(JNIEnv *env, jclass cb, int index);
 
 /*
+ * Is the given method generated by the VM.
+ * The method is identified by method_index.
+ */
+JNIEXPORT jboolean JNICALL
+JVM_IsVMGeneratedMethodIx(JNIEnv *env, jclass cb, int index);
+
+/*
  * Returns the name of a given method in UTF format.
  * The result remains valid until JVM_ReleaseUTF is called.
  *