hotspot/src/share/vm/runtime/arguments.cpp
changeset 40013 943cf01a6b82
parent 39621 b475d96f8008
child 40015 524230a0f4ca
equal deleted inserted replaced
40012:f69cfe79fe98 40013:943cf01a6b82
    83 bool   Arguments::_xdebug_mode                  = false;
    83 bool   Arguments::_xdebug_mode                  = false;
    84 const char*  Arguments::_java_vendor_url_bug    = DEFAULT_VENDOR_URL_BUG;
    84 const char*  Arguments::_java_vendor_url_bug    = DEFAULT_VENDOR_URL_BUG;
    85 const char*  Arguments::_sun_java_launcher      = DEFAULT_JAVA_LAUNCHER;
    85 const char*  Arguments::_sun_java_launcher      = DEFAULT_JAVA_LAUNCHER;
    86 int    Arguments::_sun_java_launcher_pid        = -1;
    86 int    Arguments::_sun_java_launcher_pid        = -1;
    87 bool   Arguments::_sun_java_launcher_is_altjvm  = false;
    87 bool   Arguments::_sun_java_launcher_is_altjvm  = false;
    88 int    Arguments::_bootclassloader_append_index = -1;
       
    89 
    88 
    90 // These parameters are reset in method parse_vm_init_args()
    89 // These parameters are reset in method parse_vm_init_args()
    91 bool   Arguments::_AlwaysCompileLoopMethods     = AlwaysCompileLoopMethods;
    90 bool   Arguments::_AlwaysCompileLoopMethods     = AlwaysCompileLoopMethods;
    92 bool   Arguments::_UseOnStackReplacement        = UseOnStackReplacement;
    91 bool   Arguments::_UseOnStackReplacement        = UseOnStackReplacement;
    93 bool   Arguments::_BackgroundCompilation        = BackgroundCompilation;
    92 bool   Arguments::_BackgroundCompilation        = BackgroundCompilation;
   111 SystemProperty *Arguments::_java_class_path = NULL;
   110 SystemProperty *Arguments::_java_class_path = NULL;
   112 SystemProperty *Arguments::_jdk_boot_class_path_append = NULL;
   111 SystemProperty *Arguments::_jdk_boot_class_path_append = NULL;
   113 
   112 
   114 GrowableArray<ModuleXPatchPath*> *Arguments::_xpatchprefix = NULL;
   113 GrowableArray<ModuleXPatchPath*> *Arguments::_xpatchprefix = NULL;
   115 PathString *Arguments::_system_boot_class_path = NULL;
   114 PathString *Arguments::_system_boot_class_path = NULL;
       
   115 bool Arguments::_has_jimage = false;
   116 
   116 
   117 char* Arguments::_ext_dirs = NULL;
   117 char* Arguments::_ext_dirs = NULL;
   118 
   118 
   119 // Check if head of 'option' matches 'name', and sets 'tail' to the remaining
   119 // Check if head of 'option' matches 'name', and sets 'tail' to the remaining
   120 // part of the option string.
   120 // part of the option string.
  1303             "Cannot use the following option when dumping the shared archive", unsupported_options[i]);
  1303             "Cannot use the following option when dumping the shared archive", unsupported_options[i]);
  1304       }
  1304       }
  1305     }
  1305     }
  1306     sp = sp->next();
  1306     sp = sp->next();
  1307   }
  1307   }
       
  1308 
       
  1309   // Check for an exploded module build in use with -Xshare:dump.
       
  1310   if (!has_jimage()) {
       
  1311     vm_exit_during_initialization("Dumping the shared archive is not supported with an exploded module build");
       
  1312   }
  1308 }
  1313 }
  1309 #endif
  1314 #endif
  1310 
  1315 
  1311 //===========================================================================================================
  1316 //===========================================================================================================
  1312 // Setting int/mixed/comp mode flags
  1317 // Setting int/mixed/comp mode flags
  2674         jio_fprintf(defaultStream::output_stream(),
  2679         jio_fprintf(defaultStream::output_stream(),
  2675           "-Xbootclasspath is no longer a supported option.\n");
  2680           "-Xbootclasspath is no longer a supported option.\n");
  2676         return JNI_EINVAL;
  2681         return JNI_EINVAL;
  2677     // -bootclasspath/a:
  2682     // -bootclasspath/a:
  2678     } else if (match_option(option, "-Xbootclasspath/a:", &tail)) {
  2683     } else if (match_option(option, "-Xbootclasspath/a:", &tail)) {
  2679       Arguments::set_bootclassloader_append_index((int)strlen(Arguments::get_sysclasspath())+1);
       
  2680       Arguments::append_sysclasspath(tail);
  2684       Arguments::append_sysclasspath(tail);
  2681     // -bootclasspath/p:
  2685     // -bootclasspath/p:
  2682     } else if (match_option(option, "-Xbootclasspath/p:", &tail)) {
  2686     } else if (match_option(option, "-Xbootclasspath/p:", &tail)) {
  2683         jio_fprintf(defaultStream::output_stream(),
  2687         jio_fprintf(defaultStream::output_stream(),
  2684           "-Xbootclasspath/p is no longer a supported option.\n");
  2688           "-Xbootclasspath/p is no longer a supported option.\n");
  3321   }
  3325   }
  3322 
  3326 
  3323   _xpatchprefix->push(new ModuleXPatchPath(module_name, path));
  3327   _xpatchprefix->push(new ModuleXPatchPath(module_name, path));
  3324 }
  3328 }
  3325 
  3329 
  3326 // Set property jdk.boot.class.path.append to the contents of the bootclasspath
       
  3327 // that follows either the jimage file or exploded module directories.  The
       
  3328 // property will contain -Xbootclasspath/a and/or jvmti appended additions.
       
  3329 void Arguments::set_jdkbootclasspath_append() {
       
  3330   char *sysclasspath = get_sysclasspath();
       
  3331   assert(sysclasspath != NULL, "NULL sysclasspath");
       
  3332   int bcp_a_idx = bootclassloader_append_index();
       
  3333   if (bcp_a_idx != -1 && bcp_a_idx < (int)strlen(sysclasspath)) {
       
  3334     _jdk_boot_class_path_append->set_value(sysclasspath + bcp_a_idx);
       
  3335   }
       
  3336 }
       
  3337 
       
  3338 // Remove all empty paths from the app classpath (if IgnoreEmptyClassPaths is enabled)
  3330 // Remove all empty paths from the app classpath (if IgnoreEmptyClassPaths is enabled)
  3339 //
  3331 //
  3340 // This is necessary because some apps like to specify classpath like -cp foo.jar:${XYZ}:bar.jar
  3332 // This is necessary because some apps like to specify classpath like -cp foo.jar:${XYZ}:bar.jar
  3341 // in their start-up scripts. If XYZ is empty, the classpath will look like "-cp foo.jar::bar.jar".
  3333 // in their start-up scripts. If XYZ is empty, the classpath will look like "-cp foo.jar::bar.jar".
  3342 // Java treats such empty paths as if the user specified "-cp foo.jar:.:bar.jar". I.e., an empty
  3334 // Java treats such empty paths as if the user specified "-cp foo.jar:.:bar.jar". I.e., an empty
  3454       "<JAVA_HOME>/lib/ext exists, extensions mechanism no longer supported; "
  3446       "<JAVA_HOME>/lib/ext exists, extensions mechanism no longer supported; "
  3455       "Use -classpath instead.\n.");
  3447       "Use -classpath instead.\n.");
  3456     os::closedir(dir);
  3448     os::closedir(dir);
  3457     return JNI_ERR;
  3449     return JNI_ERR;
  3458   }
  3450   }
  3459 
       
  3460   Arguments::set_bootclassloader_append_index(((int)strlen(Arguments::get_sysclasspath()))+1);
       
  3461 
  3451 
  3462   // This must be done after all arguments have been processed.
  3452   // This must be done after all arguments have been processed.
  3463   // java_compiler() true means set to "NONE" or empty.
  3453   // java_compiler() true means set to "NONE" or empty.
  3464   if (java_compiler() && !xdebug_mode()) {
  3454   if (java_compiler() && !xdebug_mode()) {
  3465     // For backwards compatibility, we switch to interpreted mode if
  3455     // For backwards compatibility, we switch to interpreted mode if