blob: 7e66dd960ec3cc23c77eedc855ab5735f7904ce3 [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 }
Jesse Wilsonc129a6b2011-11-24 14:47:46 -0500197 if (f->GetPrimitiveType() == Primitive::kPrimNot) {
198 Thread::Current()->ThrowNewExceptionF("Ljava/lang/IllegalArgumentException;",
199 "Not a primitive field: %s", PrettyField(f).c_str());
200 return;
201 }
Elliott Hughes33203b52011-09-20 19:42:01 -0700202
203 // Widen the value if necessary (and possible).
204 JValue wide_value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700205 Class* src_type = Runtime::Current()->GetClassLinker()->FindPrimitiveClass(src_descriptor);
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700206 if (!ConvertPrimitiveValue(src_type->GetPrimitiveType(), f->GetPrimitiveType(),
207 new_value, wide_value)) {
Elliott Hughes33203b52011-09-20 19:42:01 -0700208 return;
209 }
210
211 // Write the value.
212 SetFieldValue(o, f, wide_value, false);
213}
214
Elliott Hughes582a7d12011-10-10 18:38:42 -0700215void 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 -0700216 JValue v = { 0 };
217 v.b = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700218 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700219}
220
Elliott Hughes582a7d12011-10-10 18:38:42 -0700221void 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 -0700222 JValue v = { 0 };
223 v.c = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700224 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700225}
226
Elliott Hughes582a7d12011-10-10 18:38:42 -0700227void 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 -0700228 JValue v = { 0 };
229 v.d = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700230 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700231}
232
Elliott Hughes582a7d12011-10-10 18:38:42 -0700233void 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 -0700234 JValue v = { 0 };
235 v.f = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700236 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700237}
238
Elliott Hughes582a7d12011-10-10 18:38:42 -0700239void 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 -0700240 JValue v = { 0 };
241 v.i = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700242 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700243}
244
Elliott Hughes582a7d12011-10-10 18:38:42 -0700245void 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 -0700246 JValue v = { 0 };
247 v.j = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700248 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700249}
250
Elliott Hughes582a7d12011-10-10 18:38:42 -0700251void 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 -0700252 JValue v = { 0 };
253 v.s = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700254 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700255}
256
Elliott Hughes582a7d12011-10-10 18:38:42 -0700257void 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 -0700258 JValue v = { 0 };
259 v.z = value;
Elliott Hughes582a7d12011-10-10 18:38:42 -0700260 SetPrimitiveField(env, javaField, javaObj, javaDeclaringClass, src_descriptor, v);
Elliott Hughes33203b52011-09-20 19:42:01 -0700261}
262
263void Field_setField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean, jobject javaValue) {
Brian Carlstromb82b6872011-10-26 17:18:07 -0700264 ScopedThreadStateChange tsc(Thread::Current(), Thread::kRunnable);
Elliott Hughes418d20f2011-09-22 14:00:39 -0700265 Field* f = DecodeField(env->FromReflectedField(javaField));
Elliott Hughes33203b52011-09-20 19:42:01 -0700266
267 // Unbox the value, if necessary.
268 Object* boxed_value = Decode<Object*>(env, javaValue);
269 JValue unboxed_value;
270 if (!UnboxPrimitive(env, boxed_value, f->GetType(), unboxed_value)) {
271 return;
272 }
273
274 // Check that the receiver is non-null and an instance of the field's declaring class.
Elliott Hughesed1c1e32011-10-02 14:31:05 -0700275 Object* o = NULL;
276 if (!CheckReceiver(env, javaObj, javaDeclaringClass, f, o)) {
277 return;
Elliott Hughes33203b52011-09-20 19:42:01 -0700278 }
279
280 SetFieldValue(o, f, unboxed_value, true);
281}
282
283jobject Field_getField(JNIEnv* env, jobject javaField, jobject javaObj, jclass javaDeclaringClass, jclass, jint, jboolean) {
Elliott Hughes418d20f2011-09-22 14:00:39 -0700284 Field* f = DecodeField(env->FromReflectedField(javaField));
Elliott Hughesed1c1e32011-10-02 14:31:05 -0700285 Object* o = NULL;
286 if (!CheckReceiver(env, javaObj, javaDeclaringClass, f, o)) {
287 return NULL;
Elliott Hughes33203b52011-09-20 19:42:01 -0700288 }
289
290 // Get the field's value, boxing if necessary.
291 JValue value;
292 if (!GetFieldValue(o, f, value, true)) {
293 return NULL;
294 }
Brian Carlstrom6b4ef022011-10-23 14:59:04 -0700295 BoxPrimitive(env, f->GetPrimitiveType(), value);
Elliott Hughes33203b52011-09-20 19:42:01 -0700296
297 return AddLocalReference<jobject>(env, value.l);
298}
299
Brian Carlstromf867b6f2011-09-16 12:17:25 -0700300static JNINativeMethod gMethods[] = {
Elliott Hughes33203b52011-09-20 19:42:01 -0700301 NATIVE_METHOD(Field, getFieldModifiers, "(Ljava/lang/Class;I)I"),
302
303 NATIVE_METHOD(Field, getBField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)B"),
304 NATIVE_METHOD(Field, getCField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)C"),
305 NATIVE_METHOD(Field, getDField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)D"),
306 NATIVE_METHOD(Field, getFField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)F"),
307 NATIVE_METHOD(Field, getField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZ)Ljava/lang/Object;"),
308 NATIVE_METHOD(Field, getIField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)I"),
309 NATIVE_METHOD(Field, getJField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)J"),
310 NATIVE_METHOD(Field, getSField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)S"),
311 NATIVE_METHOD(Field, getZField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZC)Z"),
312 NATIVE_METHOD(Field, setBField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCB)V"),
313 NATIVE_METHOD(Field, setCField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCC)V"),
314 NATIVE_METHOD(Field, setDField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCD)V"),
315 NATIVE_METHOD(Field, setFField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCF)V"),
316 NATIVE_METHOD(Field, setField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZLjava/lang/Object;)V"),
317 NATIVE_METHOD(Field, setIField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCI)V"),
318 NATIVE_METHOD(Field, setJField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCJ)V"),
319 NATIVE_METHOD(Field, setSField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCS)V"),
320 NATIVE_METHOD(Field, setZField, "(Ljava/lang/Object;Ljava/lang/Class;Ljava/lang/Class;IZCZ)V"),
Brian Carlstromf867b6f2011-09-16 12:17:25 -0700321};
322
323} // namespace
324
325void register_java_lang_reflect_Field(JNIEnv* env) {
Brian Carlstromf867b6f2011-09-16 12:17:25 -0700326 jniRegisterNativeMethods(env, "java/lang/reflect/Field", gMethods, NELEM(gMethods));
327}
328
329} // namespace art