src/hotspot/share/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File open Cdiff src/hotspot/share/runtime/arguments.cpp

src/hotspot/share/runtime/arguments.cpp

Print this page

        

*** 3373,3382 **** --- 3373,3398 ---- } #if INCLUDE_JVMCI if (UseJVMCICompiler) { Compilation_mode = CompMode_server; + // Add jdk.internal.vm.compiler module when Graal is used as JIT + // and --limit-modules are spcified. + const char* jvmci_compiler = Arguments::get_property("jvmci.Compiler"); + const char* limit_modules = Arguments::get_property("jdk.module.limitmods"); + if (limit_modules != NULL && + (jvmci_compiler == NULL || strcmp(jvmci_compiler, "graal") == 0)) { + size_t prop_len = strlen(limit_modules) + strlen("jdk.internal.vm.compiler") + 2; + char* new_limit_modules = AllocateHeap(prop_len, mtArguments); + int ret = jio_snprintf(new_limit_modules, prop_len, "%s,jdk.internal.vm.compiler", limit_modules); + if (ret < 0 || ret >= (int)prop_len) { + FreeHeap(new_limit_modules); + return JNI_ENOMEM; + } + PropertyList_unique_add(&_system_properties, "jdk.module.limitmods", new_limit_modules, AddProperty, UnwriteableProperty, InternalProperty); + FreeHeap(new_limit_modules); + } } #endif #if INCLUDE_CDS if (DumpSharedSpaces) {
src/hotspot/share/runtime/arguments.cpp
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File