blob: 5d45938f9f0a0dd6d030ee8b013f3695477a540c [file] [log] [blame]
Elliott Hugheseac76672012-05-24 21:56:51 -07001/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef ART_SRC_WELL_KNOWN_CLASSES_H_
18#define ART_SRC_WELL_KNOWN_CLASSES_H_
19
20#include "jni.h"
21
22namespace art {
23
24// Various classes used in JNI. We cache them so we don't have to keep looking
25// them up. Similar to libcore's JniConstants (except there's no overlap, so
26// we keep them separate).
27
28struct WellKnownClasses {
29 static void Init(JNIEnv* env);
30
31 static jclass com_android_dex_Dex;
32 static jclass java_lang_ClassLoader;
33 static jclass java_lang_ClassNotFoundException;
34 static jclass java_lang_Daemons;
35 static jclass java_lang_Error;
36 static jclass java_lang_ExceptionInInitializerError;
37 static jclass java_lang_reflect_InvocationHandler;
38 static jclass java_lang_reflect_Method;
39 static jclass java_lang_reflect_Proxy;
40 static jclass java_lang_reflect_UndeclaredThrowableException;
41 static jclass java_lang_Thread;
42 static jclass java_nio_ReadWriteDirectByteBuffer;
43 static jclass org_apache_harmony_dalvik_ddmc_Chunk;
44 static jclass org_apache_harmony_dalvik_ddmc_DdmServer;
45
46 static jmethodID com_android_dex_Dex_create;
47 static jmethodID java_lang_ClassNotFoundException_init;
48 static jmethodID java_lang_Daemons_requestHeapTrim;
49 static jmethodID java_lang_Daemons_start;
50 static jmethodID java_lang_reflect_InvocationHandler_invoke;
51 static jmethodID java_lang_Thread_init;
52 static jmethodID java_nio_ReadWriteDirectByteBuffer_init;
53 static jmethodID org_apache_harmony_dalvik_ddmc_DdmServer_broadcast;
54 static jmethodID org_apache_harmony_dalvik_ddmc_DdmServer_dispatch;
55
56 static jfieldID java_lang_reflect_Proxy_h;
57 static jfieldID java_nio_ReadWriteDirectByteBuffer_capacity;
58 static jfieldID java_nio_ReadWriteDirectByteBuffer_effectiveDirectAddress;
59 static jfieldID org_apache_harmony_dalvik_ddmc_Chunk_data;
60 static jfieldID org_apache_harmony_dalvik_ddmc_Chunk_length;
61 static jfieldID org_apache_harmony_dalvik_ddmc_Chunk_offset;
62 static jfieldID org_apache_harmony_dalvik_ddmc_Chunk_type;
63};
64
65} // namespace art
66
67#endif // ART_SRC_WELL_KNOWN_CLASSES_H_