2487 // Construct JavaVMInitArgs structure and parse as if it was part of the command line |
2487 // Construct JavaVMInitArgs structure and parse as if it was part of the command line |
2488 JavaVMInitArgs vm_args; |
2488 JavaVMInitArgs vm_args; |
2489 vm_args.version = JNI_VERSION_1_2; |
2489 vm_args.version = JNI_VERSION_1_2; |
2490 vm_args.options = options; |
2490 vm_args.options = options; |
2491 vm_args.nOptions = i; |
2491 vm_args.nOptions = i; |
2492 vm_args.ignoreUnrecognized = false; |
2492 vm_args.ignoreUnrecognized = IgnoreUnrecognizedVMOptions; |
2493 |
2493 |
2494 if (PrintVMOptions) { |
2494 if (PrintVMOptions) { |
2495 const char* tail; |
2495 const char* tail; |
2496 for (int i = 0; i < vm_args.nOptions; i++) { |
2496 for (int i = 0; i < vm_args.nOptions; i++) { |
2497 const JavaVMOption *option = vm_args.options + i; |
2497 const JavaVMOption *option = vm_args.options + i; |
2534 // Remaining part of option string |
2534 // Remaining part of option string |
2535 const char* tail; |
2535 const char* tail; |
2536 |
2536 |
2537 // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed. |
2537 // If flag "-XX:Flags=flags-file" is used it will be the first option to be processed. |
2538 bool settings_file_specified = false; |
2538 bool settings_file_specified = false; |
|
2539 const char* flags_file; |
2539 int index; |
2540 int index; |
2540 for (index = 0; index < args->nOptions; index++) { |
2541 for (index = 0; index < args->nOptions; index++) { |
2541 const JavaVMOption *option = args->options + index; |
2542 const JavaVMOption *option = args->options + index; |
2542 if (match_option(option, "-XX:Flags=", &tail)) { |
2543 if (match_option(option, "-XX:Flags=", &tail)) { |
2543 if (!process_settings_file(tail, true, args->ignoreUnrecognized)) { |
2544 flags_file = tail; |
2544 return JNI_EINVAL; |
|
2545 } |
|
2546 settings_file_specified = true; |
2545 settings_file_specified = true; |
2547 } |
2546 } |
2548 if (match_option(option, "-XX:+PrintVMOptions", &tail)) { |
2547 if (match_option(option, "-XX:+PrintVMOptions", &tail)) { |
2549 PrintVMOptions = true; |
2548 PrintVMOptions = true; |
2550 } |
2549 } |
2551 if (match_option(option, "-XX:-PrintVMOptions", &tail)) { |
2550 if (match_option(option, "-XX:-PrintVMOptions", &tail)) { |
2552 PrintVMOptions = false; |
2551 PrintVMOptions = false; |
|
2552 } |
|
2553 if (match_option(option, "-XX:+IgnoreUnrecognizedVMOptions", &tail)) { |
|
2554 IgnoreUnrecognizedVMOptions = true; |
|
2555 } |
|
2556 if (match_option(option, "-XX:-IgnoreUnrecognizedVMOptions", &tail)) { |
|
2557 IgnoreUnrecognizedVMOptions = false; |
|
2558 } |
|
2559 } |
|
2560 |
|
2561 if (IgnoreUnrecognizedVMOptions) { |
|
2562 // uncast const to modify the flag args->ignoreUnrecognized |
|
2563 *(jboolean*)(&args->ignoreUnrecognized) = true; |
|
2564 } |
|
2565 |
|
2566 // Parse specified settings file |
|
2567 if (settings_file_specified) { |
|
2568 if (!process_settings_file(flags_file, true, args->ignoreUnrecognized)) { |
|
2569 return JNI_EINVAL; |
2553 } |
2570 } |
2554 } |
2571 } |
2555 |
2572 |
2556 // Parse default .hotspotrc settings file |
2573 // Parse default .hotspotrc settings file |
2557 if (!settings_file_specified) { |
2574 if (!settings_file_specified) { |