comparison src/share/vm/runtime/arguments.cpp @ 23760:655fd63024d0

move jvmci flag handling to JVMCIGlobals
author David Leopoldseder <david.d.leopoldseder@oracle.com>
date Fri, 23 Sep 2016 16:33:12 +0200
parents f6de9aff9991
children f13e777eb255
comparison
equal deleted inserted replaced
23759:561a3f3a9b99 23760:655fd63024d0
1581 select_gc_ergonomically(); 1581 select_gc_ergonomically();
1582 } 1582 }
1583 } 1583 }
1584 1584
1585 1585
1586 #if INCLUDE_JVMCI
1587 void Arguments::set_jvmci_specific_flags() {
1588 if (UseJVMCICompiler) {
1589 if (FLAG_IS_DEFAULT(TypeProfileWidth)) {
1590 FLAG_SET_DEFAULT(TypeProfileWidth, 8);
1591 }
1592 if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) {
1593 FLAG_SET_DEFAULT(OnStackReplacePercentage, 933);
1594 }
1595 if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) {
1596 FLAG_SET_DEFAULT(ReservedCodeCacheSize, 64*M);
1597 }
1598 if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) {
1599 FLAG_SET_DEFAULT(InitialCodeCacheSize, 16*M);
1600 }
1601 if (FLAG_IS_DEFAULT(MetaspaceSize)) {
1602 FLAG_SET_DEFAULT(MetaspaceSize, 12*M);
1603 }
1604 if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) {
1605 FLAG_SET_DEFAULT(NewSizeThreadIncrease, 4*K);
1606 }
1607 }
1608 }
1609 #endif
1610 1586
1611 void Arguments::set_ergonomics_flags() { 1587 void Arguments::set_ergonomics_flags() {
1612 select_gc(); 1588 select_gc();
1613 1589
1614 #if defined(COMPILER2) || INCLUDE_JVMCI 1590 #if defined(COMPILER2) || INCLUDE_JVMCI
2461 #if INCLUDE_NMT 2437 #if INCLUDE_NMT
2462 } 2438 }
2463 #endif 2439 #endif
2464 } 2440 }
2465 #if INCLUDE_JVMCI 2441 #if INCLUDE_JVMCI
2466 if (!EnableJVMCI) { 2442 status = status && JVMCIGlobals::check_jvmci_flags_are_consistent();
2467 #define JVMCI_CHECK3(type, name, doc) JVMCI_CHECK_FLAG(name)
2468 #define JVMCI_CHECK4(type, name, value, doc) JVMCI_CHECK_FLAG(name)
2469 #define JVMCI_CHECK_FLAG(FLAG) \
2470 if (strcmp(#FLAG, "EnableJVMCI") && !FLAG_IS_DEFAULT(FLAG)) { \
2471 jio_fprintf(defaultStream::error_stream(), "EnableJVMCI must be enabled to use VM option '%s'\n", #FLAG); \
2472 status = false; \
2473 }
2474 JVMCI_FLAGS(JVMCI_CHECK4, JVMCI_CHECK3, JVMCI_CHECK4, JVMCI_CHECK3, JVMCI_CHECK4)
2475 #undef JVMCI_CHECK3
2476 #undef JVMCI_CHECK4
2477 #undef JVMCI_CHECK_FLAG
2478 } else {
2479 #ifndef TIERED
2480 // JVMCI is only usable as a jit compiler if the VM supports tiered compilation.
2481 #define JVMCI_CHECK_FLAG(FLAG) \
2482 if (!FLAG_IS_DEFAULT(FLAG)) { \
2483 jio_fprintf(defaultStream::error_stream(), "VM option '%s' cannot be set in non-tiered VM\n", #FLAG); \
2484 status = false; \
2485 }
2486 JVMCI_CHECK_FLAG(UseJVMCICompiler)
2487 JVMCI_CHECK_FLAG(BootstrapJVMCI)
2488 JVMCI_CHECK_FLAG(PrintBootstrap)
2489 JVMCI_CHECK_FLAG(JVMCIThreads)
2490 JVMCI_CHECK_FLAG(JVMCIHostThreads)
2491 JVMCI_CHECK_FLAG(JVMCICountersExcludeCompiler)
2492 #undef JVMCI_CHECK_FLAG
2493 #endif
2494 if (BootstrapJVMCI && !UseJVMCICompiler) {
2495 warning("BootstrapJVMCI has no effect if UseJVMCICompiler is disabled");
2496 }
2497 if (!ScavengeRootsInCode) {
2498 warning("forcing ScavengeRootsInCode non-zero because JVMCI is enabled");
2499 ScavengeRootsInCode = 1;
2500 }
2501 }
2502 #endif 2443 #endif
2503 2444
2504 // Need to limit the extent of the padding to reasonable size. 2445 // Need to limit the extent of the padding to reasonable size.
2505 // 8K is well beyond the reasonable HW cache line size, even with the 2446 // 8K is well beyond the reasonable HW cache line size, even with the
2506 // aggressive prefetching, while still leaving the room for segregating 2447 // aggressive prefetching, while still leaving the room for segregating
2561 int min_number_of_compiler_threads = get_min_number_of_compiler_threads(); 2502 int min_number_of_compiler_threads = get_min_number_of_compiler_threads();
2562 // The default CICompilerCount's value is CI_COMPILER_COUNT. 2503 // The default CICompilerCount's value is CI_COMPILER_COUNT.
2563 assert(min_number_of_compiler_threads <= CI_COMPILER_COUNT, "minimum should be less or equal default number"); 2504 assert(min_number_of_compiler_threads <= CI_COMPILER_COUNT, "minimum should be less or equal default number");
2564 // Check the minimum number of compiler threads 2505 // Check the minimum number of compiler threads
2565 status &=verify_min_value(CICompilerCount, min_number_of_compiler_threads, "CICompilerCount"); 2506 status &=verify_min_value(CICompilerCount, min_number_of_compiler_threads, "CICompilerCount");
2566
2567 #if INCLUDE_JVMCI
2568 if (UseJVMCICompiler) {
2569 // Check the minimum number of JVMCI compiler threads
2570 status &=verify_min_value(JVMCIThreads, 1, "JVMCIThreads");
2571 }
2572 #endif
2573
2574 return status; 2507 return status;
2575 } 2508 }
2576 2509
2577 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore, 2510 bool Arguments::is_bad_option(const JavaVMOption* option, jboolean ignore,
2578 const char* option_type) { 2511 const char* option_type) {
4121 // Set flags based on ergonomics. 4054 // Set flags based on ergonomics.
4122 set_ergonomics_flags(); 4055 set_ergonomics_flags();
4123 4056
4124 #if INCLUDE_JVMCI 4057 #if INCLUDE_JVMCI
4125 // Set flags specific to JVMCI. This is done prior to computing NMethodSweepFraction. 4058 // Set flags specific to JVMCI. This is done prior to computing NMethodSweepFraction.
4126 set_jvmci_specific_flags(); 4059 JVMCIGlobals::set_jvmci_specific_flags();
4127 #endif 4060 #endif
4128 4061
4129 set_shared_spaces_flags(); 4062 set_shared_spaces_flags();
4130 4063
4131 // Check the GC selections again. 4064 // Check the GC selections again.