blob: b23a29e7368df1bebf10ea2a0a6b0afc0cbb1014 [file] [log] [blame]
Brian Carlstromf867b6f2011-09-16 12:17:25 -07001/*
2 * Copyright (C) 2008 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 "jni_internal.h"
18#include "class_linker.h"
19#include "object.h"
Elliott Hughes418d20f2011-09-22 14:00:39 -070020#include "reflection.h"
Brian Carlstromf867b6f2011-09-16 12:17:25 -070021
22#include "JniConstants.h" // Last to avoid problems with LOG redefinition.
23
24namespace art {
25
26namespace {
27
28jint Field_getFieldModifiers(JNIEnv* env, jobject jfield, jclass javaDeclaringClass, jint slot) {
Elliott Hughes582a7d12011-10-10 18:38:42 -070029 return Decode<Object*>(env, jfield)->AsField()->GetAccessFlags() & kAccJavaFlagsMask;
Brian Carlstromf867b6f2011-09-16 12:17:25 -070030}
31
Elliott Hughes33203b52011-09-20 19:42:01 -070032bool GetFieldValue(Object* o, Field* f, JValue& value, bool allow_references) {
Brian Carlstromb82b6872011-10-26 17:18:07 -070033 ScopedThreadStateChange tsc(Thread::Current(), Thread::kRunnable);
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070034 switch (f->GetPrimitiveType()) {
35 case Primitive::kPrimBoolean:
Elliott Hughes33203b52011-09-20 19:42:01 -070036 value.z = f->GetBoolean(o);
37 return true;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070038 case Primitive::kPrimByte:
Elliott Hughes33203b52011-09-20 19:42:01 -070039 value.b = f->GetByte(o);
40 return true;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070041 case Primitive::kPrimChar:
Elliott Hughes33203b52011-09-20 19:42:01 -070042 value.c = f->GetChar(o);
43 return true;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070044 case Primitive::kPrimDouble:
Elliott Hughes33203b52011-09-20 19:42:01 -070045 value.d = f->GetDouble(o);
46 return true;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070047 case Primitive::kPrimFloat:
Elliott Hughes33203b52011-09-20 19:42:01 -070048 value.f = f->GetFloat(o);
49 return true;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070050 case Primitive::kPrimInt:
Elliott Hughes33203b52011-09-20 19:42:01 -070051 value.i = f->GetInt(o);
52 return true;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070053 case Primitive::kPrimLong:
Elliott Hughes33203b52011-09-20 19:42:01 -070054 value.j = f->GetLong(o);
55 return true;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070056 case Primitive::kPrimShort:
Elliott Hughes33203b52011-09-20 19:42:01 -070057 value.s = f->GetShort(o);
58 return true;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070059 case Primitive::kPrimNot:
Elliott Hughes33203b52011-09-20 19:42:01 -070060 if (allow_references) {
61 value.l = f->GetObject(o);
62 return true;
63 }
64 // Else break to report an error.
65 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -070066 case Primitive::kPrimVoid:
Elliott Hughes33203b52011-09-20 19:42:01 -070067 // Never okay.
68 break;
69 }
Elliott Hughes5cb5ad22011-10-02 12:13:39 -070070 Thread::Current()->ThrowNewExceptionF("Ljava/lang/IllegalArgumentException;",
Elliott Hughes33203b52011-09-20 19:42:01 -070071 "Not a primitive field: %s", PrettyField(f).c_str());
72 return false;
73}
74
Elliott Hughesed1c1e32011-10-02 14:31:05 -070075bool CheckReceiver(JNIEnv* env, jobject javaObj, jclass javaDeclaringClass, Field* f, Object*& o) {
76 if (f->IsStatic()) {
77 o = NULL;
78 return true;
79 }
80
81 o = Decode<Object*>(env, javaObj);
82 Class* declaringClass = Decode<Class*>(env, javaDeclaringClass);
83 if (!VerifyObjectInClass(env, o, declaringClass)) {
84 return false;
85 }
86 return true;
87}
88
Elliott Hughes582a7d12011-10-10 18:38:42 -070089JValue GetPrimitiveField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jchar dst_descriptor) {
Elliott Hughes418d20f2011-09-22 14:00:39 -070090 Field* f = DecodeField(env->FromReflectedField(javaField));
Elliott Hughesed1c1e32011-10-02 14:31:05 -070091 Object* o = NULL;
92 if (!CheckReceiver(env, javaObj, javaDeclaringClass, f, o)) {
93 return JValue();
Elliott Hughes33203b52011-09-20 19:42:01 -070094 }
95
96 // Read the value.
97 JValue field_value;
98 if (!GetFieldValue(o, f, field_value, false)) {
99 return JValue();
100 }
101
102 // Widen it if necessary (and possible).
103 JValue wide_value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700104 Class* dst_type = Runtime::Current()->GetClassLinker()->FindPrimitiveClass(dst_descriptor);
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700105 if (!ConvertPrimitiveValue(f->GetPrimitiveType(), dst_type->GetPrimitiveType(),
106 field_value, wide_value)) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700107 return JValue();
108 }
109 return wide_value;
110}
111
Elliott Hughes582a7d12011-10-10 18:38:42 -0700112jbyte Field_getBField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar dst_descriptor) {
113 return GetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, dst_descriptor).b;
Elliott Hughes33203b52011-09-20 19:42:01 -0700114}
115
Elliott Hughes582a7d12011-10-10 18:38:42 -0700116jchar Field_getCField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar dst_descriptor) {
117 return GetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, dst_descriptor).c;
Elliott Hughes33203b52011-09-20 19:42:01 -0700118}
119
Elliott Hughes582a7d12011-10-10 18:38:42 -0700120jdouble Field_getDField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar dst_descriptor) {
121 return GetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, dst_descriptor).d;
Elliott Hughes33203b52011-09-20 19:42:01 -0700122}
123
Elliott Hughes582a7d12011-10-10 18:38:42 -0700124jfloat Field_getFField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar dst_descriptor) {
125 return GetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, dst_descriptor).f;
Elliott Hughes33203b52011-09-20 19:42:01 -0700126}
127
Elliott Hughes582a7d12011-10-10 18:38:42 -0700128jint Field_getIField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar dst_descriptor) {
129 return GetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, dst_descriptor).i;
Elliott Hughes33203b52011-09-20 19:42:01 -0700130}
131
Elliott Hughes582a7d12011-10-10 18:38:42 -0700132jlong Field_getJField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar dst_descriptor) {
133 return GetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, dst_descriptor).j;
Elliott Hughes33203b52011-09-20 19:42:01 -0700134}
135
Elliott Hughes582a7d12011-10-10 18:38:42 -0700136jshort Field_getSField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar dst_descriptor) {
137 return GetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, dst_descriptor).s;
Elliott Hughes33203b52011-09-20 19:42:01 -0700138}
139
Elliott Hughes582a7d12011-10-10 18:38:42 -0700140jboolean Field_getZField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar dst_descriptor) {
141 return GetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, dst_descriptor).z;
Elliott Hughes33203b52011-09-20 19:42:01 -0700142}
143
144void SetFieldValue(Object* o, Field* f, const JValue& new_value, bool allow_references) {
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700145 switch (f->GetPrimitiveType()) {
146 case Primitive::kPrimBoolean:
Elliott Hughes33203b52011-09-20 19:42:01 -0700147 f->SetBoolean(o, new_value.z);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700148 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700149 case Primitive::kPrimByte:
Elliott Hughes33203b52011-09-20 19:42:01 -0700150 f->SetByte(o, new_value.b);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700151 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700152 case Primitive::kPrimChar:
Elliott Hughes33203b52011-09-20 19:42:01 -0700153 f->SetChar(o, new_value.c);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700154 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700155 case Primitive::kPrimDouble:
Elliott Hughes33203b52011-09-20 19:42:01 -0700156 f->SetDouble(o, new_value.d);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700157 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700158 case Primitive::kPrimFloat:
Elliott Hughes33203b52011-09-20 19:42:01 -0700159 f->SetFloat(o, new_value.f);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700160 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700161 case Primitive::kPrimInt:
Elliott Hughes33203b52011-09-20 19:42:01 -0700162 f->SetInt(o, new_value.i);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700163 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700164 case Primitive::kPrimLong:
Elliott Hughes33203b52011-09-20 19:42:01 -0700165 f->SetLong(o, new_value.j);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700166 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700167 case Primitive::kPrimShort:
Elliott Hughes33203b52011-09-20 19:42:01 -0700168 f->SetShort(o, new_value.s);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700169 break;
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700170 case Primitive::kPrimNot:
Elliott Hughes33203b52011-09-20 19:42:01 -0700171 if (allow_references) {
172 f->SetObject(o, new_value.l);
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700173 break;
Elliott Hughes33203b52011-09-20 19:42:01 -0700174 }
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700175 // Else fall through to report an error.
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700176 case Primitive::kPrimVoid:
Elliott Hughes33203b52011-09-20 19:42:01 -0700177 // Never okay.
Elliott Hughes5cb5ad22011-10-02 12:13:39 -0700178 Thread::Current()->ThrowNewExceptionF("Ljava/lang/IllegalArgumentException;",
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700179 "Not a primitive field: %s", PrettyField(f).c_str());
180 return;
Elliott Hughes33203b52011-09-20 19:42:01 -0700181 }
Elliott Hughesfe6207f2011-09-26 17:24:06 -0700182
183 // Special handling for final fields on SMP systems.
184 // We need a store/store barrier here (JMM requirement).
185 if (f->IsFinal()) {
186 ANDROID_MEMBAR_STORE();
187 }
Elliott Hughes33203b52011-09-20 19:42:01 -0700188}
189
Elliott Hughes582a7d12011-10-10 18:38:42 -0700190void SetPrimitiveField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jchar src_descriptor, const JValue& new_value) {
Brian Carlstromb82b6872011-10-26 17:18:07 -0700191 ScopedThreadStateChange tsc(Thread::Current(), Thread::kRunnable);
Elliott Hughes418d20f2011-09-22 14:00:39 -0700192 Field* f = DecodeField(env->FromReflectedField(javaField));
Elliott Hughesed1c1e32011-10-02 14:31:05 -0700193 Object* o = NULL;
194 if (!CheckReceiver(env, javaObj, javaDeclaringClass, f, o)) {
195 return;
Elliott Hughes33203b52011-09-20 19:42:01 -0700196 }
197
198 // Widen the value if necessary (and possible).
199 JValue wide_value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700200 Class* src_type = Runtime::Current()->GetClassLinker()->FindPrimitiveClass(src_descriptor);
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700201 if (!ConvertPrimitiveValue(src_type->GetPrimitiveType(), f->GetPrimitiveType(),
202 new_value, wide_value)) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700203 return;
204 }
205
206 // Write the value.
207 SetFieldValue(o, f, wide_value, false);
208}
209
Elliott Hughes582a7d12011-10-10 18:38:42 -0700210void Field_setBField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar src_descriptor, jbyte value) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700211 JValue v = { 0 };
212 v.b = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700213 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700214}
215
Elliott Hughes582a7d12011-10-10 18:38:42 -0700216void Field_setCField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar src_descriptor, jchar value) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700217 JValue v = { 0 };
218 v.c = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700219 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700220}
221
Elliott Hughes582a7d12011-10-10 18:38:42 -0700222void Field_setDField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar src_descriptor, jdouble value) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700223 JValue v = { 0 };
224 v.d = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700225 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700226}
227
Elliott Hughes582a7d12011-10-10 18:38:42 -0700228void Field_setFField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar src_descriptor, jfloat value) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700229 JValue v = { 0 };
230 v.f = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700231 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700232}
233
Elliott Hughes582a7d12011-10-10 18:38:42 -0700234void Field_setIField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar src_descriptor, jint value) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700235 JValue v = { 0 };
236 v.i = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700237 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700238}
239
Elliott Hughes582a7d12011-10-10 18:38:42 -0700240void Field_setJField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar src_descriptor, jlong value) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700241 JValue v = { 0 };
242 v.j = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700243 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700244}
245
Elliott Hughes582a7d12011-10-10 18:38:42 -0700246void Field_setSField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar src_descriptor, jshort value) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700247 JValue v = { 0 };
248 v.s = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700249 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700250}
251
Elliott Hughes582a7d12011-10-10 18:38:42 -0700252void Field_setZField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jchar src_descriptor, jboolean value) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700253 JValue v = { 0 };
254 v.z = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700255 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700256}
257
258void Field_setField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jobject javaValue) {
Brian Carlstromb82b6872011-10-26 17:18:07 -0700259 ScopedThreadStateChange tsc(Thread::Current(), Thread::kRunnable);
Elliott Hughes418d20f2011-09-22 14:00:39 -0700260 Field* f = DecodeField(env->FromReflectedField(javaField));
Elliott Hughes33203b52011-09-20 19:42:01 -0700261
262 // Unbox the value, if necessary.
263 Object* boxed_value = Decode<Object*>(env, javaValue);
264 JValue unboxed_value;
265 if (!UnboxPrimitive(env, boxed_value, f->GetType(), unboxed_value)) {
266 return;
267 }
268
269 // Check that the receiver is non-null and an instance of the field's declaring class.
Elliott Hughesed1c1e32011-10-02 14:31:05 -0700270 Object* o = NULL;
271 if (!CheckReceiver(env, javaObj, javaDeclaringClass, f, o)) {
272 return;
Elliott Hughes33203b52011-09-20 19:42:01 -0700273 }
274
275 SetFieldValue(o, f, unboxed_value, true);
276}
277
278jobject Field_getField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean) {
Elliott Hughes418d20f2011-09-22 14:00:39 -0700279 Field* f = DecodeField(env->FromReflectedField(javaField));
Elliott Hughesed1c1e32011-10-02 14:31:05 -0700280 Object* o = NULL;
281 if (!CheckReceiver(env, javaObj, javaDeclaringClass, f, o)) {
282 return NULL;
Elliott Hughes33203b52011-09-20 19:42:01 -0700283 }
284
285 // Get the field's value, boxing if necessary.
286 JValue value;
287 if (!GetFieldValue(o, f, value, true)) {
288 return NULL;
289 }
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700290 BoxPrimitive(env, f->GetPrimitiveType(), value);
Elliott Hughes33203b52011-09-20 19:42:01 -0700291
292 return AddLocalReference<jobject>(env, value.l);
293}
294
Brian Carlstromf867b6f2011-09-16 12:17:25 -0700295static JNINativeMethod gMethods[] = {
Elliott Hughes33203b52011-09-20 19:42:01 -0700296 NATIVE_METHOD(Field, getFieldModifiers, "(Ljava/lang/Class;I)I"),
297
298 NATIVE_METHOD(Field, getBField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)B"),
299 NATIVE_METHOD(Field, getCField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)C"),
300 NATIVE_METHOD(Field, getDField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)D"),
301 NATIVE_METHOD(Field, getFField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)F"),
302 NATIVE_METHOD(Field, getField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZ)Ljava/lang/Object;"),
303 NATIVE_METHOD(Field, getIField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)I"),
304 NATIVE_METHOD(Field, getJField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)J"),
305 NATIVE_METHOD(Field, getSField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)S"),
306 NATIVE_METHOD(Field, getZField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)Z"),
307 NATIVE_METHOD(Field, setBField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCB)V"),
308 NATIVE_METHOD(Field, setCField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCC)V"),
309 NATIVE_METHOD(Field, setDField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCD)V"),
310 NATIVE_METHOD(Field, setFField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCF)V"),
311 NATIVE_METHOD(Field, setField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZLjava/lang/Object;)V"),
312 NATIVE_METHOD(Field, setIField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCI)V"),
313 NATIVE_METHOD(Field, setJField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCJ)V"),
314 NATIVE_METHOD(Field, setSField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCS)V"),
315 NATIVE_METHOD(Field, setZField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCZ)V"),
Brian Carlstromf867b6f2011-09-16 12:17:25 -0700316};
317
318} // namespace
319
320void register_java_lang_reflect_Field(JNIEnv* env) {
Brian Carlstromf867b6f2011-09-16 12:17:25 -0700321 jniRegisterNativeMethods(env, "java/lang/reflect/Field", gMethods, NELEM(gMethods));
322}
323
324} // namespace art