blob: a73cd45ca4a377fc67ebca3a4670c19ad26c9963 [file] [log] [blame]
Mathieu Chartierfc58af42015-04-16 18:00:39 -07001/*
2 * Copyright (C) 2015 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_MIRROR_METHOD_H_
18#define ART_RUNTIME_MIRROR_METHOD_H_
19
Neil Fuller0e844392016-09-08 13:43:31 +010020#include "executable.h"
Mathieu Chartierfc58af42015-04-16 18:00:39 -070021
22namespace art {
Vladimir Markod93e3742018-07-18 10:58:13 +010023
24template<class MirrorType> class ObjPtr;
25
Mathieu Chartierfc58af42015-04-16 18:00:39 -070026namespace mirror {
27
28class Class;
29
30// C++ mirror of java.lang.reflect.Method.
Neil Fuller0e844392016-09-08 13:43:31 +010031class MANAGED Method : public Executable {
Mathieu Chartierfc58af42015-04-16 18:00:39 -070032 public:
Andreas Gampe542451c2016-07-26 09:02:02 -070033 template <PointerSize kPointerSize, bool kTransactionActive>
Vladimir Markod93e3742018-07-18 10:58:13 +010034 static ObjPtr<Method> CreateFromArtMethod(Thread* self, ArtMethod* method)
Andreas Gampebdf7f1c2016-08-30 16:38:47 -070035 REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
Mathieu Chartierfc58af42015-04-16 18:00:39 -070036
Mathieu Chartierfc58af42015-04-16 18:00:39 -070037 private:
Mathieu Chartierfc58af42015-04-16 18:00:39 -070038 DISALLOW_COPY_AND_ASSIGN(Method);
39};
40
41// C++ mirror of java.lang.reflect.Constructor.
Neil Fuller0e844392016-09-08 13:43:31 +010042class MANAGED Constructor: public Executable {
Mathieu Chartierfc58af42015-04-16 18:00:39 -070043 public:
Andreas Gampe542451c2016-07-26 09:02:02 -070044 template <PointerSize kPointerSize, bool kTransactionActive>
Vladimir Markod93e3742018-07-18 10:58:13 +010045 static ObjPtr<Constructor> CreateFromArtMethod(Thread* self, ArtMethod* method)
Andreas Gampebdf7f1c2016-08-30 16:38:47 -070046 REQUIRES_SHARED(Locks::mutator_lock_) REQUIRES(!Roles::uninterruptible_);
Mathieu Chartierfc58af42015-04-16 18:00:39 -070047
Mathieu Chartierfc58af42015-04-16 18:00:39 -070048 private:
Mathieu Chartierfc58af42015-04-16 18:00:39 -070049 DISALLOW_COPY_AND_ASSIGN(Constructor);
50};
51
52} // namespace mirror
53} // namespace art
54
55#endif // ART_RUNTIME_MIRROR_METHOD_H_