提交 9a1b2b5f 编写于 作者: K ksrini

6755847: (launcher) will trigger assertions in debug build

Summary: Adds a temporary counter measure to to prevent assertions CR: 6755845
Reviewed-by: darcy, dholmes
上级 5bbaa7ce
...@@ -188,7 +188,8 @@ void InitLauncher(jboolean javaw); ...@@ -188,7 +188,8 @@ void InitLauncher(jboolean javaw);
*/ */
typedef jclass (JNICALL FindClassFromBootLoader_t(JNIEnv *env, typedef jclass (JNICALL FindClassFromBootLoader_t(JNIEnv *env,
const char *name, const char *name,
jboolean init,
jobject loader,
jboolean throwError)); jboolean throwError));
jclass FindBootStrapClass(JNIEnv *env, const char *classname); jclass FindBootStrapClass(JNIEnv *env, const char *classname);
#endif /* _JAVA_H_ */ #endif /* _JAVA_H_ */
...@@ -1324,12 +1324,12 @@ FindBootStrapClass(JNIEnv *env, const char* classname) ...@@ -1324,12 +1324,12 @@ FindBootStrapClass(JNIEnv *env, const char* classname)
{ {
if (findBootClass == NULL) { if (findBootClass == NULL) {
findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT, findBootClass = (FindClassFromBootLoader_t *)dlsym(RTLD_DEFAULT,
"JVM_FindClassFromBootLoader"); "JVM_FindClassFromClassLoader");
if (findBootClass == NULL) { if (findBootClass == NULL) {
JLI_ReportErrorMessage(DLL_ERROR4, JLI_ReportErrorMessage(DLL_ERROR4,
"JVM_FindClassFromBootLoader"); "JVM_FindClassFromClassLoader");
return NULL; return NULL;
} }
} }
return findBootClass(env, classname, JNI_FALSE); return findBootClass(env, classname, JNI_FALSE, (jobject)NULL, JNI_FALSE);
} }
...@@ -1002,6 +1002,12 @@ void SetJavaLauncherPlatformProps() {} ...@@ -1002,6 +1002,12 @@ void SetJavaLauncherPlatformProps() {}
*/ */
static FindClassFromBootLoader_t *findBootClass = NULL; static FindClassFromBootLoader_t *findBootClass = NULL;
#ifdef _M_AMD64
#define JVM_BCLOADER "JVM_FindClassFromClassLoader"
#else
#define JVM_BCLOADER "_JVM_FindClassFromClassLoader@20"
#endif /* _M_AMD64 */
jclass FindBootStrapClass(JNIEnv *env, const char *classname) jclass FindBootStrapClass(JNIEnv *env, const char *classname)
{ {
HMODULE hJvm; HMODULE hJvm;
...@@ -1011,14 +1017,13 @@ jclass FindBootStrapClass(JNIEnv *env, const char *classname) ...@@ -1011,14 +1017,13 @@ jclass FindBootStrapClass(JNIEnv *env, const char *classname)
if (hJvm == NULL) return NULL; if (hJvm == NULL) return NULL;
/* need to use the demangled entry point */ /* need to use the demangled entry point */
findBootClass = (FindClassFromBootLoader_t *)GetProcAddress(hJvm, findBootClass = (FindClassFromBootLoader_t *)GetProcAddress(hJvm,
"JVM_FindClassFromBootLoader"); JVM_BCLOADER);
if (findBootClass == NULL) { if (findBootClass == NULL) {
JLI_ReportErrorMessage(DLL_ERROR4, JLI_ReportErrorMessage(DLL_ERROR4, JVM_BCLOADER);
"JVM_FindClassBootLoader");
return NULL; return NULL;
} }
} }
return findBootClass(env, classname, JNI_FALSE); return findBootClass(env, classname, JNI_FALSE, (jobject)NULL, JNI_FALSE);
} }
void void
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册