jvm_misc.hpp revision 2273
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico/*
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico *
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * This code is free software; you can redistribute it and/or modify it
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * under the terms of the GNU General Public License version 2 only, as
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * published by the Free Software Foundation.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico *
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * This code is distributed in the hope that it will be useful, but WITHOUT
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * version 2 for more details (a copy is included in the LICENSE file that
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * accompanied this code).
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico *
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * You should have received a copy of the GNU General Public License version
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * 2 along with this work; if not, write to the Free Software Foundation,
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico *
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * or visit www.oracle.com if you need additional information or have any
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * questions.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico *
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico */
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico#ifndef SHARE_VM_PRIMS_JVM_MISC_HPP
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico#define SHARE_VM_PRIMS_JVM_MISC_HPP
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico#include "prims/jni.h"
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico#include "runtime/handles.hpp"
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico// Useful entry points shared by JNI and JVM interface.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico// We do not allow real JNI or JVM entry point to call each other.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicojclass find_class_from_class_loader(JNIEnv* env, Symbol* name, jboolean init, Handle loader, Handle protection_domain, jboolean throwError, TRAPS);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicovoid trace_class_resolution(klassOop to_class);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico/*
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * Support for Serialization and RMI. Currently used by HotSpot only.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico */
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoextern "C" {
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicovoid JNICALL
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoJVM_SetPrimitiveFieldValues(JNIEnv *env, jclass cb, jobject obj,
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico jlongArray fieldIDs, jcharArray typecodes, jbyteArray data);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicovoid JNICALL
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoJVM_GetPrimitiveFieldValues(JNIEnv *env, jclass cb, jobject obj,
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico jlongArray fieldIDs, jcharArray typecodes, jbyteArray data);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico}
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico/*
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * Support for -Xcheck:jni
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico */
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoextern struct JNINativeInterface_* jni_functions_nocheck();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoextern struct JNINativeInterface_* jni_functions_check();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico/*
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico * Support for swappable jni function table.
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico */
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoextern struct JNINativeInterface_* jni_functions();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoextern void copy_jni_function_table(const struct JNINativeInterface_* new_function_table);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico// Support for fast JNI accessors
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoextern "C" {
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico typedef jboolean (JNICALL *GetBooleanField_t)
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico (JNIEnv *env, jobject obj, jfieldID fieldID);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico typedef jbyte (JNICALL *GetByteField_t)
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico (JNIEnv *env, jobject obj, jfieldID fieldID);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico typedef jchar (JNICALL *GetCharField_t)
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico (JNIEnv *env, jobject obj, jfieldID fieldID);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico typedef jshort (JNICALL *GetShortField_t)
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico (JNIEnv *env, jobject obj, jfieldID fieldID);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico typedef jint (JNICALL *GetIntField_t)
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico (JNIEnv *env, jobject obj, jfieldID fieldID);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico typedef jlong (JNICALL *GetLongField_t)
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico (JNIEnv *env, jobject obj, jfieldID fieldID);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico typedef jfloat (JNICALL *GetFloatField_t)
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico (JNIEnv *env, jobject obj, jfieldID fieldID);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico typedef jdouble (JNICALL *GetDoubleField_t)
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico (JNIEnv *env, jobject obj, jfieldID fieldID);
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico}
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicovoid quicken_jni_functions();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoaddress jni_GetBooleanField_addr();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoaddress jni_GetByteField_addr();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoaddress jni_GetCharField_addr();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoaddress jni_GetShortField_addr();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoaddress jni_GetIntField_addr();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoaddress jni_GetLongField_addr();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoaddress jni_GetFloatField_addr();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNicoaddress jni_GetDoubleField_addr();
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico#endif // SHARE_VM_PRIMS_JVM_MISC_HPP
0eb53ace2492767780264a2bc53c0996751565c0JazzyNico