mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-08 23:20:20 +00:00
8153181: Move sun.misc.VMSupport to an internal package
Reviewed-by: alanb, mchung
This commit is contained in:
parent
871832c718
commit
42fa4e4cc3
@ -283,8 +283,8 @@ SUNWprivate_1.1 {
|
||||
Java_jdk_internal_loader_BootLoader_getSystemPackageNames;
|
||||
Java_jdk_internal_loader_BootLoader_setBootLoaderUnnamedModule0;
|
||||
|
||||
Java_sun_misc_VMSupport_initAgentProperties;
|
||||
Java_sun_misc_VMSupport_getVMTemporaryDirectory;
|
||||
Java_jdk_internal_vm_VMSupport_initAgentProperties;
|
||||
Java_jdk_internal_vm_VMSupport_getVMTemporaryDirectory;
|
||||
|
||||
# ZipFile.c needs this one
|
||||
throwFileNotFoundException;
|
||||
|
||||
@ -22,7 +22,7 @@
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
package sun.misc;
|
||||
package jdk.internal.vm;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
@ -182,6 +182,9 @@ module java.base {
|
||||
java.desktop;
|
||||
exports jdk.internal.util.jar to
|
||||
jdk.jartool;
|
||||
exports jdk.internal.vm to
|
||||
java.management,
|
||||
jdk.jvmstat;
|
||||
exports sun.net to
|
||||
java.httpclient;
|
||||
exports sun.net.dns to
|
||||
|
||||
@ -27,36 +27,17 @@
|
||||
#include "jni_util.h"
|
||||
#include "jlong.h"
|
||||
#include "jvm.h"
|
||||
#include "jdk_util.h"
|
||||
|
||||
#include "sun_misc_VMSupport.h"
|
||||
|
||||
typedef jobject (JNICALL *INIT_AGENT_PROPERTIES_FN)(JNIEnv *, jobject);
|
||||
|
||||
static INIT_AGENT_PROPERTIES_FN InitAgentProperties_fp = NULL;
|
||||
#include "jdk_internal_vm_VMSupport.h"
|
||||
|
||||
JNIEXPORT jobject JNICALL
|
||||
Java_sun_misc_VMSupport_initAgentProperties(JNIEnv *env, jclass cls, jobject props)
|
||||
Java_jdk_internal_vm_VMSupport_initAgentProperties(JNIEnv *env, jclass cls, jobject props)
|
||||
{
|
||||
if (InitAgentProperties_fp == NULL) {
|
||||
if (!JDK_InitJvmHandle()) {
|
||||
JNU_ThrowInternalError(env,
|
||||
"Handle for JVM not found for symbol lookup");
|
||||
return NULL;
|
||||
}
|
||||
InitAgentProperties_fp = (INIT_AGENT_PROPERTIES_FN)
|
||||
JDK_FindJvmEntry("JVM_InitAgentProperties");
|
||||
if (InitAgentProperties_fp == NULL) {
|
||||
JNU_ThrowInternalError(env,
|
||||
"Mismatched VM version: JVM_InitAgentProperties not found");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return (*InitAgentProperties_fp)(env, props);
|
||||
return JVM_InitAgentProperties(env, props);
|
||||
}
|
||||
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_sun_misc_VMSupport_getVMTemporaryDirectory(JNIEnv *env, jclass cls)
|
||||
Java_jdk_internal_vm_VMSupport_getVMTemporaryDirectory(JNIEnv *env, jclass cls)
|
||||
{
|
||||
return JVM_GetTemporaryDirectory(env);
|
||||
}
|
||||
|
||||
@ -52,7 +52,7 @@ import static sun.management.AgentConfigurationError.*;
|
||||
import sun.management.jmxremote.ConnectorBootstrap;
|
||||
import sun.management.jdp.JdpController;
|
||||
import sun.management.jdp.JdpException;
|
||||
import sun.misc.VMSupport;
|
||||
import jdk.internal.vm.VMSupport;
|
||||
|
||||
/**
|
||||
* This Agent is started by the VM when -Dcom.sun.management.snmp or
|
||||
|
||||
@ -257,9 +257,9 @@ util_initialize(JNIEnv *env)
|
||||
gdata->property_user_dir
|
||||
= getPropertyUTF8(env, "user.dir");
|
||||
|
||||
/* Get agent properties: invoke sun.misc.VMSupport.getAgentProperties */
|
||||
/* Get agent properties: invoke VMSupport.getAgentProperties */
|
||||
localVMSupportClass = JNI_FUNC_PTR(env,FindClass)
|
||||
(env, "sun/misc/VMSupport");
|
||||
(env, "jdk/internal/vm/VMSupport");
|
||||
if (localVMSupportClass == NULL) {
|
||||
gdata->agent_properties = NULL;
|
||||
if (JNI_FUNC_PTR(env,ExceptionOccurred)(env)) {
|
||||
@ -276,7 +276,7 @@ util_initialize(JNIEnv *env)
|
||||
if (JNI_FUNC_PTR(env,ExceptionOccurred)(env)) {
|
||||
JNI_FUNC_PTR(env,ExceptionClear)(env);
|
||||
EXIT_ERROR(AGENT_ERROR_INTERNAL,
|
||||
"Exception occurred calling sun.misc.VMSupport.getAgentProperties");
|
||||
"Exception occurred calling VMSupport.getAgentProperties");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@ package sun.jvmstat.perfdata.monitor.protocol.local;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FilenameFilter;
|
||||
import jdk.internal.vm.VMSupport;
|
||||
|
||||
/**
|
||||
* Class to provide translations from the local Vm Identifier
|
||||
@ -291,7 +292,7 @@ public class PerfDataFile {
|
||||
* the same directory. Instead of guessing which directory the
|
||||
* VM is using, we will ask.
|
||||
*/
|
||||
String tmpdir = sun.misc.VMSupport.getVMTemporaryDirectory();
|
||||
String tmpdir = VMSupport.getVMTemporaryDirectory();
|
||||
|
||||
/*
|
||||
* Assure that the string returned has a trailing File.separator
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user