Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/instrument/InstrumentationImplNativeMethods.c
38767 views
/*1* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425#include <jni.h>2627#include "JPLISAgent.h"28#include "JPLISAssert.h"29#include "Utilities.h"30#include "JavaExceptions.h"31#include "FileSystemSupport.h" /* For uintptr_t */32#include "sun_instrument_InstrumentationImpl.h"3334/*35* Copyright 2003 Wily Technology, Inc.36*/3738/**39* This module contains the native method implementations to back the40* sun.instrument.InstrumentationImpl class.41* The bridge between Java and native code is built by storing a native42* pointer to the JPLISAgent data structure in a 64 bit scalar field43* in the InstrumentationImpl instance which is passed to each method.44*/454647/*48* Native methods49*/5051/*52* Class: sun_instrument_InstrumentationImpl53* Method: isModifiableClass054* Signature: (Ljava/lang/Class;)Z55*/56JNIEXPORT jboolean JNICALL57Java_sun_instrument_InstrumentationImpl_isModifiableClass058(JNIEnv * jnienv, jobject implThis, jlong agent, jclass clazz) {59return isModifiableClass(jnienv, (JPLISAgent*)(intptr_t)agent, clazz);60}6162/*63* Class: sun_instrument_InstrumentationImpl64* Method: isRetransformClassesSupported065* Signature: ()Z66*/67JNIEXPORT jboolean JNICALL68Java_sun_instrument_InstrumentationImpl_isRetransformClassesSupported069(JNIEnv * jnienv, jobject implThis, jlong agent) {70return isRetransformClassesSupported(jnienv, (JPLISAgent*)(intptr_t)agent);71}7273/*74* Class: sun_instrument_InstrumentationImpl75* Method: setHasRetransformableTransformers76* Signature: (Z)V77*/78JNIEXPORT void JNICALL79Java_sun_instrument_InstrumentationImpl_setHasRetransformableTransformers80(JNIEnv * jnienv, jobject implThis, jlong agent, jboolean has) {81setHasRetransformableTransformers(jnienv, (JPLISAgent*)(intptr_t)agent, has);82}8384/*85* Class: sun_instrument_InstrumentationImpl86* Method: retransformClasses087* Signature: ([Ljava/lang/Class;)V88*/89JNIEXPORT void JNICALL90Java_sun_instrument_InstrumentationImpl_retransformClasses091(JNIEnv * jnienv, jobject implThis, jlong agent, jobjectArray classes) {92retransformClasses(jnienv, (JPLISAgent*)(intptr_t)agent, classes);93}9495/*96* Class: sun_instrument_InstrumentationImpl97* Method: redefineClasses098* Signature: ([Ljava/lang/instrument/ClassDefinition;)V99*/100JNIEXPORT void JNICALL Java_sun_instrument_InstrumentationImpl_redefineClasses0101(JNIEnv * jnienv, jobject implThis, jlong agent, jobjectArray classDefinitions) {102redefineClasses(jnienv, (JPLISAgent*)(intptr_t)agent, classDefinitions);103}104105/*106* Class: sun_instrument_InstrumentationImpl107* Method: getAllLoadedClasses0108* Signature: ()[Ljava/lang/Class;109*/110JNIEXPORT jobjectArray JNICALL Java_sun_instrument_InstrumentationImpl_getAllLoadedClasses0111(JNIEnv * jnienv, jobject implThis, jlong agent) {112return getAllLoadedClasses(jnienv, (JPLISAgent*)(intptr_t)agent);113}114115/*116* Class: sun_instrument_InstrumentationImpl117* Method: getInitiatedClasses0118* Signature: (Ljava/lang/ClassLoader;)[Ljava/lang/Class;119*/120JNIEXPORT jobjectArray JNICALL Java_sun_instrument_InstrumentationImpl_getInitiatedClasses0121(JNIEnv * jnienv, jobject implThis, jlong agent, jobject classLoader) {122return getInitiatedClasses(jnienv, (JPLISAgent*)(intptr_t)agent, classLoader);123}124125/*126* Class: sun_instrument_InstrumentationImpl127* Method: getObjectSize0128* Signature: (Ljava/lang/Object;)J129*/130JNIEXPORT jlong JNICALL Java_sun_instrument_InstrumentationImpl_getObjectSize0131(JNIEnv * jnienv, jobject implThis, jlong agent, jobject objectToSize) {132return getObjectSize(jnienv, (JPLISAgent*)(intptr_t)agent, objectToSize);133}134135136/*137* Class: sun_instrument_InstrumentationImpl138* Method: appendToClassLoaderSearch0139* Signature: (Ljava/lang/String;Z)V140*/141JNIEXPORT void JNICALL Java_sun_instrument_InstrumentationImpl_appendToClassLoaderSearch0142(JNIEnv * jnienv, jobject implThis, jlong agent, jstring jarFile, jboolean isBootLoader) {143appendToClassLoaderSearch(jnienv, (JPLISAgent*)(intptr_t)agent, jarFile, isBootLoader);144}145146147/*148* Class: sun_instrument_InstrumentationImpl149* Method: setNativeMethodPrefixes150* Signature: ([Ljava/lang/String;Z)V151*/152JNIEXPORT void JNICALL Java_sun_instrument_InstrumentationImpl_setNativeMethodPrefixes153(JNIEnv * jnienv, jobject implThis, jlong agent, jobjectArray prefixArray, jboolean isRetransformable) {154setNativeMethodPrefixes(jnienv, (JPLISAgent*)(intptr_t)agent, prefixArray, isRetransformable);155}156157158