0N/A/*
2362N/A * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/A#include <jni.h>
0N/A
0N/A#include "JPLISAgent.h"
0N/A#include "JPLISAssert.h"
0N/A#include "Utilities.h"
0N/A#include "JavaExceptions.h"
502N/A#include "FileSystemSupport.h" /* For uintptr_t */
0N/A#include "sun_instrument_InstrumentationImpl.h"
0N/A
0N/A/*
0N/A * Copyright 2003 Wily Technology, Inc.
0N/A */
0N/A
0N/A/**
0N/A * This module contains the native method implementations to back the
0N/A * sun.instrument.InstrumentationImpl class.
0N/A * The bridge between Java and native code is built by storing a native
0N/A * pointer to the JPLISAgent data structure in a 64 bit scalar field
0N/A * in the InstrumentationImpl instance which is passed to each method.
0N/A */
0N/A
0N/A
0N/A/*
0N/A * Native methods
0N/A */
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: isModifiableClass0
0N/A * Signature: (Ljava/lang/Class;)Z
0N/A */
0N/AJNIEXPORT jboolean JNICALL
0N/AJava_sun_instrument_InstrumentationImpl_isModifiableClass0
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent, jclass clazz) {
0N/A return isModifiableClass(jnienv, (JPLISAgent*)(intptr_t)agent, clazz);
0N/A}
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: isRetransformClassesSupported0
0N/A * Signature: ()Z
0N/A */
0N/AJNIEXPORT jboolean JNICALL
0N/AJava_sun_instrument_InstrumentationImpl_isRetransformClassesSupported0
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent) {
0N/A return isRetransformClassesSupported(jnienv, (JPLISAgent*)(intptr_t)agent);
0N/A}
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: setHasRetransformableTransformers
0N/A * Signature: (Z)V
0N/A */
0N/AJNIEXPORT void JNICALL
0N/AJava_sun_instrument_InstrumentationImpl_setHasRetransformableTransformers
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent, jboolean has) {
0N/A setHasRetransformableTransformers(jnienv, (JPLISAgent*)(intptr_t)agent, has);
0N/A}
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: retransformClasses0
0N/A * Signature: ([Ljava/lang/Class;)V
0N/A */
0N/AJNIEXPORT void JNICALL
0N/AJava_sun_instrument_InstrumentationImpl_retransformClasses0
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent, jobjectArray classes) {
0N/A retransformClasses(jnienv, (JPLISAgent*)(intptr_t)agent, classes);
0N/A}
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: redefineClasses0
0N/A * Signature: ([Ljava/lang/instrument/ClassDefinition;)V
0N/A */
0N/AJNIEXPORT void JNICALL Java_sun_instrument_InstrumentationImpl_redefineClasses0
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent, jobjectArray classDefinitions) {
0N/A redefineClasses(jnienv, (JPLISAgent*)(intptr_t)agent, classDefinitions);
0N/A}
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: getAllLoadedClasses0
0N/A * Signature: ()[Ljava/lang/Class;
0N/A */
0N/AJNIEXPORT jobjectArray JNICALL Java_sun_instrument_InstrumentationImpl_getAllLoadedClasses0
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent) {
0N/A return getAllLoadedClasses(jnienv, (JPLISAgent*)(intptr_t)agent);
0N/A}
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: getInitiatedClasses0
0N/A * Signature: (Ljava/lang/ClassLoader;)[Ljava/lang/Class;
0N/A */
0N/AJNIEXPORT jobjectArray JNICALL Java_sun_instrument_InstrumentationImpl_getInitiatedClasses0
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent, jobject classLoader) {
0N/A return getInitiatedClasses(jnienv, (JPLISAgent*)(intptr_t)agent, classLoader);
0N/A}
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: getObjectSize0
0N/A * Signature: (Ljava/lang/Object;)J
0N/A */
0N/AJNIEXPORT jlong JNICALL Java_sun_instrument_InstrumentationImpl_getObjectSize0
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent, jobject objectToSize) {
0N/A return getObjectSize(jnienv, (JPLISAgent*)(intptr_t)agent, objectToSize);
0N/A}
0N/A
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: appendToClassLoaderSearch0
0N/A * Signature: (Ljava/lang/String;Z)V
0N/A */
0N/AJNIEXPORT void JNICALL Java_sun_instrument_InstrumentationImpl_appendToClassLoaderSearch0
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent, jstring jarFile, jboolean isBootLoader) {
0N/A appendToClassLoaderSearch(jnienv, (JPLISAgent*)(intptr_t)agent, jarFile, isBootLoader);
0N/A}
0N/A
0N/A
0N/A/*
0N/A * Class: sun_instrument_InstrumentationImpl
0N/A * Method: setNativeMethodPrefixes
0N/A * Signature: ([Ljava/lang/String;Z)V
0N/A */
0N/AJNIEXPORT void JNICALL Java_sun_instrument_InstrumentationImpl_setNativeMethodPrefixes
0N/A (JNIEnv * jnienv, jobject implThis, jlong agent, jobjectArray prefixArray, jboolean isRetransformable) {
0N/A setNativeMethodPrefixes(jnienv, (JPLISAgent*)(intptr_t)agent, prefixArray, isRetransformable);
0N/A}