202 } while (JNI_FALSE)
203
204 /*
205 * Running Java code in primordial thread caused many problems. We will
206 * create a new thread to invoke JVM. See 6316197 for more information.
207 */
208 static jlong threadStackSize = 0; /* stack size of the new thread */
209 static jlong maxHeapSize = 0; /* max heap size */
210 static jlong initialHeapSize = 0; /* initial heap size */
211
212 /*
213 * A minimum initial-thread stack size suitable for most platforms.
214 * This is the minimum amount of stack needed to load the JVM such
215 * that it can reject a too small -Xss value. If this is too small
216 * JVM initialization would cause a StackOverflowError.
217 */
218 #ifndef STACK_SIZE_MINIMUM
219 #define STACK_SIZE_MINIMUM (64 * KB)
220 #endif
221
222 /*
223 * Entry point.
224 */
225 JNIEXPORT int JNICALL
226 JLI_Launch(int argc, char ** argv, /* main argc, argv */
227 int jargc, const char** jargv, /* java args */
228 int appclassc, const char** appclassv, /* app classpath */
229 const char* fullversion, /* full version defined */
230 const char* dotversion, /* UNUSED dot version defined */
231 const char* pname, /* program name */
232 const char* lname, /* launcher name */
233 jboolean javaargs, /* JAVA_ARGS */
234 jboolean cpwildcard, /* classpath wildcard*/
235 jboolean javaw, /* windows-only javaw */
236 jint ergo /* unused */
237 )
238 {
239 int mode = LM_UNKNOWN;
240 char *what = NULL;
241 char *main_class = NULL;
281
282 CreateExecutionEnvironment(&argc, &argv,
283 jrepath, sizeof(jrepath),
284 jvmpath, sizeof(jvmpath),
285 jvmcfg, sizeof(jvmcfg));
286
287 if (!IsJavaArgs()) {
288 SetJvmEnvironment(argc,argv);
289 }
290
291 ifn.CreateJavaVM = 0;
292 ifn.GetDefaultJavaVMInitArgs = 0;
293
294 if (JLI_IsTraceLauncher()) {
295 start = CounterGet();
296 }
297
298 if (!LoadJavaVM(jvmpath, &ifn)) {
299 return(6);
300 }
301
302 if (JLI_IsTraceLauncher()) {
303 end = CounterGet();
304 }
305
306 JLI_TraceLauncher("%ld micro seconds to LoadJavaVM\n",
307 (long)(jint)Counter2Micros(end-start));
308
309 ++argv;
310 --argc;
311
312 if (IsJavaArgs()) {
313 /* Preprocess wrapper arguments */
314 TranslateApplicationArgs(jargc, jargv, &argc, &argv);
315 if (!AddApplicationOptions(appclassc, appclassv)) {
316 return(1);
317 }
318 } else {
319 /* Set default CLASSPATH */
320 char* cpath = getenv("CLASSPATH");
|
202 } while (JNI_FALSE)
203
204 /*
205 * Running Java code in primordial thread caused many problems. We will
206 * create a new thread to invoke JVM. See 6316197 for more information.
207 */
208 static jlong threadStackSize = 0; /* stack size of the new thread */
209 static jlong maxHeapSize = 0; /* max heap size */
210 static jlong initialHeapSize = 0; /* initial heap size */
211
212 /*
213 * A minimum initial-thread stack size suitable for most platforms.
214 * This is the minimum amount of stack needed to load the JVM such
215 * that it can reject a too small -Xss value. If this is too small
216 * JVM initialization would cause a StackOverflowError.
217 */
218 #ifndef STACK_SIZE_MINIMUM
219 #define STACK_SIZE_MINIMUM (64 * KB)
220 #endif
221
222 #ifdef INCLUDE_TSAN
223 /*
224 * Function pointer to JVM's TSAN symbolize function.
225 */
226 __attribute__((visibility("default")))
227 TsanSymbolize_t tsan_symbolize_func = NULL;
228 #endif
229
230 /*
231 * Entry point.
232 */
233 JNIEXPORT int JNICALL
234 JLI_Launch(int argc, char ** argv, /* main argc, argv */
235 int jargc, const char** jargv, /* java args */
236 int appclassc, const char** appclassv, /* app classpath */
237 const char* fullversion, /* full version defined */
238 const char* dotversion, /* UNUSED dot version defined */
239 const char* pname, /* program name */
240 const char* lname, /* launcher name */
241 jboolean javaargs, /* JAVA_ARGS */
242 jboolean cpwildcard, /* classpath wildcard*/
243 jboolean javaw, /* windows-only javaw */
244 jint ergo /* unused */
245 )
246 {
247 int mode = LM_UNKNOWN;
248 char *what = NULL;
249 char *main_class = NULL;
289
290 CreateExecutionEnvironment(&argc, &argv,
291 jrepath, sizeof(jrepath),
292 jvmpath, sizeof(jvmpath),
293 jvmcfg, sizeof(jvmcfg));
294
295 if (!IsJavaArgs()) {
296 SetJvmEnvironment(argc,argv);
297 }
298
299 ifn.CreateJavaVM = 0;
300 ifn.GetDefaultJavaVMInitArgs = 0;
301
302 if (JLI_IsTraceLauncher()) {
303 start = CounterGet();
304 }
305
306 if (!LoadJavaVM(jvmpath, &ifn)) {
307 return(6);
308 }
309 #ifdef INCLUDE_TSAN
310 tsan_symbolize_func = ifn.TsanSymbolize;
311 #endif
312
313 if (JLI_IsTraceLauncher()) {
314 end = CounterGet();
315 }
316
317 JLI_TraceLauncher("%ld micro seconds to LoadJavaVM\n",
318 (long)(jint)Counter2Micros(end-start));
319
320 ++argv;
321 --argc;
322
323 if (IsJavaArgs()) {
324 /* Preprocess wrapper arguments */
325 TranslateApplicationArgs(jargc, jargv, &argc, &argv);
326 if (!AddApplicationOptions(appclassc, appclassv)) {
327 return(1);
328 }
329 } else {
330 /* Set default CLASSPATH */
331 char* cpath = getenv("CLASSPATH");
|