Index: vm/vmcore/include/init.h =================================================================== --- vm/vmcore/include/init.h (revision 552465) +++ vm/vmcore/include/init.h (working copy) @@ -35,6 +35,6 @@ void* get_portlib_for_logger(Global_Env *p_env); void parse_jit_arguments(JavaVMInitArgs* vm_arguments); void print_generic_help(); -void initialize_properties(Global_Env *p_env); +jint initialize_properties(Global_Env *p_env); #endif //_INIT_H Index: vm/vmcore/src/init/vm_properties.cpp =================================================================== --- vm/vmcore/src/init/vm_properties.cpp (revision 552465) +++ vm/vmcore/src/init/vm_properties.cpp (working copy) @@ -272,7 +272,7 @@ properties.set_new("vm.jvmti.enabled", "false"); properties.set_new("vm.jvmti.compiled_method_load.inlined", "false"); properties.set_new("vm.bootclasspath.appendclasspath", "false"); - properties.set_new("vm.dlls", PORT_DSO_NAME(GC_DLL)); + properties.set_new("gc.dll", PORT_DSO_NAME(GC_DLL)); properties.set_new("thread.soft_unreservation", "false"); int n_api_dll_files = sizeof(api_dll_files) / sizeof(char *); @@ -284,9 +284,10 @@ properties.set_new("vm.other_natives_dlls", path_buf); } -void -initialize_properties(Global_Env * p_env) +jint initialize_properties(Global_Env * p_env) { + jint status = JNI_OK; + if (!prop_pool) { apr_pool_create(&prop_pool, 0); } @@ -359,6 +360,8 @@ ++name; } else { value = ""; + LECHO(28, "Wrong option format {0}" << option); + status = JNI_ERR; } } @@ -366,14 +369,19 @@ p_env->VmProperties()->set(name, value); STD_FREE(src); + + if (status != JNI_OK) break; } } /* * 2. Set predefined values to properties not defined via vm options. */ - init_java_properties(*p_env->JavaProperties()); - init_vm_properties(*p_env->VmProperties()); - + if (status == JNI_OK) + { + init_java_properties(*p_env->JavaProperties()); + init_vm_properties(*p_env->VmProperties()); + } apr_pool_clear(prop_pool); + return status; } Index: vm/vmcore/src/init/vm_init.cpp =================================================================== --- vm/vmcore/src/init/vm_init.cpp (revision 552465) +++ vm/vmcore/src/init/vm_init.cpp (working copy) @@ -144,35 +144,30 @@ return status; } - const char delimiters[] = {PORT_PATH_SEPARATOR, 0}; - - char* dlls = vm_env->VmProperties()->get("vm.dlls"); - if (!dlls) return JNI_OK; - - char* tok = strtok((char *)dlls, delimiters); - while (tok) { - TRACE("analyzing dll " << tok); + /* + * Preload .dll which is specified by 'gc.dll' property. + * + * According to current design (r552465) 'gc.dll' property + * is always set: in configuration file (by default), or it can + * be reset from command line... + */ #ifndef USE_GC_STATIC - if (vm_is_a_gc_dll(tok)) { - vm_add_gc(tok); - goto next_dll; - } -#endif + char* gc_dll = vm_env->VmProperties()->get("gc.dll"); -#ifdef USE_DISEM - if (vm_is_a_disem_dll(tok)) { - vm_add_disem(tok); - goto next_dll; - } -#endif - LWARN(16, "Mandatory library cannot be loaded: {0}" << tok); - status = JNI_ERR; - break; -next_dll: - tok = strtok(NULL, delimiters); + if (!gc_dll) { + LWARN(44, "{0} internal property is undefined" << "gc.dll"); + return JNI_ERR; } + TRACE("analyzing gc.dll " << gc_dll); - vm_env->VmProperties()->destroy(dlls); + if (vm_is_a_gc_dll(gc_dll)) { + vm_add_gc(gc_dll); + } else { + LWARN(16, "GC library cannot be loaded: {0}" << gc_dll); + status = JNI_ERR; + } + vm_env->VmProperties()->destroy(gc_dll); +#endif return status; } @@ -667,7 +662,8 @@ // 20030407 Note: property initialization must follow initialization of the default JITs to allow // the command line to override those default JITs. - initialize_properties(vm_env); + status = initialize_properties(vm_env); + if (status != JNI_OK) return status; tm_properties = (struct tm_props*) STD_MALLOC(sizeof(struct tm_props)); Index: vm/vmcore/src/init/harmony.properties =================================================================== --- vm/vmcore/src/init/harmony.properties (revision 552465) +++ vm/vmcore/src/init/harmony.properties (working copy) @@ -41,6 +41,9 @@ ECHO023=\ -Xlog[:[:]\n Switch debug logging on [for specified category only\n [and log that category to a file]]\n -Xtrace[:[:]\n Switch trace logging on [for specified category only\n [and log that category to a file]] ECHO024=\ -Xstats:\n Generates different statistics ECHO025=\ -Xint\n Use interpreter to execute the program\n -Xgc:\n Specify gc specific options\n -Xem:\n Specify em specific options\n -Xdumpstubs\n Writes stubs generated by LIL to disk\n -Xparallel_jit\n Launch compilation in parallel (default)\n -Xno_parallel_jit\n Do not launch compilation in parallel\n -Xdumpfile:\n Specifies a file name for the dump\n -XX:=\n set an internal system property\n Boolean options may be turned on with -XX:+