Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 1 | /* |
| 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 | #include "well_known_classes.h" |
| 18 | |
| 19 | #include <stdlib.h> |
| 20 | |
| 21 | #include "logging.h" |
| 22 | #include "ScopedLocalRef.h" |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 23 | #include "thread.h" |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 24 | |
| 25 | namespace art { |
| 26 | |
| 27 | jclass WellKnownClasses::com_android_dex_Dex; |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 28 | jclass WellKnownClasses::dalvik_system_PathClassLoader; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 29 | jclass WellKnownClasses::java_lang_ClassLoader; |
| 30 | jclass WellKnownClasses::java_lang_ClassNotFoundException; |
| 31 | jclass WellKnownClasses::java_lang_Daemons; |
| 32 | jclass WellKnownClasses::java_lang_Error; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 33 | jclass WellKnownClasses::java_lang_reflect_InvocationHandler; |
Mathieu Chartier | 66f1925 | 2012-09-18 08:57:04 -0700 | [diff] [blame] | 34 | jclass WellKnownClasses::java_lang_reflect_AbstractMethod; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 35 | jclass WellKnownClasses::java_lang_reflect_Proxy; |
Elliott Hughes | a4f9474 | 2012-05-29 16:28:38 -0700 | [diff] [blame] | 36 | jclass WellKnownClasses::java_lang_RuntimeException; |
Ian Rogers | 120f1c7 | 2012-09-28 17:17:10 -0700 | [diff] [blame] | 37 | jclass WellKnownClasses::java_lang_StackOverflowError; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 38 | jclass WellKnownClasses::java_lang_Thread; |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 39 | jclass WellKnownClasses::java_lang_Thread$UncaughtExceptionHandler; |
| 40 | jclass WellKnownClasses::java_lang_ThreadGroup; |
| 41 | jclass WellKnownClasses::java_lang_ThreadLock; |
Elliott Hughes | a4f9474 | 2012-05-29 16:28:38 -0700 | [diff] [blame] | 42 | jclass WellKnownClasses::java_lang_Throwable; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 43 | jclass WellKnownClasses::java_nio_ReadWriteDirectByteBuffer; |
| 44 | jclass WellKnownClasses::org_apache_harmony_dalvik_ddmc_Chunk; |
| 45 | jclass WellKnownClasses::org_apache_harmony_dalvik_ddmc_DdmServer; |
| 46 | |
| 47 | jmethodID WellKnownClasses::com_android_dex_Dex_create; |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 48 | jmethodID WellKnownClasses::java_lang_Boolean_valueOf; |
| 49 | jmethodID WellKnownClasses::java_lang_Byte_valueOf; |
| 50 | jmethodID WellKnownClasses::java_lang_Character_valueOf; |
Elliott Hughes | a4f9474 | 2012-05-29 16:28:38 -0700 | [diff] [blame] | 51 | jmethodID WellKnownClasses::java_lang_ClassLoader_loadClass; |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 52 | jmethodID WellKnownClasses::java_lang_ClassNotFoundException_init; |
Mathieu Chartier | 7664f5c | 2012-06-08 18:15:32 -0700 | [diff] [blame] | 53 | jmethodID WellKnownClasses::java_lang_Daemons_requestGC; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 54 | jmethodID WellKnownClasses::java_lang_Daemons_requestHeapTrim; |
| 55 | jmethodID WellKnownClasses::java_lang_Daemons_start; |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 56 | jmethodID WellKnownClasses::java_lang_Double_valueOf; |
| 57 | jmethodID WellKnownClasses::java_lang_Float_valueOf; |
| 58 | jmethodID WellKnownClasses::java_lang_Integer_valueOf; |
| 59 | jmethodID WellKnownClasses::java_lang_Long_valueOf; |
Elliott Hughes | a4f9474 | 2012-05-29 16:28:38 -0700 | [diff] [blame] | 60 | jmethodID WellKnownClasses::java_lang_ref_FinalizerReference_add; |
| 61 | jmethodID WellKnownClasses::java_lang_ref_ReferenceQueue_add; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 62 | jmethodID WellKnownClasses::java_lang_reflect_InvocationHandler_invoke; |
Ian Rogers | ef28b14 | 2012-11-30 14:22:18 -0800 | [diff] [blame] | 63 | jmethodID WellKnownClasses::java_lang_Runtime_nativeLoad; |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 64 | jmethodID WellKnownClasses::java_lang_Short_valueOf; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 65 | jmethodID WellKnownClasses::java_lang_Thread_init; |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 66 | jmethodID WellKnownClasses::java_lang_Thread_run; |
| 67 | jmethodID WellKnownClasses::java_lang_Thread$UncaughtExceptionHandler_uncaughtException; |
| 68 | jmethodID WellKnownClasses::java_lang_ThreadGroup_removeThread; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 69 | jmethodID WellKnownClasses::java_nio_ReadWriteDirectByteBuffer_init; |
| 70 | jmethodID WellKnownClasses::org_apache_harmony_dalvik_ddmc_DdmServer_broadcast; |
| 71 | jmethodID WellKnownClasses::org_apache_harmony_dalvik_ddmc_DdmServer_dispatch; |
| 72 | |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 73 | jfieldID WellKnownClasses::java_lang_Thread_daemon; |
| 74 | jfieldID WellKnownClasses::java_lang_Thread_group; |
| 75 | jfieldID WellKnownClasses::java_lang_Thread_lock; |
| 76 | jfieldID WellKnownClasses::java_lang_Thread_name; |
| 77 | jfieldID WellKnownClasses::java_lang_Thread_priority; |
| 78 | jfieldID WellKnownClasses::java_lang_Thread_uncaughtHandler; |
| 79 | jfieldID WellKnownClasses::java_lang_Thread_vmData; |
| 80 | jfieldID WellKnownClasses::java_lang_ThreadGroup_mainThreadGroup; |
| 81 | jfieldID WellKnownClasses::java_lang_ThreadGroup_name; |
| 82 | jfieldID WellKnownClasses::java_lang_ThreadGroup_systemThreadGroup; |
| 83 | jfieldID WellKnownClasses::java_lang_ThreadLock_thread; |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 84 | jfieldID WellKnownClasses::java_lang_reflect_Proxy_h; |
| 85 | jfieldID WellKnownClasses::java_nio_ReadWriteDirectByteBuffer_capacity; |
| 86 | jfieldID WellKnownClasses::java_nio_ReadWriteDirectByteBuffer_effectiveDirectAddress; |
| 87 | jfieldID WellKnownClasses::org_apache_harmony_dalvik_ddmc_Chunk_data; |
| 88 | jfieldID WellKnownClasses::org_apache_harmony_dalvik_ddmc_Chunk_length; |
| 89 | jfieldID WellKnownClasses::org_apache_harmony_dalvik_ddmc_Chunk_offset; |
| 90 | jfieldID WellKnownClasses::org_apache_harmony_dalvik_ddmc_Chunk_type; |
| 91 | |
| 92 | static jclass CacheClass(JNIEnv* env, const char* jni_class_name) { |
| 93 | ScopedLocalRef<jclass> c(env, env->FindClass(jni_class_name)); |
| 94 | if (c.get() == NULL) { |
| 95 | LOG(FATAL) << "Couldn't find class: " << jni_class_name; |
| 96 | } |
| 97 | return reinterpret_cast<jclass>(env->NewGlobalRef(c.get())); |
| 98 | } |
| 99 | |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 100 | static jfieldID CacheField(JNIEnv* env, jclass c, bool is_static, const char* name, const char* signature) { |
| 101 | jfieldID fid = is_static ? env->GetStaticFieldID(c, name, signature) : env->GetFieldID(c, name, signature); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 102 | if (fid == NULL) { |
| 103 | LOG(FATAL) << "Couldn't find field \"" << name << "\" with signature \"" << signature << "\""; |
| 104 | } |
| 105 | return fid; |
| 106 | } |
| 107 | |
| 108 | static jmethodID CacheMethod(JNIEnv* env, jclass c, bool is_static, const char* name, const char* signature) { |
| 109 | jmethodID mid = is_static ? env->GetStaticMethodID(c, name, signature) : env->GetMethodID(c, name, signature); |
| 110 | if (mid == NULL) { |
| 111 | LOG(FATAL) << "Couldn't find method \"" << name << "\" with signature \"" << signature << "\""; |
| 112 | } |
| 113 | return mid; |
| 114 | } |
| 115 | |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 116 | static jmethodID CachePrimitiveBoxingMethod(JNIEnv* env, char prim_name, const char* boxed_name) { |
| 117 | ScopedLocalRef<jclass> boxed_class(env, env->FindClass(boxed_name)); |
| 118 | return CacheMethod(env, boxed_class.get(), true, "valueOf", |
| 119 | StringPrintf("(%c)L%s;", prim_name, boxed_name).c_str()); |
| 120 | } |
| 121 | |
| 122 | void WellKnownClasses::InitClasses(JNIEnv* env) { |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 123 | com_android_dex_Dex = CacheClass(env, "com/android/dex/Dex"); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 124 | dalvik_system_PathClassLoader = CacheClass(env, "dalvik/system/PathClassLoader"); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 125 | java_lang_ClassLoader = CacheClass(env, "java/lang/ClassLoader"); |
| 126 | java_lang_ClassNotFoundException = CacheClass(env, "java/lang/ClassNotFoundException"); |
| 127 | java_lang_Daemons = CacheClass(env, "java/lang/Daemons"); |
| 128 | java_lang_Error = CacheClass(env, "java/lang/Error"); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 129 | java_lang_reflect_InvocationHandler = CacheClass(env, "java/lang/reflect/InvocationHandler"); |
Mathieu Chartier | 66f1925 | 2012-09-18 08:57:04 -0700 | [diff] [blame] | 130 | java_lang_reflect_AbstractMethod = CacheClass(env, "java/lang/reflect/AbstractMethod"); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 131 | java_lang_reflect_Proxy = CacheClass(env, "java/lang/reflect/Proxy"); |
Elliott Hughes | a4f9474 | 2012-05-29 16:28:38 -0700 | [diff] [blame] | 132 | java_lang_RuntimeException = CacheClass(env, "java/lang/RuntimeException"); |
Ian Rogers | 120f1c7 | 2012-09-28 17:17:10 -0700 | [diff] [blame] | 133 | java_lang_StackOverflowError = CacheClass(env, "java/lang/StackOverflowError"); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 134 | java_lang_Thread = CacheClass(env, "java/lang/Thread"); |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 135 | java_lang_Thread$UncaughtExceptionHandler = CacheClass(env, "java/lang/Thread$UncaughtExceptionHandler"); |
| 136 | java_lang_ThreadGroup = CacheClass(env, "java/lang/ThreadGroup"); |
| 137 | java_lang_ThreadLock = CacheClass(env, "java/lang/ThreadLock"); |
Elliott Hughes | a4f9474 | 2012-05-29 16:28:38 -0700 | [diff] [blame] | 138 | java_lang_Throwable = CacheClass(env, "java/lang/Throwable"); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 139 | java_nio_ReadWriteDirectByteBuffer = CacheClass(env, "java/nio/ReadWriteDirectByteBuffer"); |
| 140 | org_apache_harmony_dalvik_ddmc_Chunk = CacheClass(env, "org/apache/harmony/dalvik/ddmc/Chunk"); |
| 141 | org_apache_harmony_dalvik_ddmc_DdmServer = CacheClass(env, "org/apache/harmony/dalvik/ddmc/DdmServer"); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 142 | } |
| 143 | |
| 144 | void WellKnownClasses::Init(JNIEnv* env) { |
| 145 | InitClasses(env); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 146 | |
| 147 | com_android_dex_Dex_create = CacheMethod(env, com_android_dex_Dex, true, "create", "(Ljava/nio/ByteBuffer;)Lcom/android/dex/Dex;"); |
| 148 | java_lang_ClassNotFoundException_init = CacheMethod(env, java_lang_ClassNotFoundException, false, "<init>", "(Ljava/lang/String;Ljava/lang/Throwable;)V"); |
Elliott Hughes | a4f9474 | 2012-05-29 16:28:38 -0700 | [diff] [blame] | 149 | java_lang_ClassLoader_loadClass = CacheMethod(env, java_lang_ClassLoader, false, "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;"); |
Mathieu Chartier | 7664f5c | 2012-06-08 18:15:32 -0700 | [diff] [blame] | 150 | |
| 151 | java_lang_Daemons_requestGC = CacheMethod(env, java_lang_Daemons, true, "requestGC", "()V"); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 152 | java_lang_Daemons_requestHeapTrim = CacheMethod(env, java_lang_Daemons, true, "requestHeapTrim", "()V"); |
| 153 | java_lang_Daemons_start = CacheMethod(env, java_lang_Daemons, true, "start", "()V"); |
Elliott Hughes | a4f9474 | 2012-05-29 16:28:38 -0700 | [diff] [blame] | 154 | |
| 155 | ScopedLocalRef<jclass> java_lang_ref_FinalizerReference(env, env->FindClass("java/lang/ref/FinalizerReference")); |
| 156 | java_lang_ref_FinalizerReference_add = CacheMethod(env, java_lang_ref_FinalizerReference.get(), true, "add", "(Ljava/lang/Object;)V"); |
| 157 | ScopedLocalRef<jclass> java_lang_ref_ReferenceQueue(env, env->FindClass("java/lang/ref/ReferenceQueue")); |
| 158 | java_lang_ref_ReferenceQueue_add = CacheMethod(env, java_lang_ref_ReferenceQueue.get(), true, "add", "(Ljava/lang/ref/Reference;)V"); |
| 159 | |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 160 | java_lang_reflect_InvocationHandler_invoke = CacheMethod(env, java_lang_reflect_InvocationHandler, false, "invoke", "(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;"); |
| 161 | java_lang_Thread_init = CacheMethod(env, java_lang_Thread, false, "<init>", "(Ljava/lang/ThreadGroup;Ljava/lang/String;IZ)V"); |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 162 | java_lang_Thread_run = CacheMethod(env, java_lang_Thread, false, "run", "()V"); |
| 163 | java_lang_Thread$UncaughtExceptionHandler_uncaughtException = CacheMethod(env, java_lang_Thread$UncaughtExceptionHandler, false, "uncaughtException", "(Ljava/lang/Thread;Ljava/lang/Throwable;)V"); |
| 164 | java_lang_ThreadGroup_removeThread = CacheMethod(env, java_lang_ThreadGroup, false, "removeThread", "(Ljava/lang/Thread;)V"); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 165 | java_nio_ReadWriteDirectByteBuffer_init = CacheMethod(env, java_nio_ReadWriteDirectByteBuffer, false, "<init>", "(II)V"); |
| 166 | org_apache_harmony_dalvik_ddmc_DdmServer_broadcast = CacheMethod(env, org_apache_harmony_dalvik_ddmc_DdmServer, true, "broadcast", "(I)V"); |
| 167 | org_apache_harmony_dalvik_ddmc_DdmServer_dispatch = CacheMethod(env, org_apache_harmony_dalvik_ddmc_DdmServer, true, "dispatch", "(I[BII)Lorg/apache/harmony/dalvik/ddmc/Chunk;"); |
| 168 | |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 169 | java_lang_Thread_daemon = CacheField(env, java_lang_Thread, false, "daemon", "Z"); |
| 170 | java_lang_Thread_group = CacheField(env, java_lang_Thread, false, "group", "Ljava/lang/ThreadGroup;"); |
| 171 | java_lang_Thread_lock = CacheField(env, java_lang_Thread, false, "lock", "Ljava/lang/ThreadLock;"); |
| 172 | java_lang_Thread_name = CacheField(env, java_lang_Thread, false, "name", "Ljava/lang/String;"); |
| 173 | java_lang_Thread_priority = CacheField(env, java_lang_Thread, false, "priority", "I"); |
| 174 | java_lang_Thread_uncaughtHandler = CacheField(env, java_lang_Thread, false, "uncaughtHandler", "Ljava/lang/Thread$UncaughtExceptionHandler;"); |
| 175 | java_lang_Thread_vmData = CacheField(env, java_lang_Thread, false, "vmData", "I"); |
| 176 | java_lang_ThreadGroup_mainThreadGroup = CacheField(env, java_lang_ThreadGroup, true, "mainThreadGroup", "Ljava/lang/ThreadGroup;"); |
| 177 | java_lang_ThreadGroup_name = CacheField(env, java_lang_ThreadGroup, false, "name", "Ljava/lang/String;"); |
| 178 | java_lang_ThreadGroup_systemThreadGroup = CacheField(env, java_lang_ThreadGroup, true, "systemThreadGroup", "Ljava/lang/ThreadGroup;"); |
| 179 | java_lang_ThreadLock_thread = CacheField(env, java_lang_ThreadLock, false, "thread", "Ljava/lang/Thread;"); |
| 180 | java_lang_reflect_Proxy_h = CacheField(env, java_lang_reflect_Proxy, false, "h", "Ljava/lang/reflect/InvocationHandler;"); |
| 181 | java_nio_ReadWriteDirectByteBuffer_capacity = CacheField(env, java_nio_ReadWriteDirectByteBuffer, false, "capacity", "I"); |
| 182 | java_nio_ReadWriteDirectByteBuffer_effectiveDirectAddress = CacheField(env, java_nio_ReadWriteDirectByteBuffer, false, "effectiveDirectAddress", "I"); |
| 183 | org_apache_harmony_dalvik_ddmc_Chunk_data = CacheField(env, org_apache_harmony_dalvik_ddmc_Chunk, false, "data", "[B"); |
| 184 | org_apache_harmony_dalvik_ddmc_Chunk_length = CacheField(env, org_apache_harmony_dalvik_ddmc_Chunk, false, "length", "I"); |
| 185 | org_apache_harmony_dalvik_ddmc_Chunk_offset = CacheField(env, org_apache_harmony_dalvik_ddmc_Chunk, false, "offset", "I"); |
| 186 | org_apache_harmony_dalvik_ddmc_Chunk_type = CacheField(env, org_apache_harmony_dalvik_ddmc_Chunk, false, "type", "I"); |
Ian Rogers | 00f7d0e | 2012-07-19 15:28:27 -0700 | [diff] [blame] | 187 | |
| 188 | java_lang_Boolean_valueOf = CachePrimitiveBoxingMethod(env, 'Z', "java/lang/Boolean"); |
| 189 | java_lang_Byte_valueOf = CachePrimitiveBoxingMethod(env, 'B', "java/lang/Byte"); |
| 190 | java_lang_Character_valueOf = CachePrimitiveBoxingMethod(env, 'C', "java/lang/Character"); |
| 191 | java_lang_Double_valueOf = CachePrimitiveBoxingMethod(env, 'D', "java/lang/Double"); |
| 192 | java_lang_Float_valueOf = CachePrimitiveBoxingMethod(env, 'F', "java/lang/Float"); |
| 193 | java_lang_Integer_valueOf = CachePrimitiveBoxingMethod(env, 'I', "java/lang/Integer"); |
| 194 | java_lang_Long_valueOf = CachePrimitiveBoxingMethod(env, 'J', "java/lang/Long"); |
| 195 | java_lang_Short_valueOf = CachePrimitiveBoxingMethod(env, 'S', "java/lang/Short"); |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 196 | } |
| 197 | |
Ian Rogers | ef28b14 | 2012-11-30 14:22:18 -0800 | [diff] [blame] | 198 | void WellKnownClasses::LateInit(JNIEnv* env) { |
| 199 | ScopedLocalRef<jclass> java_lang_Runtime(env, env->FindClass("java/lang/Runtime")); |
| 200 | java_lang_Runtime_nativeLoad = CacheMethod(env, java_lang_Runtime.get(), true, "nativeLoad", "(Ljava/lang/String;Ljava/lang/ClassLoader;)Ljava/lang/String;"); |
| 201 | } |
| 202 | |
Elliott Hughes | af8d15a | 2012-05-29 09:12:18 -0700 | [diff] [blame] | 203 | Class* WellKnownClasses::ToClass(jclass global_jclass) { |
| 204 | return reinterpret_cast<Class*>(Thread::Current()->DecodeJObject(global_jclass)); |
Elliott Hughes | eac7667 | 2012-05-24 21:56:51 -0700 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | } // namespace art |