< prev index next >

src/hotspot/share/prims/jvm.cpp

Print this page
rev 52426 : 8185496: Improve performance of system properties initialization in initPhase1
8213424: VersionProps duplicate and skipped initialization


 348                           vmSymbols::put_name(),
 349                           vmSymbols::object_object_object_signature(),
 350                           key_str,
 351                           value_str,
 352                           THREAD);
 353 }
 354 
 355 
 356 #define PUTPROP(props, name, value) set_property((props), (name), (value), CHECK_(properties));
 357 
 358 
 359 JVM_ENTRY(jobject, JVM_InitProperties(JNIEnv *env, jobject properties))
 360   JVMWrapper("JVM_InitProperties");
 361   ResourceMark rm;
 362 
 363   Handle props(THREAD, JNIHandles::resolve_non_null(properties));
 364 
 365   // System property list includes both user set via -D option and
 366   // jvm system specific properties.
 367   for (SystemProperty* p = Arguments::system_properties(); p != NULL; p = p->next()) {


 368     PUTPROP(props, p->key(), p->value());
 369   }
 370 
 371   // Convert the -XX:MaxDirectMemorySize= command line flag
 372   // to the sun.nio.MaxDirectMemorySize property.
 373   // Do this after setting user properties to prevent people
 374   // from setting the value with a -D option, as requested.
 375   {
 376     if (FLAG_IS_DEFAULT(MaxDirectMemorySize)) {
 377       PUTPROP(props, "sun.nio.MaxDirectMemorySize", "-1");
 378     } else {
 379       char as_chars[256];
 380       jio_snprintf(as_chars, sizeof(as_chars), JULONG_FORMAT, MaxDirectMemorySize);
 381       PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);
 382     }
 383   }
 384 
 385   // JVM monitoring and management support
 386   // Add the sun.management.compiler property for the compiler's name
 387   {
 388 #undef CSIZE
 389 #if defined(_LP64) || defined(_WIN64)
 390   #define CSIZE "64-Bit "
 391 #else
 392   #define CSIZE
 393 #endif // 64bit
 394 
 395 #ifdef TIERED
 396     const char* compiler_name = "HotSpot " CSIZE "Tiered Compilers";
 397 #else
 398 #if defined(COMPILER1)
 399     const char* compiler_name = "HotSpot " CSIZE "Client Compiler";
 400 #elif defined(COMPILER2)
 401     const char* compiler_name = "HotSpot " CSIZE "Server Compiler";
 402 #elif INCLUDE_JVMCI




 348                           vmSymbols::put_name(),
 349                           vmSymbols::object_object_object_signature(),
 350                           key_str,
 351                           value_str,
 352                           THREAD);
 353 }
 354 
 355 
 356 #define PUTPROP(props, name, value) set_property((props), (name), (value), CHECK_(properties));
 357 
 358 
 359 JVM_ENTRY(jobject, JVM_InitProperties(JNIEnv *env, jobject properties))
 360   JVMWrapper("JVM_InitProperties");
 361   ResourceMark rm;
 362 
 363   Handle props(THREAD, JNIHandles::resolve_non_null(properties));
 364 
 365   // System property list includes both user set via -D option and
 366   // jvm system specific properties.
 367   for (SystemProperty* p = Arguments::system_properties(); p != NULL; p = p->next()) {
 368     if (strcmp(p->key(), "sun.nio.MaxDirectMemorySize") == 0)  // Can not be defined with -D
 369       continue;
 370     PUTPROP(props, p->key(), p->value());
 371   }
 372 
 373   // Convert the -XX:MaxDirectMemorySize= command line flag
 374   // to the sun.nio.MaxDirectMemorySize property.
 375   // Do this after setting user properties to prevent people
 376   // from setting the value with a -D option, as requested.
 377   // Leave empty if not supplied
 378   if (!FLAG_IS_DEFAULT(MaxDirectMemorySize)) {


 379     char as_chars[256];
 380     jio_snprintf(as_chars, sizeof(as_chars), JULONG_FORMAT, MaxDirectMemorySize);
 381     PUTPROP(props, "sun.nio.MaxDirectMemorySize", as_chars);

 382   }
 383 
 384   // JVM monitoring and management support
 385   // Add the sun.management.compiler property for the compiler's name
 386   {
 387 #undef CSIZE
 388 #if defined(_LP64) || defined(_WIN64)
 389   #define CSIZE "64-Bit "
 390 #else
 391   #define CSIZE
 392 #endif // 64bit
 393 
 394 #ifdef TIERED
 395     const char* compiler_name = "HotSpot " CSIZE "Tiered Compilers";
 396 #else
 397 #if defined(COMPILER1)
 398     const char* compiler_name = "HotSpot " CSIZE "Client Compiler";
 399 #elif defined(COMPILER2)
 400     const char* compiler_name = "HotSpot " CSIZE "Server Compiler";
 401 #elif INCLUDE_JVMCI


< prev index next >