| Elliott Hughes | 418d20f | 2011-09-22 14:00:39 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2011 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_REFLECTION_H_ | 
|  | 18 | #define ART_SRC_REFLECTION_H_ | 
|  | 19 |  | 
|  | 20 | #include "jni.h" | 
| Brian Carlstrom | 6b4ef02 | 2011-10-23 14:59:04 -0700 | [diff] [blame] | 21 | #include "primitive.h" | 
| Elliott Hughes | 418d20f | 2011-09-22 14:00:39 -0700 | [diff] [blame] | 22 |  | 
|  | 23 | namespace art { | 
|  | 24 |  | 
|  | 25 | class Class; | 
| Elliott Hughes | aaa5edc | 2012-05-16 15:54:30 -0700 | [diff] [blame] | 26 | class Field; | 
| Elliott Hughes | 418d20f | 2011-09-22 14:00:39 -0700 | [diff] [blame] | 27 | union JValue; | 
| Elliott Hughes | 84a5bb4 | 2012-05-16 17:52:15 -0700 | [diff] [blame] | 28 | class Method; | 
| Elliott Hughes | 418d20f | 2011-09-22 14:00:39 -0700 | [diff] [blame] | 29 | class Object; | 
|  | 30 |  | 
| Jesse Wilson | 9a6bae8 | 2011-11-14 14:57:30 -0500 | [diff] [blame] | 31 | void InitBoxingMethods(); | 
| Elliott Hughes | dbac309 | 2012-03-16 18:00:30 -0700 | [diff] [blame] | 32 | void BoxPrimitive(Primitive::Type src_class, JValue& value); | 
| Elliott Hughes | 84a5bb4 | 2012-05-16 17:52:15 -0700 | [diff] [blame] | 33 | bool UnboxPrimitiveForArgument(Object* o, Class* dst_class, JValue& unboxed_value, Method* m, size_t index); | 
| Elliott Hughes | aaa5edc | 2012-05-16 15:54:30 -0700 | [diff] [blame] | 34 | bool UnboxPrimitiveForField(Object* o, Class* dst_class, JValue& unboxed_value, Field* f); | 
|  | 35 | bool UnboxPrimitiveForResult(Object* o, Class* dst_class, JValue& unboxed_value); | 
| Elliott Hughes | 418d20f | 2011-09-22 14:00:39 -0700 | [diff] [blame] | 36 |  | 
| Brian Carlstrom | 6b4ef02 | 2011-10-23 14:59:04 -0700 | [diff] [blame] | 37 | bool ConvertPrimitiveValue(Primitive::Type src_class, Primitive::Type dst_class, const JValue& src, JValue& dst); | 
| Elliott Hughes | 418d20f | 2011-09-22 14:00:39 -0700 | [diff] [blame] | 38 |  | 
| Ian Rogers | 6d4d9fc | 2011-11-30 16:24:48 -0800 | [diff] [blame] | 39 | jobject InvokeMethod(JNIEnv* env, jobject method, jobject receiver, jobject args); | 
| Elliott Hughes | 2a20cfd | 2011-09-23 19:30:41 -0700 | [diff] [blame] | 40 |  | 
| Elliott Hughes | 418d20f | 2011-09-22 14:00:39 -0700 | [diff] [blame] | 41 | bool VerifyObjectInClass(JNIEnv* env, Object* o, Class* c); | 
|  | 42 |  | 
|  | 43 | }  // namespace art | 
|  | 44 |  | 
|  | 45 | #endif  // ART_SRC_REFLECTION_H_ |