8260193: Remove JVM_GetInterfaceVersion() and JVM_DTraceXXX

Reviewed-by: alanb, lfoltan, gziemski, ihse
This commit is contained in:
Ioi Lam 2021-02-03 03:56:35 +00:00
parent 98a76921ec
commit b9d4211bc1
4 changed files with 2 additions and 112 deletions

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -100,7 +100,6 @@ JVM_GetExtendedNPEMessage
JVM_GetFieldIxModifiers
JVM_GetFieldTypeAnnotations
JVM_GetInheritedAccessControlContext
JVM_GetInterfaceVersion
JVM_GetManagement
JVM_GetMethodIxArgsSize
JVM_GetMethodIxByteCode

View File

@ -56,20 +56,6 @@ extern "C" {
* namely the jio_xxxprintf functions, are included from jvm_io.h.
*/
/*
* Bump the version number when either of the following happens:
*
* 1. There is a change in JVM_* functions.
*
* 2. There is a change in the contract between VM and Java classes.
* For example, if the VM relies on a new private field in Thread
* class.
*/
#define JVM_INTERFACE_VERSION 6
JNIEXPORT jint JNICALL
JVM_GetInterfaceVersion(void);
/*************************************************************************
PART 1: Functions for Native Libraries
@ -761,80 +747,6 @@ JVM_AssertionStatusDirectives(JNIEnv *env, jclass unused);
JNIEXPORT jboolean JNICALL
JVM_SupportsCX8(void);
/*
* com.sun.dtrace.jsdt support
*/
#define JVM_TRACING_DTRACE_VERSION 1
/*
* Structure to pass one probe description to JVM
*/
typedef struct {
jmethodID method;
jstring function;
jstring name;
void* reserved[4]; // for future use
} JVM_DTraceProbe;
/**
* Encapsulates the stability ratings for a DTrace provider field
*/
typedef struct {
jint nameStability;
jint dataStability;
jint dependencyClass;
} JVM_DTraceInterfaceAttributes;
/*
* Structure to pass one provider description to JVM
*/
typedef struct {
jstring name;
JVM_DTraceProbe* probes;
jint probe_count;
JVM_DTraceInterfaceAttributes providerAttributes;
JVM_DTraceInterfaceAttributes moduleAttributes;
JVM_DTraceInterfaceAttributes functionAttributes;
JVM_DTraceInterfaceAttributes nameAttributes;
JVM_DTraceInterfaceAttributes argsAttributes;
void* reserved[4]; // for future use
} JVM_DTraceProvider;
/*
* Get the version number the JVM was built with
*/
JNIEXPORT jint JNICALL
JVM_DTraceGetVersion(JNIEnv* env);
/*
* Register new probe with given signature, return global handle
*
* The version passed in is the version that the library code was
* built with.
*/
JNIEXPORT jlong JNICALL
JVM_DTraceActivate(JNIEnv* env, jint version, jstring module_name,
jint providers_count, JVM_DTraceProvider* providers);
/*
* Check JSDT probe
*/
JNIEXPORT jboolean JNICALL
JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method);
/*
* Destroy custom DOF
*/
JNIEXPORT void JNICALL
JVM_DTraceDispose(JNIEnv* env, jlong activation_handle);
/*
* Check to see if DTrace is supported by OS
*/
JNIEXPORT jboolean JNICALL
JVM_DTraceIsSupported(JNIEnv* env);
/*************************************************************************
PART 2: Support for the Verifier and Class File Format Checker
************************************************************************/

View File

@ -94,7 +94,6 @@
#include "services/threadService.hpp"
#include "utilities/copy.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
#include "utilities/macros.hpp"
#include "utilities/utf8.hpp"
@ -228,15 +227,6 @@ void trace_class_resolution(Klass* to_class) {
}
}
// Interface version /////////////////////////////////////////////////////////////////////
JVM_LEAF(jint, JVM_GetInterfaceVersion())
return JVM_INTERFACE_VERSION;
JVM_END
// java.lang.System //////////////////////////////////////////////////////////////////////

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -30,16 +30,5 @@
JNIEXPORT jint JNICALL
DEF_JNI_OnLoad(JavaVM *vm, void *reserved)
{
jint vm_version = JVM_GetInterfaceVersion();
if (vm_version != JVM_INTERFACE_VERSION) {
JNIEnv *env;
char buf[128];
sprintf(buf, "JVM interface version mismatch: expecting %d, got %d.",
JVM_INTERFACE_VERSION, (int)vm_version);
(*vm)->GetEnv(vm, (void **)&env, JNI_VERSION_1_2);
if (env) {
(*env)->FatalError(env, buf);
}
}
return JNI_VERSION_1_2;
}