Wed, 08 Oct 2008 08:10:51 -0700
6755845: JVM_FindClassFromBoot triggers assertions
Summary: Fixes assertions caused by one jvm_entry calling another, solved by refactoring code and modified gamma test.
Reviewed-by: dholmes, xlu
duke@435 | 1 | /* |
duke@435 | 2 | * Copyright 1999-2005 Sun Microsystems, Inc. All Rights Reserved. |
duke@435 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
duke@435 | 4 | * |
duke@435 | 5 | * This code is free software; you can redistribute it and/or modify it |
duke@435 | 6 | * under the terms of the GNU General Public License version 2 only, as |
duke@435 | 7 | * published by the Free Software Foundation. |
duke@435 | 8 | * |
duke@435 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
duke@435 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
duke@435 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
duke@435 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
duke@435 | 13 | * accompanied this code). |
duke@435 | 14 | * |
duke@435 | 15 | * You should have received a copy of the GNU General Public License version |
duke@435 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
duke@435 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
duke@435 | 18 | * |
duke@435 | 19 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
duke@435 | 20 | * CA 95054 USA or visit www.sun.com if you need additional information or |
duke@435 | 21 | * have any questions. |
duke@435 | 22 | * |
duke@435 | 23 | */ |
duke@435 | 24 | |
duke@435 | 25 | /* |
duke@435 | 26 | * Gamma (Hotspot internal engineering test) launcher based on 1.6.0-b28 JDK, |
duke@435 | 27 | * search "GAMMA" for gamma specific changes. |
duke@435 | 28 | */ |
duke@435 | 29 | |
duke@435 | 30 | #ifndef _JAVA_H_ |
duke@435 | 31 | #define _JAVA_H_ |
duke@435 | 32 | |
duke@435 | 33 | /* |
duke@435 | 34 | * Get system specific defines. |
duke@435 | 35 | */ |
duke@435 | 36 | #include "jni.h" |
duke@435 | 37 | #include "java_md.h" |
duke@435 | 38 | |
duke@435 | 39 | /* |
duke@435 | 40 | * Pointers to the needed JNI invocation API, initialized by LoadJavaVM. |
duke@435 | 41 | */ |
duke@435 | 42 | typedef jint (JNICALL *CreateJavaVM_t)(JavaVM **pvm, void **env, void *args); |
duke@435 | 43 | typedef jint (JNICALL *GetDefaultJavaVMInitArgs_t)(void *args); |
duke@435 | 44 | |
duke@435 | 45 | typedef struct { |
duke@435 | 46 | CreateJavaVM_t CreateJavaVM; |
duke@435 | 47 | GetDefaultJavaVMInitArgs_t GetDefaultJavaVMInitArgs; |
duke@435 | 48 | } InvocationFunctions; |
duke@435 | 49 | |
duke@435 | 50 | /* |
duke@435 | 51 | * Prototypes for launcher functions in the system specific java_md.c. |
duke@435 | 52 | */ |
duke@435 | 53 | |
duke@435 | 54 | jboolean |
duke@435 | 55 | LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn); |
duke@435 | 56 | |
duke@435 | 57 | void |
duke@435 | 58 | GetXUsagePath(char *buf, jint bufsize); |
duke@435 | 59 | |
duke@435 | 60 | jboolean |
duke@435 | 61 | GetApplicationHome(char *buf, jint bufsize); |
duke@435 | 62 | |
duke@435 | 63 | const char * |
duke@435 | 64 | GetArch(); |
duke@435 | 65 | |
duke@435 | 66 | void CreateExecutionEnvironment(int *_argc, |
duke@435 | 67 | char ***_argv, |
duke@435 | 68 | char jrepath[], |
duke@435 | 69 | jint so_jrepath, |
duke@435 | 70 | char jvmpath[], |
duke@435 | 71 | jint so_jvmpath, |
duke@435 | 72 | char **original_argv); |
duke@435 | 73 | |
duke@435 | 74 | /* |
duke@435 | 75 | * Report an error message to stderr or a window as appropriate. The |
duke@435 | 76 | * flag always is set to JNI_TRUE if message is to be reported to both |
duke@435 | 77 | * strerr and windows and set to JNI_FALSE if the message should only |
duke@435 | 78 | * be sent to a window. |
duke@435 | 79 | */ |
duke@435 | 80 | void ReportErrorMessage(char * message, jboolean always); |
duke@435 | 81 | void ReportErrorMessage2(char * format, char * string, jboolean always); |
duke@435 | 82 | |
duke@435 | 83 | /* |
duke@435 | 84 | * Report an exception which terminates the vm to stderr or a window |
duke@435 | 85 | * as appropriate. |
duke@435 | 86 | */ |
duke@435 | 87 | void ReportExceptionDescription(JNIEnv * env); |
duke@435 | 88 | |
duke@435 | 89 | jboolean RemovableMachineDependentOption(char * option); |
duke@435 | 90 | void PrintMachineDependentOptions(); |
duke@435 | 91 | |
duke@435 | 92 | /* |
duke@435 | 93 | * Functions defined in java.c and used in java_md.c. |
duke@435 | 94 | */ |
duke@435 | 95 | jint ReadKnownVMs(const char *jrepath, char * arch, jboolean speculative); |
duke@435 | 96 | char *CheckJvmType(int *argc, char ***argv, jboolean speculative); |
duke@435 | 97 | void* MemAlloc(size_t size); |
duke@435 | 98 | |
duke@435 | 99 | /* |
duke@435 | 100 | * Make launcher spit debug output. |
duke@435 | 101 | */ |
duke@435 | 102 | extern jboolean _launcher_debug; |
ksrini@823 | 103 | /* |
ksrini@823 | 104 | * This allows for finding classes from the VM's bootstrap class loader |
ksrini@823 | 105 | * directly, FindClass uses the application class loader internally, this will |
ksrini@823 | 106 | * cause unnecessary searching of the classpath for the required classes. |
ksrini@823 | 107 | */ |
ksrini@823 | 108 | typedef jclass (JNICALL FindClassFromBootLoader_t(JNIEnv *env, |
ksrini@823 | 109 | const char *name, |
ksrini@823 | 110 | jboolean throwError)); |
ksrini@823 | 111 | |
ksrini@823 | 112 | jclass FindBootStrapClass(JNIEnv *env, const char *classname); |
duke@435 | 113 | |
duke@435 | 114 | #endif /* _JAVA_H_ */ |