< prev index next >
src/share/vm/runtime/arguments.cpp
Print this page
*** 48,57 ****
--- 48,60 ----
#include "services/management.hpp"
#include "services/memTracker.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/macros.hpp"
#include "utilities/stringUtils.hpp"
+ #if INCLUDE_JVMCI
+ #include "jvmci/jvmciRuntime.hpp"
+ #endif
#if INCLUDE_ALL_GCS
#include "gc/cms/compactibleFreeListSpace.hpp"
#include "gc/g1/g1CollectedHeap.inline.hpp"
#include "gc/parallel/parallelScavengeHeap.hpp"
#endif // INCLUDE_ALL_GCS
*** 211,220 ****
--- 214,225 ----
PropertyList_add(&_system_properties, _java_class_path);
PropertyList_add(&_system_properties, _sun_boot_class_path);
// Set OS specific system properties values
os::init_system_properties_values();
+
+ JVMCI_ONLY(JVMCIRuntime::init_system_properties(&_system_properties);)
}
// Update/Initialize System properties after JDK version number is known
void Arguments::init_version_specific_system_properties() {
enum { bufsz = 16 };
*** 1372,1382 ****
}
break;
}
}
! #if defined(COMPILER2) || defined(_LP64) || !INCLUDE_CDS
// Conflict: required to use shared spaces (-Xshare:on), but
// incompatible command line options were chosen.
static void no_shared_spaces(const char* message) {
if (RequireSharedSpaces) {
--- 1377,1387 ----
}
break;
}
}
! #if defined(COMPILER2) || INCLUDE_JVMCI || defined(_LP64) || !INCLUDE_CDS
// Conflict: required to use shared spaces (-Xshare:on), but
// incompatible command line options were chosen.
static void no_shared_spaces(const char* message) {
if (RequireSharedSpaces) {
*** 1832,1842 ****
}
void Arguments::set_ergonomics_flags() {
select_gc();
! #ifdef COMPILER2
// Shared spaces work fine with other GCs but causes bytecode rewriting
// to be disabled, which hurts interpreter performance and decreases
// server performance. When -server is specified, keep the default off
// unless it is asked for. Future work: either add bytecode rewriting
// at link time, or rewrite bytecodes in non-shared methods.
--- 1837,1847 ----
}
void Arguments::set_ergonomics_flags() {
select_gc();
! #if defined(COMPILER2) || INCLUDE_JVMCI
// Shared spaces work fine with other GCs but causes bytecode rewriting
// to be disabled, which hurts interpreter performance and decreases
// server performance. When -server is specified, keep the default off
// unless it is asked for. Future work: either add bytecode rewriting
// at link time, or rewrite bytecodes in non-shared methods.
*** 1916,1926 ****
}
}
void Arguments::set_g1_gc_flags() {
assert(UseG1GC, "Error");
! #ifdef COMPILER1
FastTLABRefill = false;
#endif
FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
if (ParallelGCThreads == 0) {
assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
--- 1921,1931 ----
}
}
void Arguments::set_g1_gc_flags() {
assert(UseG1GC, "Error");
! #if defined(COMPILER1) || INCLUDE_JVMCI
FastTLABRefill = false;
#endif
FLAG_SET_DEFAULT(ParallelGCThreads, Abstract_VM_Version::parallel_worker_threads());
if (ParallelGCThreads == 0) {
assert(!FLAG_IS_DEFAULT(ParallelGCThreads), "The default value for ParallelGCThreads should not be 0.");
*** 2493,2502 ****
--- 2498,2523 ----
PrintNMTStatistics = false;
#if INCLUDE_NMT
}
#endif
}
+ #if INCLUDE_JVMCI
+ if (EnableJVMCI) {
+ if (!ScavengeRootsInCode) {
+ warning("forcing ScavengeRootsInCode non-zero because JVMCI is enabled");
+ ScavengeRootsInCode = 1;
+ }
+ if (FLAG_IS_DEFAULT(TypeProfileLevel)) {
+ TypeProfileLevel = 0;
+ }
+ if (UseJVMCICompiler) {
+ if (FLAG_IS_DEFAULT(TypeProfileWidth)) {
+ TypeProfileWidth = 8;
+ }
+ }
+ }
+ #endif
// Check lower bounds of the code cache
// Template Interpreter code is approximately 3X larger in debug builds.
uint min_code_cache_size = CodeCacheMinimumUseSpace DEBUG_ONLY(* 3);
if (InitialCodeCacheSize < (uintx)os::vm_page_size()) {
*** 3461,3470 ****
--- 3482,3522 ----
// check if the default lib/endorsed directory exists; if so, error
char path[JVM_MAXPATHLEN];
const char* fileSep = os::file_separator();
sprintf(path, "%s%slib%sendorsed", Arguments::get_java_home(), fileSep, fileSep);
+ #if INCLUDE_JVMCI
+ jint res = JVMCIRuntime::save_options(_system_properties);
+ if (res != JNI_OK) {
+ return res;
+ }
+
+ if (EnableJVMCI) {
+ // Append lib/jvmci/*.jar to boot class path
+ char jvmciDir[JVM_MAXPATHLEN];
+ const char* fileSep = os::file_separator();
+ jio_snprintf(jvmciDir, sizeof(jvmciDir), "%s%slib%sjvmci", Arguments::get_java_home(), fileSep, fileSep);
+ DIR* dir = os::opendir(jvmciDir);
+ if (dir != NULL) {
+ struct dirent *entry;
+ char *dbuf = NEW_C_HEAP_ARRAY(char, os::readdir_buf_size(jvmciDir), mtInternal);
+ while ((entry = os::readdir(dir, (dirent *) dbuf)) != NULL) {
+ const char* name = entry->d_name;
+ const char* ext = name + strlen(name) - 4;
+ if (ext > name && strcmp(ext, ".jar") == 0) {
+ char fileName[JVM_MAXPATHLEN];
+ jio_snprintf(fileName, sizeof(fileName), "%s%s%s", jvmciDir, fileSep, name);
+ scp_p->add_suffix(fileName);
+ scp_assembly_required = true;
+ }
+ }
+ FREE_C_HEAP_ARRAY(char, dbuf);
+ os::closedir(dir);
+ }
+ }
+ #endif // INCLUDE_JVMCI
+
if (CheckEndorsedAndExtDirs) {
int nonEmptyDirs = 0;
// check endorsed directory
nonEmptyDirs += check_non_empty_dirs(path);
// check the extension directories
*** 3519,3539 ****
// eventually fix up InitialTenuringThreshold if only MaxTenuringThreshold is set
if (FLAG_IS_DEFAULT(InitialTenuringThreshold) && (InitialTenuringThreshold > MaxTenuringThreshold)) {
FLAG_SET_ERGO(uintx, InitialTenuringThreshold, MaxTenuringThreshold);
}
! #ifndef COMPILER2
// Don't degrade server performance for footprint
if (FLAG_IS_DEFAULT(UseLargePages) &&
MaxHeapSize < LargePageHeapSizeThreshold) {
// No need for large granularity pages w/small heaps.
// Note that large pages are enabled/disabled for both the
// Java heap and the code cache.
FLAG_SET_DEFAULT(UseLargePages, false);
}
! #else
if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) {
FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1);
}
#endif
--- 3571,3591 ----
// eventually fix up InitialTenuringThreshold if only MaxTenuringThreshold is set
if (FLAG_IS_DEFAULT(InitialTenuringThreshold) && (InitialTenuringThreshold > MaxTenuringThreshold)) {
FLAG_SET_ERGO(uintx, InitialTenuringThreshold, MaxTenuringThreshold);
}
! #if !defined(COMPILER2) && !INCLUDE_JVMCI
// Don't degrade server performance for footprint
if (FLAG_IS_DEFAULT(UseLargePages) &&
MaxHeapSize < LargePageHeapSizeThreshold) {
// No need for large granularity pages w/small heaps.
// Note that large pages are enabled/disabled for both the
// Java heap and the code cache.
FLAG_SET_DEFAULT(UseLargePages, false);
}
! #elif defined(COMPILER2)
if (!FLAG_IS_DEFAULT(OptoLoopAlignment) && FLAG_IS_DEFAULT(MaxLoopPad)) {
FLAG_SET_DEFAULT(MaxLoopPad, OptoLoopAlignment-1);
}
#endif
*** 4277,4286 ****
--- 4329,4341 ----
// biased locking
if (UseHeavyMonitors
#ifdef COMPILER1
|| !UseFastLocking
#endif // COMPILER1
+ #if INCLUDE_JVMCI
+ || !JVMCIUseFastLocking
+ #endif
) {
if (!FLAG_IS_DEFAULT(UseBiasedLocking) && UseBiasedLocking) {
// flag set to true on command line; warn the user that they
// can't enable biased locking here
warning("Biased Locking is not supported with locking debug flags"
< prev index next >