8157986: Runtime support for javac to determine arguments to the runtime environment

Reviewed-by: alanb
This commit is contained in:
Mandy Chung 2016-05-27 08:52:22 -07:00
parent a29401159f
commit b9ff64a7cb
4 changed files with 24 additions and 0 deletions

View File

@ -267,6 +267,7 @@ SUNWprivate_1.1 {
Java_jdk_internal_misc_VM_geteuid;
Java_jdk_internal_misc_VM_getgid;
Java_jdk_internal_misc_VM_getegid;
Java_jdk_internal_misc_VM_getRuntimeArguments;
Java_jdk_internal_misc_VM_initialize;
Java_java_lang_reflect_Module_defineModule0;

View File

@ -475,6 +475,23 @@ public class VM {
*/
public static native long getNanoTimeAdjustment(long offsetInSeconds);
/**
* Returns the VM arguments for this runtime environment.
*
* @implNote
* The HotSpot JVM processes the input arguments from multiple sources
* in the following order:
* 1. JAVA_TOOL_OPTIONS environment variable
* 2. Options from JNI Invocation API
* 3. _JAVA_OPTIONS environment variable
*
* If VM options file is specified via -XX:VMOptionsFile, the vm options
* file is read and expanded in place of -XX:VMOptionFile option.
*
* Open issue with -XX:Flags (see JDK-8157979)
*/
public static native String[] getRuntimeArguments();
static {
initialize();
}

View File

@ -165,6 +165,7 @@ module java.base {
java.sql,
java.xml,
jdk.charsets,
jdk.compiler,
jdk.jartool,
jdk.jlink,
jdk.net,

View File

@ -55,3 +55,8 @@ Java_jdk_internal_misc_VM_initialize(JNIEnv *env, jclass cls) {
(*env)->RegisterNatives(env, cls,
methods, sizeof(methods)/sizeof(methods[0]));
}
JNIEXPORT jobjectArray JNICALL
Java_jdk_internal_misc_VM_getRuntimeArguments(JNIEnv *env, jclass cls) {
return JVM_GetVmArguments(env);
}