Mercurial > hg > truffle
comparison src/share/vm/runtime/arguments.cpp @ 8744:15401203db6b
Merge
author | stefank |
---|---|
date | Fri, 15 Mar 2013 08:57:55 +0100 |
parents | eac371996b44 69ffa4ac9e53 |
children | 0631ebcc45f0 |
comparison
equal
deleted
inserted
replaced
8743:82657b6a8cc0 | 8744:15401203db6b |
---|---|
2289 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. | 2289 size_t len2 = strlen(pos+1) + 1; // options start after ':'. Final zero must be copied. |
2290 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); | 2290 options = (char*)memcpy(NEW_C_HEAP_ARRAY(char, len2, mtInternal), pos+1, len2); |
2291 } | 2291 } |
2292 #if !INCLUDE_JVMTI | 2292 #if !INCLUDE_JVMTI |
2293 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { | 2293 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { |
2294 warning("profiling and debugging agents are not supported in this VM"); | 2294 jio_fprintf(defaultStream::error_stream(), |
2295 } else | 2295 "Profiling and debugging agents are not supported in this VM\n"); |
2296 return JNI_ERR; | |
2297 } | |
2296 #endif // !INCLUDE_JVMTI | 2298 #endif // !INCLUDE_JVMTI |
2297 add_init_library(name, options); | 2299 add_init_library(name, options); |
2298 } | 2300 } |
2299 // -agentlib and -agentpath | 2301 // -agentlib and -agentpath |
2300 } else if (match_option(option, "-agentlib:", &tail) || | 2302 } else if (match_option(option, "-agentlib:", &tail) || |
2301 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { | 2303 (is_absolute_path = match_option(option, "-agentpath:", &tail))) { |
2302 if(tail != NULL) { | 2304 if(tail != NULL) { |
2309 if(pos != NULL) { | 2311 if(pos != NULL) { |
2310 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); | 2312 options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(pos + 1) + 1, mtInternal), pos + 1); |
2311 } | 2313 } |
2312 #if !INCLUDE_JVMTI | 2314 #if !INCLUDE_JVMTI |
2313 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { | 2315 if ((strcmp(name, "hprof") == 0) || (strcmp(name, "jdwp") == 0)) { |
2314 warning("profiling and debugging agents are not supported in this VM"); | 2316 jio_fprintf(defaultStream::error_stream(), |
2315 } else | 2317 "Profiling and debugging agents are not supported in this VM\n"); |
2318 return JNI_ERR; | |
2319 } | |
2316 #endif // !INCLUDE_JVMTI | 2320 #endif // !INCLUDE_JVMTI |
2317 add_init_agent(name, options, is_absolute_path); | 2321 add_init_agent(name, options, is_absolute_path); |
2318 | |
2319 } | 2322 } |
2320 // -javaagent | 2323 // -javaagent |
2321 } else if (match_option(option, "-javaagent:", &tail)) { | 2324 } else if (match_option(option, "-javaagent:", &tail)) { |
2322 #if !INCLUDE_JVMTI | 2325 #if !INCLUDE_JVMTI |
2323 warning("Instrumentation agents are not supported in this VM"); | 2326 jio_fprintf(defaultStream::error_stream(), |
2327 "Instrumentation agents are not supported in this VM\n"); | |
2328 return JNI_ERR; | |
2324 #else | 2329 #else |
2325 if(tail != NULL) { | 2330 if(tail != NULL) { |
2326 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); | 2331 char *options = strcpy(NEW_C_HEAP_ARRAY(char, strlen(tail) + 1, mtInternal), tail); |
2327 add_init_agent("instrument", options, false); | 2332 add_init_agent("instrument", options, false); |
2328 } | 2333 } |
2459 // -Xprof | 2464 // -Xprof |
2460 } else if (match_option(option, "-Xprof", &tail)) { | 2465 } else if (match_option(option, "-Xprof", &tail)) { |
2461 #if INCLUDE_FPROF | 2466 #if INCLUDE_FPROF |
2462 _has_profile = true; | 2467 _has_profile = true; |
2463 #else // INCLUDE_FPROF | 2468 #else // INCLUDE_FPROF |
2464 // do we have to exit? | 2469 jio_fprintf(defaultStream::error_stream(), |
2465 warning("Flat profiling is not supported in this VM."); | 2470 "Flat profiling is not supported in this VM.\n"); |
2471 return JNI_ERR; | |
2466 #endif // INCLUDE_FPROF | 2472 #endif // INCLUDE_FPROF |
2467 // -Xaprof | 2473 // -Xaprof |
2468 } else if (match_option(option, "-Xaprof", &tail)) { | 2474 } else if (match_option(option, "-Xaprof", &tail)) { |
2469 _has_alloc_profile = true; | 2475 _has_alloc_profile = true; |
2470 // -Xconcurrentio | 2476 // -Xconcurrentio |
2494 // Out of the box management support | 2500 // Out of the box management support |
2495 if (match_option(option, "-Dcom.sun.management", &tail)) { | 2501 if (match_option(option, "-Dcom.sun.management", &tail)) { |
2496 #if INCLUDE_MANAGEMENT | 2502 #if INCLUDE_MANAGEMENT |
2497 FLAG_SET_CMDLINE(bool, ManagementServer, true); | 2503 FLAG_SET_CMDLINE(bool, ManagementServer, true); |
2498 #else | 2504 #else |
2499 vm_exit_during_initialization( | 2505 jio_fprintf(defaultStream::output_stream(), |
2500 "-Dcom.sun.management is not supported in this VM.", NULL); | 2506 "-Dcom.sun.management is not supported in this VM.\n"); |
2507 return JNI_ERR; | |
2501 #endif | 2508 #endif |
2502 } | 2509 } |
2503 // -Xint | 2510 // -Xint |
2504 } else if (match_option(option, "-Xint", &tail)) { | 2511 } else if (match_option(option, "-Xint", &tail)) { |
2505 set_mode_flags(_int); | 2512 set_mode_flags(_int); |
2508 set_mode_flags(_mixed); | 2515 set_mode_flags(_mixed); |
2509 // -Xcomp | 2516 // -Xcomp |
2510 } else if (match_option(option, "-Xcomp", &tail)) { | 2517 } else if (match_option(option, "-Xcomp", &tail)) { |
2511 // for testing the compiler; turn off all flags that inhibit compilation | 2518 // for testing the compiler; turn off all flags that inhibit compilation |
2512 set_mode_flags(_comp); | 2519 set_mode_flags(_comp); |
2513 | |
2514 // -Xshare:dump | 2520 // -Xshare:dump |
2515 } else if (match_option(option, "-Xshare:dump", &tail)) { | 2521 } else if (match_option(option, "-Xshare:dump", &tail)) { |
2516 #if !INCLUDE_CDS | |
2517 vm_exit_during_initialization( | |
2518 "Dumping a shared archive is not supported in this VM.", NULL); | |
2519 #else | |
2520 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); | 2522 FLAG_SET_CMDLINE(bool, DumpSharedSpaces, true); |
2521 set_mode_flags(_int); // Prevent compilation, which creates objects | 2523 set_mode_flags(_int); // Prevent compilation, which creates objects |
2522 #endif | |
2523 // -Xshare:on | 2524 // -Xshare:on |
2524 } else if (match_option(option, "-Xshare:on", &tail)) { | 2525 } else if (match_option(option, "-Xshare:on", &tail)) { |
2525 FLAG_SET_CMDLINE(bool, UseSharedSpaces, true); | 2526 FLAG_SET_CMDLINE(bool, UseSharedSpaces, true); |
2526 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true); | 2527 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, true); |
2527 // -Xshare:auto | 2528 // -Xshare:auto |
2530 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); | 2531 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); |
2531 // -Xshare:off | 2532 // -Xshare:off |
2532 } else if (match_option(option, "-Xshare:off", &tail)) { | 2533 } else if (match_option(option, "-Xshare:off", &tail)) { |
2533 FLAG_SET_CMDLINE(bool, UseSharedSpaces, false); | 2534 FLAG_SET_CMDLINE(bool, UseSharedSpaces, false); |
2534 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); | 2535 FLAG_SET_CMDLINE(bool, RequireSharedSpaces, false); |
2535 | |
2536 // -Xverify | 2536 // -Xverify |
2537 } else if (match_option(option, "-Xverify", &tail)) { | 2537 } else if (match_option(option, "-Xverify", &tail)) { |
2538 if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) { | 2538 if (strcmp(tail, ":all") == 0 || strcmp(tail, "") == 0) { |
2539 FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, true); | 2539 FLAG_SET_CMDLINE(bool, BytecodeVerificationLocal, true); |
2540 FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true); | 2540 FLAG_SET_CMDLINE(bool, BytecodeVerificationRemote, true); |
2844 // away and will cause VM initialization failures! | 2844 // away and will cause VM initialization failures! |
2845 warning("-XX:+UseVMInterruptibleIO is obsolete and will be removed in a future release."); | 2845 warning("-XX:+UseVMInterruptibleIO is obsolete and will be removed in a future release."); |
2846 FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true); | 2846 FLAG_SET_CMDLINE(bool, UseVMInterruptibleIO, true); |
2847 #if !INCLUDE_MANAGEMENT | 2847 #if !INCLUDE_MANAGEMENT |
2848 } else if (match_option(option, "-XX:+ManagementServer", &tail)) { | 2848 } else if (match_option(option, "-XX:+ManagementServer", &tail)) { |
2849 vm_exit_during_initialization( | 2849 jio_fprintf(defaultStream::error_stream(), |
2850 "ManagementServer is not supported in this VM.", NULL); | 2850 "ManagementServer is not supported in this VM.\n"); |
2851 return JNI_ERR; | |
2851 #endif // INCLUDE_MANAGEMENT | 2852 #endif // INCLUDE_MANAGEMENT |
2852 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx | 2853 } else if (match_option(option, "-XX:", &tail)) { // -XX:xxxx |
2853 // Skip -XX:Flags= since that case has already been handled | 2854 // Skip -XX:Flags= since that case has already been handled |
2854 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { | 2855 if (strncmp(tail, "Flags=", strlen("Flags=")) != 0) { |
2855 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { | 2856 if (!process_argument(tail, args->ignoreUnrecognized, origin)) { |
3151 } | 3152 } |
3152 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { | 3153 if (match_option(option, "-XX:NativeMemoryTracking", &tail)) { |
3153 #if INCLUDE_NMT | 3154 #if INCLUDE_NMT |
3154 MemTracker::init_tracking_options(tail); | 3155 MemTracker::init_tracking_options(tail); |
3155 #else | 3156 #else |
3156 warning("Native Memory Tracking is not supported in this VM"); | 3157 jio_fprintf(defaultStream::error_stream(), |
3158 "Native Memory Tracking is not supported in this VM\n"); | |
3159 return JNI_ERR; | |
3157 #endif | 3160 #endif |
3158 } | 3161 } |
3159 | 3162 |
3160 | 3163 |
3161 #ifndef PRODUCT | 3164 #ifndef PRODUCT |
3270 | 3273 |
3271 #if !INCLUDE_ALL_GCS | 3274 #if !INCLUDE_ALL_GCS |
3272 force_serial_gc(); | 3275 force_serial_gc(); |
3273 #endif // INCLUDE_ALL_GCS | 3276 #endif // INCLUDE_ALL_GCS |
3274 #if !INCLUDE_CDS | 3277 #if !INCLUDE_CDS |
3278 if (DumpSharedSpaces || RequireSharedSpaces) { | |
3279 jio_fprintf(defaultStream::error_stream(), | |
3280 "Shared spaces are not supported in this VM\n"); | |
3281 return JNI_ERR; | |
3282 } | |
3283 if ((UseSharedSpaces && FLAG_IS_CMDLINE(UseSharedSpaces)) || PrintSharedSpaces) { | |
3284 warning("Shared spaces are not supported in this VM"); | |
3285 FLAG_SET_DEFAULT(UseSharedSpaces, false); | |
3286 FLAG_SET_DEFAULT(PrintSharedSpaces, false); | |
3287 } | |
3275 no_shared_spaces(); | 3288 no_shared_spaces(); |
3276 #endif // INCLUDE_CDS | 3289 #endif // INCLUDE_CDS |
3277 | 3290 |
3278 // Set flags based on ergonomics. | 3291 // Set flags based on ergonomics. |
3279 set_ergonomics_flags(); | 3292 set_ergonomics_flags(); |