summaryrefslogtreecommitdiffstats
path: root/runtime/mirror/class.h
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/mirror/class.h')
-rw-r--r--runtime/mirror/class.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/runtime/mirror/class.h b/runtime/mirror/class.h
index 9aa23d91d3..d751363e3f 100644
--- a/runtime/mirror/class.h
+++ b/runtime/mirror/class.h
@@ -18,6 +18,7 @@
#define ART_RUNTIME_MIRROR_CLASS_H_
#include "gc/heap.h"
+#include "invoke_type.h"
#include "modifiers.h"
#include "object.h"
#include "primitive.h"
@@ -449,6 +450,20 @@ class MANAGED Class : public Object {
return this->IsInSamePackage(access_to);
}
+ // Can this class access a resolved field?
+ // Note that access to field's class is checked and this may require looking up the class
+ // referenced by the FieldId in the DexFile in case the declaring class is inaccessible.
+ template <bool throw_on_failure>
+ bool CanAccessResolvedField(Class* access_to, ArtField* field,
+ uint32_t field_idx) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
+ // Can this class access a resolved method?
+ // Note that access to methods's class is checked and this may require looking up the class
+ // referenced by the MethodId in the DexFile in case the declaring class is inaccessible.
+ template <bool throw_on_failure, InvokeType throw_invoke_type = kStatic>
+ bool CanAccessResolvedMethod(Class* access_to, ArtMethod* resolved_method,
+ uint32_t method_idx) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
+
bool IsSubClass(const Class* klass) const
SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);