Home | History | Annotate | Download | only in runtime
      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_RUNTIME_REFLECTION_H_
     18 #define ART_RUNTIME_REFLECTION_H_
     19 
     20 #include "jni.h"
     21 #include "primitive.h"
     22 
     23 namespace art {
     24 namespace mirror {
     25   class ArtField;
     26   class ArtMethod;
     27   class Class;
     28   class Object;
     29 }  // namespace mirror
     30 union JValue;
     31 class ScopedObjectAccess;
     32 class ThrowLocation;
     33 
     34 mirror::Object* BoxPrimitive(Primitive::Type src_class, const JValue& value)
     35     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
     36 bool UnboxPrimitiveForArgument(mirror::Object* o, mirror::Class* dst_class, JValue& unboxed_value,
     37                                mirror::ArtMethod* m, size_t index)
     38     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
     39 bool UnboxPrimitiveForField(mirror::Object* o, mirror::Class* dst_class, JValue& unboxed_value,
     40                             mirror::ArtField* f)
     41     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
     42 bool UnboxPrimitiveForResult(const ThrowLocation& throw_location, mirror::Object* o,
     43                              mirror::Class* dst_class, JValue& unboxed_value)
     44     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
     45 
     46 bool ConvertPrimitiveValue(const ThrowLocation* throw_location, bool unbox_for_result,
     47                            Primitive::Type src_class, Primitive::Type dst_class,
     48                            const JValue& src, JValue& dst)
     49     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
     50 
     51 jobject InvokeMethod(const ScopedObjectAccess& soa, jobject method, jobject receiver, jobject args)
     52     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
     53 
     54 bool VerifyObjectInClass(mirror::Object* o, mirror::Class* c)
     55     SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
     56 
     57 }  // namespace art
     58 
     59 #endif  // ART_RUNTIME_REFLECTION_H_
     60